Skip to content

Commit

Permalink
firstaid for crop (mirror option, \stockwidth/\stockheight adaption)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrike Fischer committed Dec 6, 2022
1 parent 78484db commit 06a5006
Show file tree
Hide file tree
Showing 8 changed files with 483 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/tl_packages
Expand Up @@ -28,6 +28,7 @@ fancyhdr
# special testing for firstaid
bidi
bigfoot
crop
ncctools
dinbrief
everyshi
Expand Down
5 changes: 5 additions & 0 deletions required/firstaid/changes.txt
@@ -1,3 +1,8 @@
2022-12-06 Ulrike Fischer <Ulrike.Fischer@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@latex-project.org>

* latex2e-first-aid-for-external-files.dtx (subsection{the songs package first aid}):
Expand Down
6 changes: 6 additions & 0 deletions required/firstaid/config-pdf.lua
@@ -0,0 +1,6 @@
-- Tests needing \pdfoutput=1

stdengine = "pdftex"
checkengines = {"pdftex"}
checksearch = true
testfiledir = "testfiles-pdf"
39 changes: 37 additions & 2 deletions required/firstaid/latex2e-first-aid-for-external-files.dtx
Expand Up @@ -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}
Expand Down Expand Up @@ -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@genreflect[1]{%
\leavevmode
\dimen0\CROP@horigin
\kern2\dimen0
\begingroup
\set@typeset@protect %change protect
\reflectbox{%
\hb@xt@\paperwidth{%
\vbox to\paperheight{%
#1%
\vss
}%
\hss
}%
}%
\endgroup
}
}%
}
% \end{macrocode}
% \begin{macrocode}
%</kernel>
% \end{macrocode}
Expand Down
9 changes: 9 additions & 0 deletions 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}
144 changes: 144 additions & 0 deletions 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)
12 changes: 12 additions & 0 deletions 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}

0 comments on commit 06a5006

Please sign in to comment.