18

I have a file bookletdemo.tex with the following code

\documentclass[12pt]{article}
\usepackage[a5paper]{geometry}
\usepackage{lipsum}  % this package is for creating filler text


\author{N.~N}
\title{The booklet}

% \usepackage[print,1to1]{booklet} \nofiles 
% \target{\magstep0}{297mm}{210mm}


\begin{document}

\maketitle

\tableofcontents

\section{Europe}
\subsection{Berlin}
\lipsum[4]
\subsection{Paris}
\lipsum[1-3]
\subsection{Vienna}
\lipsum[10]
\subsection{Rome}
\lipsum[15]
\section{Africa}
\lipsum[1-4]
\subsection{Accra}
\lipsum[5-8]
\subsection{Johannesburg}
\lipsum[9-11]
\subsection{Casablanca}
\lipsum[11-12]
\lipsum[5-6]
\section{Asia}
\lipsum[1-4]
\subsection{Tokyo}
\lipsum[5-8]
\subsection{Beijing}
\lipsum[9-11]
\subsection{Mumbai}
\lipsum[11-12]
\lipsum[5-6]

\end{document}

Fist I run

latex bookletdemo.tex 

two times. The pdf formatting of the document with A5 pages is fine.

Then I uncomment

\usepackage[print,1to1]{booklet} \nofiles 
\target{\magstep0}{297mm}{210mm}

and run

    latex bookletdemo.tex 

to create a booklet. It produces something which resembles a booklet but the title page and the TOC are missing.

How does an example which does this properly look like?

Reference

http://mirror.isoc.org.il/pub/ctan/macros/latex/contrib/booklet/booklet.pdf

yo'
  • 51,322
Hannes
  • 409
  • Flag the question for moderator attention, and request it to be moved. The regular process of flagging (Close as Off-Topic > Belongs on a different site), ends up in the review queue, which is really slow to be processed. However, immediate moderator flagging is sometimes quicker. – Werner Jan 18 '14 at 18:30

1 Answers1

32

I am far from expert and I am hoping that somebody will have a better answer. However, I have spent quite some time on this problem and, as far as I can tell, the use of geometry just does not agree with the use of booklet no matter what. I know the documentation explains how to work around this using noprint and then print with \nofiles but it has never worked for me. I therefore cannot answer your question since I have no idea how to do this 'properly' if that means 'in a way which both works and uses the method in booklet's documentation.

In fact, I can't even answer it if you mean 'in a way which uses booklet'. I used to have a solution which did that but unfortunately it broke some time ago and things don't seem to have changed since. In case it is useful, I'll explain that solution before explaining what I have found works now. This solution, unfortunately, dispenses with booklet altogether. But it does work.

Solution 1: Use booklet without geometry

Currently broken - used to work

The way I did this was to initially load geometry with the verbose option and then retrieve the settings it used from the output when I compiled. (These should also be in the log I expect.) I then took geometry out and set the dimensions manually. Then booklet worked fine.

Running your code, for example, the output from geometry you would be looking for would be:

*geometry* verbose mode - [ preamble ] result:
* driver: pdftex
* paper: a5paper
* layout: <same size as paper>
* layoutoffset:(h,v)=(0.0pt,0.0pt)
* modes: 
* h-part:(L,W,R)=(63.16576pt, 294.76926pt, 63.16577pt)
* v-part:(T,H,B)=(71.70166pt, 418.25368pt, 107.55254pt)
* \paperwidth=421.10078pt
* \paperheight=597.50787pt
* \textwidth=294.76926pt
* \textheight=418.25368pt
* \oddsidemargin=-9.10423pt
* \evensidemargin=-9.10423pt
* \topmargin=-37.56833pt
* \headheight=12.0pt
* \headsep=25.0pt
* \topskip=12.0pt
* \footskip=30.0pt
* \marginparwidth=44.0pt
* \marginparsep=10.0pt
* \columnsep=10.0pt
* \skip\footins=10.8pt plus 4.0pt minus 2.0pt
* \hoffset=0.0pt
* \voffset=0.0pt
* \mag=1000
* \@twocolumnfalse
* \@twosidefalse
* \@mparswitchfalse
* \@reversemarginfalse
* (1in=72.27pt=25.4mm, 1cm=28.453pt)

