mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Account for the trailing optional argument of \usepackage.
The full syntax is \usepackage[<options>]{<name>}[<min.date>] even if this is not documented in my old Lamport's LaTeX book...
This commit is contained in:
parent
3c3cb777d6
commit
5998555743
@ -193,8 +193,10 @@ def fix_latex_file(latex_file, pdf_output):
|
||||
tmp.write("\\def\\t@a{microtype}\n")
|
||||
tmp.write("\\let\\oldusepkg\\usepackage\n")
|
||||
tmp.write("\\def\\usepackage{\\@ifnextchar[\\@usepkg{\\@usepkg[]}}\n")
|
||||
tmp.write("\\def\@usepkg[#1]#2{\\def\\t@b{#2}")
|
||||
tmp.write("\\ifx\\t@a\\t@b\\else\\oldusepkg[#1]{#2}\\fi}\n")
|
||||
tmp.write("\\def\\@usepkg[#1]#2{\\@ifnextchar[")
|
||||
tmp.write("{\\@@usepkg[#1]{#2}}{\\@@usepkg[#1]{#2}[]}}\n")
|
||||
tmp.write("\\def\@@usepkg[#1]#2[#3]{\\def\\t@b{#2}")
|
||||
tmp.write("\\ifx\\t@a\\t@b\\else\\oldusepkg[#1]{#2}[#3]\\fi}\n")
|
||||
tmp.write(line)
|
||||
continue
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user