X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeXFeatures.cpp;h=8b7287e5307e2cc384f75d02c69a6839245539ad;hb=338cef2a976d5bf36c334d2cc8ce437da7f6d815;hp=3a2e775316167c292de4e795d7bb2058a7ae2ae6;hpb=ba2b86fa5d718c434521a7b9722e6ccd677864ad;p=lyx.git diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 3a2e775316..8b7287e530 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -229,6 +229,13 @@ static docstring const papersizepdf_def = from_ascii( "\\pdfpageheight\\paperheight\n" "\\pdfpagewidth\\paperwidth\n"); +static docstring const papersizepdflua_def = from_ascii( + "% Backwards compatibility for LuaTeX < 0.90\n" + "\\@ifundefined{pageheight}{\\let\\pageheight\\pdfpageheight}\n" + "\\@ifundefined{pagewidth}{\\let\\pagewidth\\pdfpagewidth}\n" + "\\pageheight\\paperheight\n" + "\\pagewidth\\paperwidth\n"); + static docstring const cedilla_def = from_ascii( "\\newcommand{\\docedilla}[2]{\\underaccent{#1\\mathchar'30}{#2}}\n" "\\newcommand{\\cedilla}[1]{\\mathpalette\\docedilla{#1}}\n"); @@ -579,11 +586,12 @@ bool LaTeXFeatures::isAvailable(string const & name) } -void LaTeXFeatures::addPreambleSnippet(string const & preamble) +void LaTeXFeatures::addPreambleSnippet(string const & preamble, + bool allowdupes) { SnippetList::const_iterator begin = preamble_snippets_.begin(); SnippetList::const_iterator end = preamble_snippets_.end(); - if (find(begin, end, preamble) == end) + if (allowdupes || find(begin, end, preamble) == end) preamble_snippets_.push_back(preamble); } @@ -1172,8 +1180,11 @@ docstring const LaTeXFeatures::getMacros() const } if (mustProvide("papersize")) { - if (runparams_.flavor == OutputParams::LATEX) + if (runparams_.flavor == OutputParams::LATEX + || runparams_.flavor == OutputParams::DVILUATEX) macros << papersizedvi_def << '\n'; + else if (runparams_.flavor == OutputParams::LUATEX) + macros << papersizepdflua_def << '\n'; else macros << papersizepdf_def << '\n'; }