0

I am laying out a book using LuaLaTeX and memoir, to be printed on a page of width 145mm and height 235mm. This all works very well. (I have a sample document, using some public-domain text, but it's over 900 lines, so I put it in a pastebin.)

Once I have the 145mm by 235mm PDF, I want to use pdfpages in signature mode to arrange the pages for printing in signatures of 16 pages. (That is, four sheets of paper, each with two pages on each side.) This also works very well, except that I do not have any 290mm by 235mm paper to print on.

So I have used the geometry package to set a paper size of 11 in by 17 in (so-called "ledger" paper), which I plan to trim down after printing.

\documentclass[twoside]{article}
\pdfvariable minorversion=7
\usepackage{pdfpages}
\usepackage[papersize={11in,17in}]{geometry}
\begin{document}
\includepdf[noautoscale,landscape,pages=-,signature=16,frame]{sample.pdf}
\end{document}

enter image description here

The issue here is twofold. First, pdfpages has placed the pair of pages in the center of the 11in by 17in sheet, so that I must trim away extra paper on all four sides instead of just two. Second, while the frame option has given me some trim marks, it also put a line down the middle of the sheet.

Of course, positioning the pages in the center does have the advantage of working nicely with double-sided printing; but it should be possible to alternate between the top left and top right corners so that I can use double-sided printing and still only have to trim on two sides.

I've tried a variety of permutations of geometry and crop configurations and I haven't been able to find one which properly alternates between corners, actually puts the included PDF pages in those corners, and shows trim marks.

\documentclass[twoside]{article}
\pdfvariable minorversion=7
\usepackage{pdfpages}
\usepackage[papersize={11in,17in},layoutsize={290mm,235mm},landscape,twoside,showcrop]{geometry}
\begin{document}
\includepdf[noautoscale,pages=-,signature=16]{sample.pdf}
\end{document}

This setup, for example, does show trim marks, but it doesn't alternate corners the way I thought it would, and it does nothing to actually place the pages in the corners.

2 Answers 2

1

It turns out that I get the best results by not using geometry at all, and using the memoir package for this. (I don't know why it works better, but it does work better.)

\documentclass[twoside,showtrims]{memoir}
\pdfvariable minorversion=7
\usepackage{pdfpages}

\stockledger
\settrimmedsize{290mm}{235mm}{*}
\setpagetl{\paperheight}{\paperwidth}{*}

\begin{document}
\includepdf[landscape,noautoscale,pages=-,signature=16]{sample.pdf}
\end{document}

With this configuration, I get the two logical pages up in the corner of the page, and it properly switches corners for two-sided printing.

side A of the first sheet of the signature

side B of the first sheet of the signature

0

The key offset for pdfpages seems to do what you want; from the documentation:

offset Displaces the origin of the inserted pages. The argument should be two dimensions, separated by space. In ‘oneside’ documents positive values shift the pages to the right and to the top margin, respectively, whereas in ‘twoside’ documents positive values shift the pages to the outer and to the top margin, respectively. See Chapter 2.3 and Figure 1. (Default: offset=0 0)

So you can manually compute the correct offset to make it line up at the corners.

Caveat (I am not sure whether this is a bug.) The signature layout assumes you want to make a booklet and so prepares the object to be printed in two-sided format. But if you also specify the document geometry to be twoside, the two somehow cancels each other, when it comes to setting the offset.

In other words, if you use signature and twoside the offset would be applied as if the document was onesided. So to achieve the effect you want, you have to remove the twoside options.

\documentclass{article}
\usepackage[<papersize>]{geometry}
\usepackage{pdfpages}

\begin{document}
\includepdf[noautoscale,pages=-,signature=8,offset=<x> <y>]{<filename>}
\end{document}

(You can also remove the layoutsize specification in geometry, since it is ignored by pdfpages.)

5
  • This doesn't actually work. I removed all the twoside options, and offset does move the pages into the corner. But (a) there are no crop marks and (b) every second sheet will have the text upside down.
    – inklesspen
    Commented Nov 20, 2023 at 1:07
  • The orientation of the pages could be solved (I think) if you include landscape as an option for \includepdf (I wasn't paying attention to that earlier, but in the test I just ran it looks like in this case, with the paper in portrait orientation, the signature is generated so that having the printer flip on the long edge would give the correct result.) Commented Nov 20, 2023 at 3:18
  • The crop marks issue is a tougher one. How geometry draws crops marks has a longstanding bug (also this). Commented Nov 20, 2023 at 4:14
  • The best I can come up with are either (a) follow this answer and draw the crop marks yourself using TikZ, or (b) use a two pass process: first pass builds the page with cropmarks centered. Second pass uses pdfpages to load the result of the first page, correctly offset, toward the corners. Commented Nov 20, 2023 at 4:23
  • Thanks! Given the buggy nature of geometry with double-sided printing and crop marks, I decided to use an alternative method.
    – inklesspen
    Commented Nov 20, 2023 at 20:36

You must log in to answer this question.

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