2

I wish to print the actual running text* of part of a document only on the right-hand side pages of double spreads, while the left-hand side repeats the same every time because the reader will want to be able to refer to the information on the left-hand page frequently while reading the right-hand side, without having to flip the pages back and forth.

Here’s a mocked-up layout example of what I’d like:

example of the layout i want

How can I achieve this with LaTeX or LuaTeX? (I’m using the book document class, if that makes a difference.)


* Detail: it’s not actually running text but a Gregorio score, but hopefully that doesn’t make too much difference given that Gregorio, to my knowledge, uses the normal text and block and page wrapping of TeX.

1 Answer 1

2

You could override the \shipout primitive in LuaTeX. To get the correct margins, headers, and footers, a bit more work is required.

\documentclass{article}
\usepackage{pgffor}

\newbox\infobox

% Override the shipout primitive to also shipout infobox
\def\shipout{\directlua{
    local box = token.scan_list()
    tex.setbox(255, box)
    tex.shipout(255)
    tex.setbox(255, node.copy(tex.getbox("infobox")))
    tex.shipout(255)
}}

\begin{document}

% Set infobox only after \begin{document}.  Otherwise fonts will not
%   be loaded.
\setbox\infobox=\vbox to \textheight{
  \vfill
  \Huge\input ward\par
  \vfill
}

\foreach \i in {1,...,20} {
  \input knuth\par
}

\end{document}

enter image description here

2
  • This appears only to work with a newer version of LuaTeX than I currently have ([\directlua]:1: attempt to call field 'scan_list' (a nil value)). token.scan_list is mentioned in the 1.10 manual but not in the manual for 1.08, and the current TeX Live version is 1.07. I’m trying to investigate if it’s possible to update to 1.10 already before TL2019 comes out in April … Commented Feb 6, 2019 at 13:15
  • @dpk github.com/hmenke/texlive-luatex-dev Commented Feb 6, 2019 at 19:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .