Handle \not using a macro

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5458 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Dekel Tsur 2002-10-21 13:38:02 +00:00
parent dde4494e66
commit b04538960e
5 changed files with 27 additions and 16 deletions

View File

@ -1,3 +1,7 @@
2002-10-21 Dekel Tsur <dekelts@tau.ac.il>
* symbols: Handle \not using a macro.
2002-10-21 Martin Vermeer <martin.vermeer@hut.fi> 2002-10-21 Martin Vermeer <martin.vermeer@hut.fi>
* layouts/foils.layout: add more layouts * layouts/foils.layout: add more layouts

View File

@ -196,8 +196,13 @@ clubsuit cmsy 124 167 mathord x
diamondsuit cmsy 125 168 mathord x diamondsuit cmsy 125 168 mathord x
heartsuit cmsy 126 169 mathord x heartsuit cmsy 126 169 mathord x
spadesuit cmsy 127 170 mathord x spadesuit cmsy 127 170 mathord x
# We define \not as mathrel in order to align it properly # We define lyxnot as mathrel in order to have proper alignment
not cmsy 54 0 mathrel x lyxnot cmsy 54 47 mathrel x
iffont cmsy
\def\not{\lyxnot\kern-12mu}
else
\def\not{\lyxnot\kern-20mu}
endif
coprod cmex 96 0 mathop x coprod cmex 96 0 mathop x
bigvee cmex 87 0 mathop x bigvee cmex 87 0 mathop x
bigwedge cmex 86 0 mathop x bigwedge cmex 86 0 mathop x
@ -779,20 +784,20 @@ iffont cmsy
\def\mapsto{\mapstochar\kern-12mu\rightarrow} \def\mapsto{\mapstochar\kern-12mu\rightarrow}
\def\longmapsto{\mapstochar\kern-9mu\lyxbar\kern-11mu\rightarrow} \def\longmapsto{\mapstochar\kern-9mu\lyxbar\kern-11mu\rightarrow}
\def\models{\vert\kern-7.5mu\lyxeq} \def\models{\vert\kern-7.5mu\lyxeq}
end endif
iffont cmm iffont cmm
\def\hookrightarrow{\lhook\kern-13mu\rightarrow} \def\hookrightarrow{\lhook\kern-13mu\rightarrow}
\def\hookleftarrow{\leftarrow\kern-13mu\rhook} \def\hookleftarrow{\leftarrow\kern-13mu\rhook}
\def\bowtie{\triangleright\kern-6mu\triangleleft} \def\bowtie{\triangleright\kern-6mu\triangleleft}
end endif
iffont msa iffont msa
\def\dashrightarrow{\lyxdabar\lyxdabar\lyxright} \def\dashrightarrow{\lyxdabar\lyxdabar\lyxright}
\def\dashleftarrow{\lyxleft\lyxdabar\lyxdabar} \def\dashleftarrow{\lyxleft\lyxdabar\lyxdabar}
\def\dasharrow{\dashrightarrow} \def\dasharrow{\dashrightarrow}
end endif
iffont msb iffont msb
\def\Join{\ltimes\kern-12mu\rtimes} \def\Join{\ltimes\kern-12mu\rtimes}
end endif
\def\mathcircumflex{\mbox{\^{}}} \def\mathcircumflex{\mbox{\^{}}}
neq lyxsymbol 185 0 mathrel x neq lyxsymbol 185 0 mathrel x

View File

@ -1,3 +1,9 @@
2002-10-21 Dekel Tsur <dekelts@tau.ac.il>
* math_factory.C (initSymbols): Support "else" token.
* math_symbolinset.C (metrics): Remove special case for \not.
2002-10-18 Angus Leeming <leeming@lyx.org> 2002-10-18 Angus Leeming <leeming@lyx.org>
* formula.C (latexString): Revert yesterday's change. It's going to * formula.C (latexString): Revert yesterday's change. It's going to

View File

@ -109,7 +109,9 @@ void initSymbols()
is >> tmp; is >> tmp;
skip = !math_font_available(tmp); skip = !math_font_available(tmp);
continue; continue;
} else if (line.size() >= 3 && line.substr(0, 3) == "end") { } else if (line.size() >= 4 && line.substr(0, 4) == "else") {
skip = !skip;
} else if (line.size() >= 5 && line.substr(0, 5) == "endif") {
skip = false; skip = false;
continue; continue;
} else if (skip) } else if (skip)

View File

@ -57,12 +57,8 @@ void MathSymbolInset::metrics(MathMetricsInfo & mi) const
dim_.d -= h_; dim_.d -= h_;
} }
// seperate things a bit // seperate things a bit
int em = mathed_char_width(mi.base.font, 'M'); int const em = mathed_char_width(mi.base.font, 'M');
if (name() == "not") if (isRelOp())
// \not is a special case.
// It must have 0 width to align properly with the next symbol.
dim_.w = 0;
else if (isRelOp())
dim_.w += static_cast<int>(0.5*em+0.5); dim_.w += static_cast<int>(0.5*em+0.5);
else else
dim_.w += static_cast<int>(0.15*em+0.5); dim_.w += static_cast<int>(0.15*em+0.5);
@ -80,9 +76,7 @@ void MathSymbolInset::draw(MathPainterInfo & pi, int x, int y) const
// << "' in font: '" << sym_->inset // << "' in font: '" << sym_->inset
// << "' drawn as: '" << sym_->draw // << "' drawn as: '" << sym_->draw
// << "'\n"; // << "'\n";
int em = mathed_char_width(pi.base.font, 'M'); int const em = mathed_char_width(pi.base.font, 'M');
// Here we don't need a special case for \not, as it needs the same
// increase in x as the next symbol.
if (isRelOp()) if (isRelOp())
x += static_cast<int>(0.25*em+0.5); x += static_cast<int>(0.25*em+0.5);
else else