[latex3-commits] [l3svn] 03/03: Ensure \tex_shipout:D really is \shipout

noreply at latex-project.org noreply at latex-project.org
Wed Oct 25 16:59:07 CEST 2017


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

commit 27b162c13e98abd051c440e4c87b3b20fa83b18b
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Oct 25 15:56:18 2017 +0100

    Ensure \tex_shipout:D really is \shipout
    
    Several packages move \shipout 'around'. We can probably live with that
    to some extend, but really the \tex_...:D names should be exactly the
    primitives. Here, we do out best to collect the real \shipout in the
    cases where it can be moved in the preamble.
---
 l3kernel/l3names.dtx |   39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/l3kernel/l3names.dtx b/l3kernel/l3names.dtx
index e29c705..26e4dbb 100644
--- a/l3kernel/l3names.dtx
+++ b/l3kernel/l3names.dtx
@@ -1130,6 +1130,45 @@
   \tex_let:D \tex_italiccorrection:D     \@@@@italiccorr
   \tex_let:D \tex_underline:D            \@@@@underline
 %    \end{macrocode}
+% The \tn{shipout} primitive is particularly tricky as a number of packages
+% want to hook in here. First, we see if a sufficiently-new kernel has saved
+% a copy: if it has, just use that. Otherwise, we need to check each of the
+% possible packages/classes that might move it: here, we are looking for those
+% which do \emph{not} delay action to the \tn{AtBeginDocument} hook. (We
+% cannot use \tn{primitive} a (u)\pTeX{} doesn't offer it and as that doesn't
+% allow us to make a direct copy of the primitive \emph{itself}.) As we know
+% that \LaTeXe{} is in use, we use it's \tn{@tfor} loop here.
+%    \begin{macrocode}
+  \etex_ifdefined:D \@@@@shipout
+    \tex_let:D \tex_shipout:D \@@@@shipout
+  \tex_fi:D
+  \tex_begingroup:D
+    \tex_edef:D \l_tmpa_tl { \tex_string:D \shipout }
+    \tex_edef:D \l_tmpb_tl { \tex_meaning:D \shipout }
+    \tex_ifx:D \l_tmpa_tl \l_tmpb_tl
+    \tex_else:D
+      \tex_expandafter:D \@tfor \tex_expandafter:D \@tempa \tex_string:D :=
+        \CROP at shipout
+        \dup at shipout
+        \GPTorg at shipout
+        \LL at shipout
+        \mem at oldshipout
+        \opem at shipout
+        \pgfpages at originalshipout
+        \pr at shipout
+        \verso at orig@shipout
+        \do
+          {
+            \tex_edef:D \l_tmpb_tl
+              { \tex_expandafter:D \tex_meaning:D \@tempa }
+            \tex_ifx:D \l_tmpa_tl \l_tmpb_tl
+              \tex_global:D \tex_expandafter:D \tex_let:D
+                \tex_expandafter:D \tex_shipout:D \@tempa
+            \tex_fi:D
+          }
+    \tex_fi:D
+  \tex_endgroup:D
+%    \end{macrocode}
 % Some tidying up is needed for \tn[index=tracingfonts]{(pdf)tracingfonts}.
 % Newer \LuaTeX{} has
 % this simply as \tn{tracingfonts}, but that is overwritten by

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list