[latex3-commits] [git/LaTeX3-latex3-latex3] master: Basic epstopdf support (ae31ee5)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu May 9 20:50:24 CEST 2019


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

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

commit ae31ee5019c1b33df03c647f13459011d4fddbfe
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu May 9 19:50:24 2019 +0100

    Basic epstopdf support


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

ae31ee5019c1b33df03c647f13459011d4fddbfe
 l3kernel/l3drivers-graphics.dtx         |   50 +++++++++++++++++++++++++++++++
 l3kernel/testfiles/m3expl001.luatex.tlg |    6 ++++
 l3kernel/testfiles/m3expl001.tlg        |    6 ++++
 l3kernel/testfiles/m3expl003.luatex.tlg |    6 ++++
 l3kernel/testfiles/m3expl003.tlg        |    6 ++++
 5 files changed, 74 insertions(+)

diff --git a/l3kernel/l3drivers-graphics.dtx b/l3kernel/l3drivers-graphics.dtx
index 555b394..e32ed0f 100644
--- a/l3kernel/l3drivers-graphics.dtx
+++ b/l3kernel/l3drivers-graphics.dtx
@@ -224,6 +224,56 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\driver_graphics_getbb_eps:n}
+% \begin{macro}{\@@_graphics_getbb_eps:nm}
+% \begin{macro}{\driver_graphics_include_eps:n}
+% \begin{variable}{\l_@@_dir_str, \l_@@_name_str, \l_@@_ext_str}
+%   EPS graphics may be included in \texttt{pdfmode} by conversion to
+%   PDF: this requires restricted shell escape. Modelled on the \pkg{epstopdf}
+%   \LaTeXe{} package, but simplified, conversion takes place here if we have
+%   shell access.
+%    \begin{macrocode}
+\sys_if_shell:T
+  {
+    \str_new:N \l_@@_dir_str
+    \str_new:N \l_@@_name_str
+    \str_new:N \l_@@_ext_str
+    \cs_new_protected:Npn \driver_graphics_getbb_eps:n #1
+      {
+        \file_parse_full_name:nNNN {#1}
+          \l_@@_dir_str
+          \l_@@_name_str
+          \l_@@_ext_str
+        \exp_args:Nx \@@_graphics_getbb_eps:nn
+          {
+            \l_@@_name_str - \str_tail:N \l_@@_ext_str
+            -converted-to.pdf
+          }
+          {#1}
+     }
+    \cs_new_protected:Npn \@@_graphics_getbb_eps:nn #1#2
+      {
+        \sys_shell_now:n
+          { repstopdf ~ #2 ~ #1 }
+        \driver_graphics_getbb_pdf:n {#1}
+      }
+    \cs_new_protected:Npn \driver_graphics_include_eps:n #1
+      {
+        \file_parse_full_name:nNNN {#1}
+          \l_@@_dir_str \l_@@_name_str \l_@@_ext_str
+        \exp_args:Nx \driver_graphics_include_pdf:n
+          {
+            \l_@@_name_str - \str_tail:N \l_@@_ext_str
+            -converted-to.pdf
+          }
+      }
+  }
+%    \end{macrocode}
+% \end{variable}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</pdfmode>
 %    \end{macrocode}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index c6421e9..6f8fa66 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -6488,6 +6488,12 @@ Defining \__driver_graphics_getbb_auxii:n on line ...
 Defining \driver_graphics_include_jpg:n on line ...
 Defining \driver_graphics_include_pdf:n on line ...
 Defining \driver_graphics_include_png:n on line ...
+Defining \l__driver_dir_str on line ...
+Defining \l__driver_name_str on line ...
+Defining \l__driver_ext_str on line ...
+Defining \driver_graphics_getbb_eps:n on line ...
+Defining \__driver_graphics_getbb_eps:nn on line ...
+Defining \driver_graphics_include_eps:n on line ...
 Defining \driver_pdf_annotation:nnnn on line ...
 Defining \driver_pdf_annotation_last: on line ...
 Defining \driver_pdf_link_begin_goto:nnw on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 8ba13da..6a4a30d 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -6786,6 +6786,12 @@ Defining \__driver_graphics_getbb_auxii:n on line ...
 Defining \driver_graphics_include_jpg:n on line ...
 Defining \driver_graphics_include_pdf:n on line ...
 Defining \driver_graphics_include_png:n on line ...
+Defining \l__driver_dir_str on line ...
+Defining \l__driver_name_str on line ...
+Defining \l__driver_ext_str on line ...
+Defining \driver_graphics_getbb_eps:n on line ...
+Defining \__driver_graphics_getbb_eps:nn on line ...
+Defining \driver_graphics_include_eps:n on line ...
 Defining \driver_pdf_annotation:nnnn on line ...
 Defining \driver_pdf_annotation_last: on line ...
 Defining \driver_pdf_link_begin_goto:nnw on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index c6421e9..6f8fa66 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -6488,6 +6488,12 @@ Defining \__driver_graphics_getbb_auxii:n on line ...
 Defining \driver_graphics_include_jpg:n on line ...
 Defining \driver_graphics_include_pdf:n on line ...
 Defining \driver_graphics_include_png:n on line ...
+Defining \l__driver_dir_str on line ...
+Defining \l__driver_name_str on line ...
+Defining \l__driver_ext_str on line ...
+Defining \driver_graphics_getbb_eps:n on line ...
+Defining \__driver_graphics_getbb_eps:nn on line ...
+Defining \driver_graphics_include_eps:n on line ...
 Defining \driver_pdf_annotation:nnnn on line ...
 Defining \driver_pdf_annotation_last: on line ...
 Defining \driver_pdf_link_begin_goto:nnw on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 8ba13da..6a4a30d 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -6786,6 +6786,12 @@ Defining \__driver_graphics_getbb_auxii:n on line ...
 Defining \driver_graphics_include_jpg:n on line ...
 Defining \driver_graphics_include_pdf:n on line ...
 Defining \driver_graphics_include_png:n on line ...
+Defining \l__driver_dir_str on line ...
+Defining \l__driver_name_str on line ...
+Defining \l__driver_ext_str on line ...
+Defining \driver_graphics_getbb_eps:n on line ...
+Defining \__driver_graphics_getbb_eps:nn on line ...
+Defining \driver_graphics_include_eps:n on line ...
 Defining \driver_pdf_annotation:nnnn on line ...
 Defining \driver_pdf_annotation_last: on line ...
 Defining \driver_pdf_link_begin_goto:nnw on line ...





More information about the latex3-commits mailing list