mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Use \ifthenelse instead of relying on TeX primitives
This fixes the issue reported here: https://www.mail-archive.com/lyx-users@lists.lyx.org/msg115156.html The problem is due to the use of the mathpazo package because it defines the macro \f@family as "ppl\n", i.e., it appends a newline character at the end. Now, the "\if" TeX primitive expands its arguments for comparing them and the newline causes a "missing \begin{document}" error. Instead of complicating the code to account for this, it is better using the ifthen package.
This commit is contained in:
parent
2f25a73cdc
commit
0ffcff55f3
@ -252,11 +252,10 @@ def legacy_latex_file(latex_file, fg_color, bg_color):
|
|||||||
\\definecolor{lyxbg}{rgb}{%s}
|
\\definecolor{lyxbg}{rgb}{%s}
|
||||||
\\pagecolor{lyxbg}
|
\\pagecolor{lyxbg}
|
||||||
\\usepackage[%s,tightpage]{preview}
|
\\usepackage[%s,tightpage]{preview}
|
||||||
|
\\usepackage{ifthen}
|
||||||
\\makeatletter
|
\\makeatletter
|
||||||
\\def\\t@a{cmr}
|
\\ifthenelse{\\equal{\\f@family}{cmr}}{
|
||||||
\\if\\f@family\\t@a
|
\\IfFileExists{lmodern.sty}{\\usepackage{lmodern}}{\\usepackage{ae,aecompl}}}{}
|
||||||
\\IfFileExists{lmodern.sty}{\\usepackage{lmodern}}{\\usepackage{ae,aecompl}}
|
|
||||||
\\fi
|
|
||||||
\\g@addto@macro\\preview{\\begingroup\\color{lyxbg}\\special{ps::clippath fill}\\color{lyxfg}}
|
\\g@addto@macro\\preview{\\begingroup\\color{lyxbg}\\special{ps::clippath fill}\\color{lyxfg}}
|
||||||
\\g@addto@macro\\endpreview{\\endgroup}
|
\\g@addto@macro\\endpreview{\\endgroup}
|
||||||
\\makeatother
|
\\makeatother
|
||||||
|
@ -52,6 +52,8 @@ What's new
|
|||||||
|
|
||||||
- Avoid crashing on a recursive macro definition (bug 12633).
|
- Avoid crashing on a recursive macro definition (bug 12633).
|
||||||
|
|
||||||
|
- Fix issue with on-screen instant preview and the mathpazo package.
|
||||||
|
|
||||||
|
|
||||||
* INTERNALS
|
* INTERNALS
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user