Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
give \RawShipout its own box so that \ShipoutBox is not overwritten (…
…in case it is called from within the OR; various bug fixes; first test files
- Loading branch information
1 parent
d3c1768
commit d0e573b
Showing
11 changed files
with
7,812 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Testfiles for hook management | ||
|
||
- pdftex only | ||
- using 2 runs (to resolve page numbers) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
\RequirePackage[enable-debug]{expl3} | ||
\ExplSyntaxOn | ||
\debug_on:n { check-declarations , deprecation } | ||
\ExplSyntaxOff | ||
|
||
\documentclass[oneside]{report} | ||
|
||
\input{regression-test} | ||
|
||
\newbox\chapteropeningbox | ||
|
||
\newcommand\chapteropening[1]{% | ||
\setbox\chapteropeningbox\vbox{\hsize\textwidth #1}} | ||
|
||
\AddToHook{shipout/before}{% | ||
% before first page only generate a verso page if there is actual material | ||
\ifnum \ReadonlyShipoutCounter = 0 | ||
\ifvoid\chapteropeningbox \else | ||
\RawShipout\vbox to\textheight{\vss \usebox\chapteropeningbox \vss}% | ||
\fi | ||
\else | ||
% later do it always | ||
\RawShipout\vbox to\textheight{\vss \usebox\chapteropeningbox \vss}% | ||
\fi | ||
} | ||
|
||
|
||
\DebugShipoutsOn | ||
|
||
\begin{document} | ||
|
||
\DebugHooksOn | ||
|
||
\START | ||
|
||
\chapter{A} | ||
%\chapteropening{ \centering \Huge FOO1 } | ||
|
||
1 some text \newpage | ||
2 some text \newpage | ||
3 some text \newpage | ||
|
||
\chapter{B} | ||
\chapteropening{ \centering \Huge FOO2 } | ||
|
||
4 some text | ||
|
||
\chapter{C} | ||
|
||
5 some text \newpage | ||
6 some text | ||
|
||
|
||
|
||
\end{document} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
This is a generated file for the l3build validation system. | ||
Don't change this file in any respect. | ||
Chapter 1. | ||
Absolute page = 1 (target: 11) | ||
[1 | ||
] | ||
Absolute page = 2 (target: 11) | ||
[2] | ||
Absolute page = 3 (target: 11) | ||
[2] | ||
Absolute page = 4 (target: 11) | ||
[3] | ||
Absolute page = 5 (target: 11) | ||
[3] | ||
Chapter 2. | ||
Absolute page = 6 (target: 11) | ||
[4] | ||
Absolute page = 7 (target: 11) | ||
[4 | ||
] | ||
Chapter 3. | ||
Absolute page = 8 (target: 11) | ||
[5] | ||
Absolute page = 9 (target: 11) | ||
[5 | ||
] | ||
Absolute page = 10 (target: 11) | ||
[6] | ||
Absolute page = 11 (target: 11) | ||
[6] (shipout2-008.aux) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
\RequirePackage[enable-debug]{expl3} | ||
\ExplSyntaxOn | ||
\debug_on:n { check-declarations , deprecation } | ||
\ExplSyntaxOff | ||
|
||
\documentclass[oneside]{report} | ||
|
||
\input{regression-test} | ||
|
||
\newbox\chapteropeningbox | ||
|
||
\newcommand\chapteropening[1]{% | ||
\setbox\chapteropeningbox\vbox{\hsize\textwidth #1}} | ||
|
||
\AddToHook{shipout/before}{% | ||
% before first page only generate a verso page if there is actual material | ||
\ifnum \ReadonlyShipoutCounter = 0 | ||
\ifvoid\chapteropeningbox \else | ||
\RawShipout\vbox to\textheight{\vss \usebox\chapteropeningbox \vss}% | ||
\fi | ||
\else | ||
% later do it always | ||
\RawShipout\vbox to\textheight{\vss \usebox\chapteropeningbox \vss}% | ||
\fi | ||
} | ||
|
||
|
||
\DebugShipoutsOn | ||
|
||
\begin{document} | ||
|
||
\DebugHooksOn | ||
|
||
\START | ||
|
||
\chapter{A} | ||
\chapteropening{ \centering \Huge FOO1 } % now we get page 0 | ||
|
||
1 some text \newpage | ||
2 some text \newpage | ||
3 some text \newpage | ||
|
||
\chapter{B} | ||
\chapteropening{ \centering \Huge FOO2 } | ||
|
||
4 some text | ||
|
||
\chapter{C} | ||
|
||
5 some text \newpage | ||
6 some text | ||
|
||
|
||
|
||
\end{document} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
This is a generated file for the l3build validation system. | ||
Don't change this file in any respect. | ||
Chapter 1. | ||
Absolute page = 1 (target: 12) | ||
[1] | ||
Absolute page = 2 (target: 12) | ||
[1 | ||
] | ||
Absolute page = 3 (target: 12) | ||
[2] | ||
Absolute page = 4 (target: 12) | ||
[2] | ||
Absolute page = 5 (target: 12) | ||
[3] | ||
Absolute page = 6 (target: 12) | ||
[3] | ||
Chapter 2. | ||
Absolute page = 7 (target: 12) | ||
[4] | ||
Absolute page = 8 (target: 12) | ||
[4 | ||
] | ||
Chapter 3. | ||
Absolute page = 9 (target: 12) | ||
[5] | ||
Absolute page = 10 (target: 12) | ||
[5 | ||
] | ||
Absolute page = 11 (target: 12) | ||
[6] | ||
Absolute page = 12 (target: 12) | ||
[6] (shipout2-009.aux) |
Oops, something went wrong.