[latex3-commits] [git/LaTeX3-latex3-latex3] master: LuaTeX from TL'18 onward can set PDF major version (135bcde)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Apr 12 00:30:24 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/135bcde3ee5a4aaecc6d5a89fe9886ef677f2fbc

>---------------------------------------------------------------

commit 135bcde3ee5a4aaecc6d5a89fe9886ef677f2fbc
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Apr 11 23:30:24 2019 +0100

    LuaTeX from TL'18 onward can set PDF major version
    
    Thought  you get some odd effects in the TL'18 one if
    you set v2.0 ...


>---------------------------------------------------------------

135bcde3ee5a4aaecc6d5a89fe9886ef677f2fbc
 l3kernel/l3drivers-pdf.dtx |   34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git a/l3kernel/l3drivers-pdf.dtx b/l3kernel/l3drivers-pdf.dtx
index 590c6e3..26d9cbc 100644
--- a/l3kernel/l3drivers-pdf.dtx
+++ b/l3kernel/l3drivers-pdf.dtx
@@ -557,9 +557,24 @@
 %
 % \begin{macro}
 %   {\driver_pdf_version_major_gset:n, \driver_pdf_version_minor_gset:n}
-%   At present, we don't have a primitive for the major version!
+%   At present, we don't have a primitive for the major version in \pdfTeX{},
+%   but we anticipate one \ldots
 %    \begin{macrocode}
-\cs_new_protected:Npn \driver_pdf_version_major_gset:n #1 { }
+\cs_new_protected:Npx \driver_pdf_version_major_gset:n #1
+  {
+    \cs_if_exist:NTF \tex_pdfvariable:D
+      {
+        \int_compare:nNnT \tex_luatexversion:D > { 106 }
+          {
+            \tex_pdfvariable:D majorversion
+              \exp_not:N \int_eval:n {#1} \scan_stop:
+          }
+      }
+      {
+        \cs_if_exist:NT \tex_pdfmajorversion:D
+          { \tex_pdfmajorversion:D \exp_not:N \int_eval:n {#1} \scan_stop: }
+      }
+  }
 \cs_new_protected:Npx \driver_pdf_version_minor_gset:n #1
   {
     \cs_if_exist:NTF \tex_pdfminorversion:D
@@ -573,7 +588,20 @@
 % \begin{macro}[EXP]{\driver_pdf_version_major:, \driver_pdf_version_minor:}
 %   At present, we don't have a primitive for the major version!
 %    \begin{macrocode}
-\cs_new:Npx \driver_pdf_version_major: { 1 }
+\cs_new_protected:Npx \driver_pdf_version_major:
+  {
+    \cs_if_exist:NTF \tex_pdfvariable:D
+      {
+        \int_compare:nNnTF \tex_luatexversion:D > { 106 }
+          { \exp_not:N \tex_the:D \tex_pdfvariable:D majorversion }
+          { 1 }
+      }
+      {
+        \cs_if_exist:NTF \tex_pdfmajorversion:D
+          { \exp_not:N \tex_the:D \tex_pdfmajorversion:D }
+          { 1 }
+      }
+  }
 \cs_new:Npx \driver_pdf_version_minor:
   {
     \exp_not:N \tex_the:D





More information about the latex3-commits mailing list