[latex3-commits] [git/LaTeX3-latex3-latex2e] firstaid-crop: firstaid for crop (mirror option, \stockwidth/\stockheight adaption) (06a50065)

Ulrike Fischer fischer at troubleshooting-tex.de
Tue Dec 6 16:49:29 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : firstaid-crop
Link       : https://github.com/latex3/latex2e/commit/06a500653108de28c98c31373b8420faf7a85f0d

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

commit 06a500653108de28c98c31373b8420faf7a85f0d
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Dec 6 16:49:29 2022 +0100

    firstaid for crop (mirror option, \stockwidth/\stockheight adaption)


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

06a500653108de28c98c31373b8420faf7a85f0d
 .github/tl_packages                                |   1 +
 required/firstaid/changes.txt                      |   5 +
 required/firstaid/config-pdf.lua                   |   6 +
 .../latex2e-first-aid-for-external-files.dtx       |  39 ++-
 .../testfiles-pdf/firstaid-crop-mirror.lvt         |   9 +
 .../testfiles-pdf/firstaid-crop-mirror.tlg         | 144 +++++++++++
 .../testfiles-pdf/firstaid-crop-stockwidth.pvt     |  12 +
 .../testfiles-pdf/firstaid-crop-stockwidth.tpf     | 269 +++++++++++++++++++++
 8 files changed, 483 insertions(+), 2 deletions(-)

diff --git a/.github/tl_packages b/.github/tl_packages
index 6010e399..be73cb3e 100644
--- a/.github/tl_packages
+++ b/.github/tl_packages
@@ -28,6 +28,7 @@ fancyhdr
 # special testing for firstaid
 bidi
 bigfoot
+crop
 ncctools
 dinbrief
 everyshi
diff --git a/required/firstaid/changes.txt b/required/firstaid/changes.txt
index 31e24397..50752bc7 100644
--- a/required/firstaid/changes.txt
+++ b/required/firstaid/changes.txt
@@ -1,3 +1,8 @@
+2022-12-06  Ulrike Fischer  <Ulrike.Fischer at latex-project.org>
+
+	* latex2e-first-aid-for-external-files.dtx (subsection{the crop package first aid}):
+	A first aid for crop after changes to \rlap and \stockwidth/\stockheight
+
 2022-11-28  Ulrike Fischer  <Ulrike.Fischer at latex-project.org>
 
 	* latex2e-first-aid-for-external-files.dtx (subsection{the songs package first aid}):
diff --git a/required/firstaid/config-pdf.lua b/required/firstaid/config-pdf.lua
new file mode 100644
index 00000000..64b4a673
--- /dev/null
+++ b/required/firstaid/config-pdf.lua
@@ -0,0 +1,6 @@
+-- Tests needing \pdfoutput=1
+
+stdengine    = "pdftex"
+checkengines = {"pdftex"}
+checksearch  = true
+testfiledir  = "testfiles-pdf"
diff --git a/required/firstaid/latex2e-first-aid-for-external-files.dtx b/required/firstaid/latex2e-first-aid-for-external-files.dtx
index 0d9ce67b..3fd23551 100644
--- a/required/firstaid/latex2e-first-aid-for-external-files.dtx
+++ b/required/firstaid/latex2e-first-aid-for-external-files.dtx
@@ -111,8 +111,8 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\def\LaTeXFirstAidDate{2022/11/28}
-\def\LaTeXFirstAidVersion{v1.0w}
+\def\LaTeXFirstAidDate{2022/12/06}
+\def\LaTeXFirstAidVersion{v1.0x}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -443,6 +443,41 @@
 }
 %    \end{macrocode}
 %
