Am Samstag, den 09.07.2016, 12:13 +0200 schrieb Kornel Benko:
> > \\pageheight\\paperheight
> > \\pagewidth\\paperwidth
> 
> Looks good, but I am no expert. Maybe Günter or Jürgen could comment.
> What about code in ERT or preamble with '\pdfsometing'?

I would prefer something like the attached (output code only for
relevant backends). This uses the new luatex commands, but provides
aliases for older versions.

Jürgen
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index 16ec4c1..7a5a8fd 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"
+	"\\providecommand\\pageheight{\\pdfpageheight}\n"
+	"\\providecommand\\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");
@@ -1173,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';
 	}

Reply via email to