Re: plain TeX double-page layout?

Norman Gray <[email protected]> Mon, 08 Sep 2025 12:41:15 +0100
Newsgroups gmane.comp.tex.texhax
Message-ID <[email protected]>
Rodolfo, hello.

On 8 Sep 2025, at 11:22, Rodolfo Medina wrote:

> I'm sure it must be possible in plain TeX but can't have an
> idea of how.  Thanks for any suggestion.

Philip has indicated how you might approach this by tinkering with the \shipout routine, but, as I presume you know, that wouldn't be trivial.

> Otherwise, I'll have to get what I
> want on the final PDF using some tools like qpdf or similar...  but preserving
> the internal links of the PDF.

This is probably the right tool for the job, unless part of the goal is the educational exercise of doing it purely in Plain TeX.

I have one similar workflow, where I generate a Plain TeX file and process it to PDF, and then do the imposition stage [1] working with that output PDF.

I use the (LaTeX) pdfpages package, by processing the following file with pdflatex:

\documentclass{minimal}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages={{},{},-},signature=24,landscape]{pre-imposition.pdf}
\end{document}

But you could very probably do the same work with a suitable invocation of ghostscript.

I see no fundamental reason why this wouldn't preserve internal PDF links, but I haven't had to test that.

Best wishes,

Norman


[1] https://en.wikipedia.org/wiki/Imposition

-- 
Norman Gray  :  https://nxg.me.uk