+% \subsection{The \pkg{crop} package first aid}
+%
+%    The crop packages fails currently due to two LaTeX changes:
+%    It doesn't know that \cs{stockheight} and \cs{stockwidth} 
+%    are now defined, and doesn't take into account that \cs{rlap}
+%    is robust (https://github.com/rrthomas/crop/issues/2).
+%    The first is addressed by setting the dimension if they are zero or
+%    negative. For the second we locally change the meaning of \cs{protect}
+%    
+%    \begin{macrocode}
+\AddToHook{file/crop.sty/after}[firstaid]{%
+  \FirstAidNeededT{crop}{sty}{2017/11/19 1.10 crop marks (mf)}%
+                  {%
+  \ifdim\stockwidth  > 0pt\relax \else \stockwidth\paperwidth \fi  
+  \ifdim\stockheight > 0pt\relax \else \stockheight\paperheight \fi 
+  \renewcommand*\CROP at genreflect[1]{%
+    \leavevmode
+    \dimen0\CROP at horigin
+    \kern2\dimen0
+    \begingroup 
+    \set at typeset@protect %change protect
+    \reflectbox{%
+        \hb at xt@\paperwidth{%
+            \vbox to\paperheight{%
+                #1%
+                \vss
+            }%
+            \hss
+        }%
+    }%
+   \endgroup
+   }
+  }%
+}
+%    \end{macrocode}
 %    \begin{macrocode}
 %</kernel>
 %    \end{macrocode}
diff --git a/required/firstaid/testfiles-pdf/firstaid-crop-mirror.lvt b/required/firstaid/testfiles-pdf/firstaid-crop-mirror.lvt
new file mode 100644
index 00000000..9a848953
--- /dev/null
+++ b/required/firstaid/testfiles-pdf/firstaid-crop-mirror.lvt
@@ -0,0 +1,9 @@
+\documentclass{article}
+\input{regression-test}
+\usepackage[mirror]{crop}
+\begin{document}
+\START
+Some text
+\newpage
+more text
+\end{document}
\ No newline at end of file
diff --git a/required/firstaid/testfiles-pdf/firstaid-crop-mirror.tlg b/required/firstaid/testfiles-pdf/firstaid-crop-mirror.tlg
new file mode 100644
index 00000000..4f8b8217
--- /dev/null
+++ b/required/firstaid/testfiles-pdf/firstaid-crop-mirror.tlg
@@ -0,0 +1,144 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+Overfull \hbox (124.75502pt too wide) has occurred while \output is active
+[][] 
+\hbox(794.96999+0.0)x345.0
+.\hbox(0.0+0.0)x0.0
+.\kern -144.53998
+.\hbox(794.96999+0.0)x614.295
+..\kern 614.295
+..\hbox(794.96999+0.0)x0.0
+...\pdfsave
+...\pdfsetmatrix{-1 0 0 1}
+...\hbox(794.96999+0.0)x0.0, glue set - 614.295fil
+....\hbox(794.96999+0.0)x614.295
+.....\hbox(794.96999+0.0)x614.295, glue set 207.295fil
+......\vbox(794.96999+0.0)x407.0, glue set 161.96999fil
+.......\vbox(0.0+0.0)x0.0, glue set - 722.7fil
+........\glue -72.26999
+........\hbox(794.96999+0.0)x0.0, glue set 72.26999fil
+.........\glue -72.26999
+.........\vbox(794.96999+0.0)x0.0, glue set 794.96999fil
+..........\glue 0.0 plus 1.0fil
+.........\glue 0.0 plus 1.0fil minus 1.0fil
+........\glue 0.0 plus 1.0fil minus 1.0fil
+.......\glue(\lineskip) 0.0
+.......\vbox(633.0+0.0)x407.0
+........\glue 16.0
+........\vbox(617.0+0.0)x345.0, shifted 62.0
+.........\vbox(12.0+0.0)x345.0, glue set 12.0fil
+..........\glue 0.0 plus 1.0fil
+..........\hbox(0.0+0.0)x345.0
+...........\pdfcolorstack 0 push {0 g 0 G}
+...........\hbox(0.0+0.0)x345.0
+...........\pdfcolorstack 0 pop
+.........\glue 25.0
+.........\glue(\lineskip) 0.0
+.........\vbox(550.0+0.0)x345.0, glue set 539.94232fil
+..........\write-{}
+..........\glue(\topskip) 3.16669
+..........\hbox(6.83331+0.0)x345.0, glue set 285.83324fil
+...........\hbox(0.0+0.0)x15.0
+...........\OT1/cmr/m/n/10 S
+...........\OT1/cmr/m/n/10 o
+...........\OT1/cmr/m/n/10 m
+...........\OT1/cmr/m/n/10 e
+...........\glue 3.33333 plus 1.66666 minus 1.11111
+...........\OT1/cmr/m/n/10 t
+...........\OT1/cmr/m/n/10 e
+...........\OT1/cmr/m/n/10 x
+...........\OT1/cmr/m/n/10 t
+...........\penalty 10000
+...........\glue(\parfillskip) 0.0 plus 1.0fil
+...........\glue(\rightskip) 0.0
+..........\glue 0.0 plus 1.0fil
+..........\glue 0.0
+..........\glue 0.0 plus 0.0001fil
+.........\glue(\baselineskip) 23.55556
+.........\hbox(6.44444+0.0)x345.0
+..........\pdfcolorstack 0 push {0 g 0 G}
+..........\hbox(6.44444+0.0)x345.0, glue set 170.0fil
+...........\glue 0.0 plus 1.0fil
+...........\OT1/cmr/m/n/10 1
+...........\glue 0.0 plus 1.0fil
+..........\pdfcolorstack 0 pop
+.......\glue 0.0 plus 1.0fil minus 1.0fil
+......\glue 0.0 plus 1.0fil minus 1.0fil
+....\glue 0.0 plus 1.0fil minus 1.0fil
+...\pdfrestore
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\penalty 10000
+.\glue(\parfillskip) 0.0 plus 1.0fil
+.\glue(\rightskip) 0.0
+[1
+]
+Overfull \hbox (124.75502pt too wide) has occurred while \output is active
+[][] 
+\hbox(794.96999+0.0)x345.0
+.\hbox(0.0+0.0)x0.0
+.\kern -144.53998
+.\hbox(794.96999+0.0)x614.295
+..\kern 614.295
+..\hbox(794.96999+0.0)x0.0
+...\pdfsave
+...\pdfsetmatrix{-1 0 0 1}
+...\hbox(794.96999+0.0)x0.0, glue set - 614.295fil
+....\hbox(794.96999+0.0)x614.295
+.....\hbox(794.96999+0.0)x614.295, glue set 207.295fil
+......\vbox(794.96999+0.0)x407.0, glue set 161.96999fil
+.......\vbox(0.0+0.0)x0.0, glue set - 722.7fil
+........\glue -72.26999
+........\hbox(794.96999+0.0)x0.0, glue set 72.26999fil
+.........\glue -72.26999
+.........\vbox(794.96999+0.0)x0.0, glue set 794.96999fil
+..........\glue 0.0 plus 1.0fil
+.........\glue 0.0 plus 1.0fil minus 1.0fil
+........\glue 0.0 plus 1.0fil minus 1.0fil
+.......\glue(\lineskip) 0.0
+.......\vbox(633.0+0.0)x407.0
+........\glue 16.0
+........\vbox(617.0+0.0)x345.0, shifted 62.0
+.........\vbox(12.0+0.0)x345.0, glue set 12.0fil
+..........\glue 0.0 plus 1.0fil
+..........\hbox(0.0+0.0)x345.0
+...........\pdfcolorstack 0 push {0 g 0 G}
+...........\hbox(0.0+0.0)x345.0
+...........\pdfcolorstack 0 pop
+.........\glue 25.0
+.........\glue(\lineskip) 0.0
+.........\vbox(550.0+0.0)x345.0, glue set 539.94232fil
+..........\glue(\topskip) 3.84921
+..........\hbox(6.15079+0.0)x345.0, glue set 287.47214fil
+...........\hbox(0.0+0.0)x15.0
+...........\OT1/cmr/m/n/10 m
+...........\OT1/cmr/m/n/10 o
+...........\OT1/cmr/m/n/10 r
+...........\OT1/cmr/m/n/10 e
+...........\glue 3.33333 plus 1.66666 minus 1.11111
+...........\OT1/cmr/m/n/10 t
+...........\OT1/cmr/m/n/10 e
+...........\OT1/cmr/m/n/10 x
+...........\OT1/cmr/m/n/10 t
+...........\penalty 10000
+...........\glue(\parfillskip) 0.0 plus 1.0fil
+...........\glue(\rightskip) 0.0
+..........\glue 0.0 plus 1.0fil
+..........\glue 0.0
+..........\glue 0.0 plus 0.0001fil
+.........\glue(\baselineskip) 23.55556
+.........\hbox(6.44444+0.0)x345.0
+..........\pdfcolorstack 0 push {0 g 0 G}
+..........\hbox(6.44444+0.0)x345.0, glue set 170.0fil
+...........\glue 0.0 plus 1.0fil
+...........\OT1/cmr/m/n/10 2
+...........\glue 0.0 plus 1.0fil
+..........\pdfcolorstack 0 pop
+.......\glue 0.0 plus 1.0fil minus 1.0fil
+......\glue 0.0 plus 1.0fil minus 1.0fil
+....\glue 0.0 plus 1.0fil minus 1.0fil
+...\pdfrestore
+..\glue 0.0 plus 1.0fil minus 1.0fil
+.\penalty 10000
+.\glue(\parfillskip) 0.0 plus 1.0fil
+.\glue(\rightskip) 0.0
+[2] (firstaid-crop-mirror.aux)
diff --git a/required/firstaid/testfiles-pdf/firstaid-crop-stockwidth.pvt b/required/firstaid/testfiles-pdf/firstaid-crop-stockwidth.pvt
new file mode 100644
index 00000000..cf069067
--- /dev/null
+++ b/required/firstaid/testfiles-pdf/firstaid-crop-stockwidth.pvt
@@ -0,0 +1,12 @@
+\documentclass[10pt]{article}
+\input{regression-test}
+\usepackage[center]{crop}
+
+
+\begin{document}
+\START
+\showoutput
+abc
+\newpage
+abc
+\end{document}
\ No newline at end of file
diff --git a/required/firstaid/testfiles-pdf/firstaid-crop-stockwidth.tpf b/required/firstaid/testfiles-pdf/firstaid-crop-stockwidth.tpf
new file mode 100644
index 00000000..016afce1
--- /dev/null
+++ b/required/firstaid/testfiles-pdf/firstaid-crop-stockwidth.tpf
@@ -0,0 +1,269 @@
+%PDF-1.5
+%ÐÔÅØ
+3 0 obj
+<<
+/Length 115       
+>>
+stream
+0 g 0 G
+0 g 0 G
+BT
+/F20 9.9626 Tf 148.712 657.235 Td [(ab)-28(c)]TJ
+0 g 0 G
+ 154.421 -567.87 Td [(1)]TJ
+0 g 0 G
+ET
+endstream
+endobj
+2 0 obj
+<<
+/Type /Page
+/Contents 3 0 R
+/Resources 1 0 R
+/MediaBox [0 0 612 792]
+/Parent 5 0 R
+>>
+endobj
+1 0 obj
+<<
+/Font << /F20 4 0 R >>
+/ProcSet [ /PDF /Text ]
+>>
+endobj
+8 0 obj
+<<
+/Length 115       
+>>
+stream
+0 g 0 G
+0 g 0 G
+BT
+/F20 9.9626 Tf 148.712 657.235 Td [(ab)-28(c)]TJ
+0 g 0 G
+ 154.421 -567.87 Td [(2)]TJ
+0 g 0 G
+ET
+endstream
+endobj
+7 0 obj
+<<
+/Type /Page
+/Contents 8 0 R
+/Resources 6 0 R
+/MediaBox [0 0 612 792]
+/Parent 5 0 R
+>>
+endobj
+6 0 obj
+<<
+/Font << /F20 4 0 R >>
+/ProcSet [ /PDF /Text ]
+>>
+endobj
+9 0 obj
+[500 500 500 500 500 500 500 500 500 277.8 277.8 277.8 777.8 472.2 472.2 777.8 750 708.3 722.2 763.9 680.6 652.8 784.7 750 361.1 513.9 777.8 625 916.7 750 777.8 680.6 777.8 736.1 555.6 722.2 750 750 1027.8 750 750 611.1 277.8 500 277.8 500 277.8 277.8 500 555.6 444.4]
+endobj
+10 0 obj
+<<
+/Length1 1423
+/Length2 7975
+/Length3 0
+/Length 9398      
+>>
+[BINARY STREAM]
+endobj
+11 0 obj
+<<
+/Type /FontDescriptor
+/FontName /TRJHNO+CMR10
+/Flags 4
+/FontBBox [-40 -250 1009 750]
+/Ascent 694
+/CapHeight 683
+/Descent -194
+/ItalicAngle 0
+/StemV 69
+/XHeight 431
+/CharSet (/a/b/c/one/two)
+/FontFile 10 0 R
+>>
+endobj
+12 0 obj
+<<
+/Length 1724      
+>>
+stream
+%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-cmr10-builtin-0)
+%%Title: (TeX-cmr10-builtin-0 TeX cmr10-builtin 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (cmr10-builtin)
+/Supplement 0
+>> def
+/CMapName /TeX-cmr10-builtin-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <FF>
+endcodespacerange
+7 beginbfrange
+<07> <08> <03A5>
+<23> <26> <0023>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+<A8> <A9> <03A5>
+endbfrange
+78 beginbfchar
+<00> <0393>
+<01> <2206>
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<09> <03A8>
+<0A> <2126>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5D> <005D>
+<5E> <02C6>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <02DC>
+<7F> <00A8>
+<A0> <0020>
+<A1> <0393>
+<A2> <2206>
+<A3> <0398>
+<A4> <039B>
+<A5> <039E>
+<A6> <03A0>
+<A7> <03A3>
+<AA> <03A8>
+<AB> <00AD>
+<AC> <00A0>
+<AD> <2126>
+<AE> <00660066>
+<AF> <00660069>
+<B0> <0066006C>
+<B1> <006600660069>
+<B2> <00660066006C>
+<B3> <0131>
+<B4> <0237>
+<B5> <0060>
+<B6> <00B4>
+<B7> <02C7>
+<B8> <02D8>
+<B9> <00AF>
+<BA> <02DA>
+<BB> <00B8>
+<BC> <00DF>
+<BD> <00E6>
+<BE> <0153>
+<BF> <00F8>
+<C0> <00C6>
+<C1> <0152>
+<C2> <00D8>
+<C4> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+endstream
+endobj
+4 0 obj
+<<
+/Type /Font
+/Subtype /Type1
+/BaseFont /TRJHNO+CMR10
+/FontDescriptor 11 0 R
+/FirstChar 49
+/LastChar 99
+/Widths 9 0 R
+/ToUnicode 12 0 R
+>>
+endobj
+5 0 obj
+<<
+/Type /Pages
+/Count 2
+/Kids [2 0 R 7 0 R]
+>>
+endobj
+13 0 obj
+<<
+/Type /Catalog
+/Pages 5 0 R
+>>
+endobj
+14 0 obj
+<<
+/Producer (pdfTeX)
+/Creator (TeX)
+/Trapped /False
+>>
+endobj
+xref
+0 15
+0000000000 65535 f 
+0000000292 00000 n 
+0000000188 00000 n 
+0000000015 00000 n 
+0000012497 00000 n 
+0000012652 00000 n 
+0000000637 00000 n 
+0000000533 00000 n 
+0000000360 00000 n 
+0000000705 00000 n 
+0000000989 00000 n 
+0000010485 00000 n 
+0000010714 00000 n 
+0000012715 00000 n 
+0000012765 00000 n 
+trailer
+<< /Size 15
+/Root 13 0 R
+/Info 14 0 R
+ >>
+startxref
+12837
+%%EOF





More information about the latex3-commits mailing list.