New simplified definition of \lyxmathsym and better re-import from latex.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@28989 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2009-03-31 11:29:31 +00:00
parent 7ed0249324
commit 4f2d5f39ee
7 changed files with 33 additions and 30 deletions

View File

@ -228,6 +228,7 @@
%%% Packages %%% Packages
\TestPackage{accents} \TestPackage{accents}
\TestPackage{algorithm} \TestPackage{algorithm}
\TestPackage{amstext}
\TestPackage{array} \TestPackage{array}
\TestPackage{babel} \TestPackage{babel}
\TestPackage{bibtopic} \TestPackage{bibtopic}
@ -262,7 +263,6 @@
\TestPackage{pdfpages} \TestPackage{pdfpages}
\TestPackage{prettyref} \TestPackage{prettyref}
\TestPackage{preview} \TestPackage{preview}
\TestPackage{relsize}
\TestPackage{rotating} \TestPackage{rotating}
\TestPackage{rotfloat} \TestPackage{rotfloat}
\TestPackage{setspace} \TestPackage{setspace}

View File

@ -3537,14 +3537,14 @@ longtable
\end_layout \end_layout
\begin_layout Subsection \begin_layout Subsection
relsize amstext
\end_layout \end_layout
\begin_layout Description \begin_layout Description
Found: Found:
\begin_inset Info \begin_inset Info
type "package" type "package"
arg "relsize" arg "amstext"
\end_inset \end_inset
@ -3553,13 +3553,13 @@ arg "relsize"
\begin_layout Description \begin_layout Description
CTAN: CTAN:
\family typewriter \family typewriter
macros/latex/contrib/misc/ macros/latex/required/amslatex/math/
\end_layout \end_layout
\begin_layout Description \begin_layout Description
Notes: The package Notes: The package
\family sans \family sans
relsize amstext
\family default \family default
is needed by LyX to correctly size unicode symbols used as super or subscripts is needed by LyX to correctly size unicode symbols used as super or subscripts
in math. in math.

View File

@ -3277,14 +3277,14 @@ longtable
\end_layout \end_layout
\begin_layout Subsection \begin_layout Subsection
relsize amstext
\end_layout \end_layout
\begin_layout Description \begin_layout Description
検出: 検出:
\begin_inset Info \begin_inset Info
type "package" type "package"
arg "relsize" arg "amstext"
\end_inset \end_inset
@ -3293,13 +3293,13 @@ arg "relsize"
\begin_layout Description \begin_layout Description
CTAN: CTAN:
\family typewriter \family typewriter
macros/latex/contrib/misc/ macros/latex/required/amslatex/math/
\end_layout \end_layout
\begin_layout Description \begin_layout Description
備考: 備考:
\family sans \family sans
relsize amstext
\family default \family default
パッケージは、unicodeシンボルを数式内で上付きや下付き文字にする際、LyXが正しい寸法に調整するのに必要とします。 パッケージは、unicodeシンボルを数式内で上付きや下付き文字にする際、LyXが正しい寸法に調整するのに必要とします。
\end_layout \end_layout

View File

@ -601,7 +601,7 @@ void Encodings::validate(char_type c, LaTeXFeatures & features, bool for_mathed)
} }
} }
if (for_mathed && isMathSym(c)) { if (for_mathed && isMathSym(c)) {
features.require("relsize"); features.require("amstext");
features.require("lyxmathsym"); features.require("lyxmathsym");
} }
#endif #endif

View File

@ -201,11 +201,8 @@ static string const textcyr_def =
"\\AtBeginDocument{\\DeclareFontEncoding{T2A}{}{}}\n"; "\\AtBeginDocument{\\DeclareFontEncoding{T2A}{}{}}\n";
static string const lyxmathsym_def = static string const lyxmathsym_def =
"\\DeclareRobustCommand{\\lyxmathsym}[1]{\\ifmmode\\begingroup\\def\\b@ld{bold}\n" "\\newcommand{\\lyxmathsym}[1]{\\ifmmode\\begingroup\\def\\b@ld{bold}\n"
" \\def\\rmorbf##1{\\ifx\\math@version\\b@ld\\textbf{##1}\\else\\textrm{##1}\\fi}\n" " \\text{\\ifx\\math@version\\b@ld\\bfseries\\fi#1}\\endgroup\\else#1\\fi}\n";
" \\mathchoice{\\hbox{\\rmorbf{#1}}}{\\hbox{\\rmorbf{#1}}}\n"
" {\\hbox{\\smaller[2]\\rmorbf{#1}}}{\\hbox{\\smaller[3]\\rmorbf{#1}}}\n"
" \\endgroup\\else#1\\fi}\n";
static string const papersizedvi_def = static string const papersizedvi_def =
"\\special{papersize=\\the\\paperwidth,\\the\\paperheight}\n"; "\\special{papersize=\\the\\paperwidth,\\the\\paperheight}\n";
@ -513,7 +510,6 @@ char const * simplefeatures[] = {
// listings is handled in BufferParams.cpp // listings is handled in BufferParams.cpp
"bm", "bm",
"pdfpages", "pdfpages",
"relsize",
"amscd", "amscd",
"slashed" "slashed"
}; };
@ -585,9 +581,12 @@ string const LaTeXFeatures::getPackages() const
&& params_.use_esint == BufferParams::package_off && params_.use_esint == BufferParams::package_off
&& params_.use_amsmath != BufferParams::package_off)) { && params_.use_amsmath != BufferParams::package_off)) {
packages << "\\usepackage{amsmath}\n"; packages << "\\usepackage{amsmath}\n";
} else if (mustProvide("amsbsy")) { } else {
// amsbsy is already provided by amsmath // amsbsy and amstext are already provided by amsmath
packages << "\\usepackage{amsbsy}\n"; if (mustProvide("amsbsy"))
packages << "\\usepackage{amsbsy}\n";
if (mustProvide("amstext"))
packages << "\\usepackage{amstext}\n";
} }
// wasysym is a simple feature, but it must be after amsmath if both // wasysym is a simple feature, but it must be after amsmath if both

View File

@ -1659,17 +1659,18 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
return success_; return success_;
} }
docstring rem; docstring rem;
cmd = Encodings::fromLaTeXCommand(cmd, rem); do {
for (size_t i = 0; i < cmd.size(); ++i) cmd = Encodings::fromLaTeXCommand(cmd, rem);
cell->push_back(MathAtom(new InsetMathChar(cmd[i]))); for (size_t i = 0; i < cmd.size(); ++i)
if (rem.size()) { cell->push_back(MathAtom(new InsetMathChar(cmd[i])));
MathAtom at = createInsetMath(t.cs()); if (rem.size()) {
cell->push_back(at); char_type c = rem[0];
MathData ar; cell->push_back(MathAtom(new InsetMathChar(c)));
if (!mathed_parse_cell(ar, '{' + rem + '}', mode_)) cmd = rem.substr(1);
success_ = false;; rem.clear();
cell->append(ar); } else
} cmd.clear();
} while (cmd.size());
} }
else if (t.cs().size()) { else if (t.cs().size()) {

View File

@ -49,6 +49,9 @@ What's new
- Quotes in InsetListings are now plain quotes, rather than InsetQuote - Quotes in InsetListings are now plain quotes, rather than InsetQuote
entries (bug 5782). entries (bug 5782).
- Improved re-import from LaTeX of documents containing unadorned unicode
symbols in math.
* USER INTERFACE * USER INTERFACE