Am Freitag, 8. Juli 2016 um 22:05:57, schrieb Scott Kostyshak <skost...@lyx.org>
> On Sat, Jul 09, 2016 at 12:38:53AM +0200, Kornel Benko wrote:
> > Am Freitag, 8. Juli 2016 um 18:14:29, schrieb Scott Kostyshak 
> > <skost...@lyx.org>
>
> > ATM, the patch I have works for me.
>
> It is better than the patch I originally proposed. It is unfortunate to
> add a sizeable chunk of LaTeX, but I don't see see an alternative (from
> what I understand, in LyX we don't even track the LuaTeX version so we
> cannot do the contionals with C++ code. Further, even if we did have
> that information I wonder if we would still choose the LaTeX
> conditionals as you propose because this way exported LaTeX code will be
> valid if compiled on older LuaTeX engines).
>
> I have two comments below.
>
> > diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
> > index 16ec4c1..602dd5f 100644
> > --- a/src/LaTeXFeatures.cpp
> > +++ b/src/LaTeXFeatures.cpp
> > @@ -226,8 +226,18 @@ static docstring const papersizedvi_def = from_ascii(
> >     "\\special{papersize=\\the\\paperwidth,\\the\\paperheight}\n");
> >
>
> Should we put a comment here, perhaps to this email thread?
> // https://www.mail-archive.com/search?l=mid&q75450.Hf17PhF3sW%40amd64

OK, done.

> >  static docstring const papersizepdf_def = from_ascii(
> > -   "\\pdfpageheight\\paperheight\n"
> > -   "\\pdfpagewidth\\paperwidth\n");
> > +   "\\RequirePackage{ifluatex}\n"
> > +   "\\ifluatex\n"
> > +   "  \\ifdim\\luatexversion pt> 94 pt\n"
> > +   "    \\usepackage{luatex85}\n"
>
> Instead of relying on the luatex85 package, which is meant to only be a
> temporary fix, I wonder if we can already implement something more
> permanent. So instead of the above line, can we just put the following?
>
> \\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'?

> as described as the "pure luatex syntax (from 0.85 on is)" [1]. Further,
> I imagine it is more efficient to execute those commands than to load
> another package.
>
> Scott
>
> [1] https://www.mail-archive.com/luatex@tug.org/msg05793.html

        Kornel
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index 16ec4c1..dc1fc00 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -225,7 +225,15 @@ static docstring const lyxmathsym_def = from_ascii(
 static docstring const papersizedvi_def = from_ascii(
 	"\\special{papersize=\\the\\paperwidth,\\the\\paperheight}\n");

+// See also this email thread
+// https://www.mail-archive.com/search?l=mid&q75450.Hf17PhF3sW%40amd64
 static docstring const papersizepdf_def = from_ascii(
+	"\\RequirePackage{ifluatex}\n"
+	"\\ifluatex\n"
+	"  \\ifdim\\luatexversion pt> 94 pt\n"
+	"    \\usepackage{luatex85}\n"
+	"  \\fi\n"
+	"\\fi\n"
 	"\\pdfpageheight\\paperheight\n"
 	"\\pdfpagewidth\\paperwidth\n");

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to