I would then explicitly define the relevant dimensions, dispense with geometry, add a5paper to the class options and proceed. However, this no longer seems to work and last time I needed to do this I could not make it work no matter what. (Right now, the compilation just seems to ignore the paper size settings. So I think you could do it on A4 and then have booklet scale the pages but I haven't tried. I gave up on booklet.)

Solution 2: Use pdfpages - avoid booklet

This solution is dead simple. The only downside is that you need a second file. All you do is prepare your initial file on A5 paper, ignoring for now the fact that you plan to make a booklet:

\documentclass[12pt]{article}
\usepackage[a5paper,verbose]{geometry}
\usepackage{lipsum}  % this package is for creating filler text

\author{N.~N}
\title{The booklet}

\begin{document}

\maketitle

\tableofcontents

\section{Europe}
\subsection{Berlin}
\lipsum[4]
\subsection{Paris}
\lipsum[1-3]
\subsection{Vienna}
\lipsum[10]
\subsection{Rome}
\lipsum[15]
\section{Africa}
\lipsum[1-4]
\subsection{Accra}
\lipsum[5-8]
\subsection{Johannesburg}
\lipsum[9-11]
\subsection{Casablanca}
\lipsum[11-12]
\lipsum[5-6]
\section{Asia}
\lipsum[1-4]
\subsection{Tokyo}
\lipsum[5-8]
\subsection{Beijing}
\lipsum[9-11]
\subsection{Mumbai}
\lipsum[11-12]
\lipsum[5-6]

\end{document}

Let's say that the pdf produced is prebooklet.pdf. Then you just need this:

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage{pdfpages}
    \includepdfset{pages=-}

\author{N.~N}
\title{The booklet}

\begin{document}

    \includepdf[pages=-,nup=1x2,landscape]{prebooklet.pdf}

\end{document}

This works perfectly with no trouble at all:

A5 booklet on A4 landscape

The only problem is the pages are not arranged correctly for printing the booklet. But this is easily fixed: just add the signature option:

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage{pdfpages}
    \includepdfset{pages=-}

\author{N.~N}
\title{The booklet}

\begin{document}

    \includepdf[pages=-,nup=1x2,landscape,signature=20]{prebooklet.pdf}


\end{document}

produces, for example:

Prepared signatures for booklet

I used 20 since you presumably want some multiple of 4 and have 17 actual pages of text.

cfr
  • 198,882
  • 6
    +1 You have been learning from egreg how to write a good answer? :) – yo' Jan 19 '14 at 09:16
  • @tohecz I'm not sure. Quite possibly. Why? – cfr Jan 19 '14 at 15:49
  • Well, the answer seems to be verz well written, showing the issues and their solutions in a fluent way. – yo' Jan 19 '14 at 16:16
  • @tohecz Thanks ;). Though I think egreg would be able to offer a better solution to the booklet problem. – cfr Jan 19 '14 at 16:21
  • @cfr thank you for the answer. It is good to get the job done. – Hannes Jan 20 '14 at 09:23
  • @Hannes Glad it helped. That was pretty much my attitude after tearing my hair out trying to get booklet working. I have an excess of hair, but even so... – cfr Jan 20 '14 at 15:51
  • @cfr I can't compile my book base on your code. – minthao_2011 Apr 22 '14 at 15:43
  • @minthao_2011 Oh. I'm not sure how you expect me to respond since I know neither the code you have nor the method you used. (I outline more than one solution in my answer, as well as some which used to work but don't now.) That is, I'm sorry it doesn't help you but all I can say is that the last strategy continues to work fine for me. Why don't you post a new question? If you post a link here when you've written it, I can certainly take a look if you'd like. – cfr Apr 22 '14 at 17:26
  • @cfr, Neat answer! Did you ever notice pixelation with really small text and or symbols ? Obviously pdf should be vector graphics and it is most likely my screen. But I experienced symbols missing out in prints completely. Even if the printing resolution is too low I think it should rather print something unreadable. Is there a way to fix that (in terms of latex trickery)? – BadAtLaTeX Mar 09 '16 at 00:33
  • @hillbilly No. Sounds like a printer issue rather than anything to do with LaTeX. I have had characters missing when printed, but not due to making booklets and nothing to do with resolution. Just printer stuff. There isn't anything LaTeX can do about that. But if the text/symbols are that small, who will be able to read it? Note that the way I do this, the size of the text is normal - I'm not scaling A4 down to A5 but preparing an A5 document initially. – cfr Mar 09 '16 at 02:53
  • @cfr, well it is obviously some error while printing but also the pdf preview seems oddly rough. It seems that mainly colons and periods in text are dropped, even though way smaller super-, subscripts and fractions or alike are printed well readable. Looking at some more text now it seems that almost no points appear in text. I am currently using the latter MWE from your answer inputting a a4 pdf. How would I input a a5 pdf ? – BadAtLaTeX Mar 10 '16 at 14:58
  • @hillbilly My answer inputs an A5 PDF. You just create the first document using A5. Then turn it into a booklet using the framework given above for pdfpages. Though, really, it seems to me that something else is going on. Make sure you are using scalable fonts (type1, truetype or opentype rather than metafont) and make sure the fonts are all being embedded. – cfr Mar 10 '16 at 17:11
  • @cfr, OK I've overlooked the \usepackage[a5paper,verbose]{geometry}, using just a5 as option in \documentclass[a5, ...] (which looked the same on screen - I expected it to just upscale). Well, using geometry, though made things look quite different, as everything is way too large now. I was actually looking for this downscaled look in order to save paper when printing. Is there a way to properly achieve a5 size while reducing the size of everything as if it was scaled ? How do I check fonts and embedding ? (Please note that everything seems to be alright in the pdfs generated) – BadAtLaTeX Mar 10 '16 at 18:17
  • @hillbilly It isn't recommended. Good quality fonts come in different optical sizes (e.g. Computer Modern, Latin Modern etc.) and 6pt is not the same as half 12pt. Generally, characters designed for lower point sizes have thicker strokes and are proportionately wider to ensure they can be read, printed etc. successfully. If you need a small font, better to use a small font than scaling a large one. That is, even with scalable fonts, you can't avoid the fact that, if you scale them, they are merely scaled. – cfr Mar 11 '16 at 01:11
  • @cfr, I've tried another printer now. You were right, it was a printer problem, looking just fine now. The fact that just periods and commas did not appear is weird though. – BadAtLaTeX Mar 28 '16 at 11:35
  • @hillbilly As somebody who once printed a couple of thousand pages in which the printing missed approximately 90% of lower case serif ts and nothing else, I agree that it is weird! – cfr Mar 28 '16 at 11:52