Creating Booklets tropf ABSTRACT short guide to create A5 booklets with a reg‐ ular (duplex) printer 1. Writing a Booklet You can safely skip this section if you don’t care and just want a booklet version of an already created document. The point of this is to create a PDF suited for an A5 book‐ let, as most documents you find in the wild are not. 1.1. Properties of your created file For a nice booklet you want your file to have the fol‐ lowing properties: • well supported format (PDF) • page is half the size of your printer size (e.g. if printing A4 you want your PDF pages to be A5) • even pages will be on left, odd ones on the right; I reg‐ ularly use: cover, content 1, content 2, blank, preface, blank, first chapter... Use some form of typesetting software for this. I usu‐ ally use groff with mom (see next section), Latex should also work. If you don’t like yourself you could also use Libre Office Writer or MS Word. 1.2. Using Mom If you want to use groff to write booklets (or even whole books), I can recommend mom. Using the mom doc ⟨http://www.schaffter.ca/mom/momdoc/toc.html⟩ I regularly use this preset: 3 January 2021 ‐2‐ .PAPER A5 . .TITLE "title" .SUBTITLE "subtitle" .AUTHOR "author" .MISC "Org 1" "Org 2" .COPYRIGHT "CC BY 4.0" .AUTO_RELOCATE_TOC . .DOCTYPE DEFAULT .PRINTSTYLE TYPESET .ATTRIBUTE_STRING "" .FINIS_STRING "" .FINIS_NO_DASHES .TOC_HEADER_STRING "Table Of Contents" .CHAPTER_STRING "Part" .COVER TITLE AUTHOR COPYRIGHT COVERTEXT MISC PDF_OUTLINE_LABEL "Cover: " .PAGENUM_POS BOTTOM RIGHT .PAGENUM_HYPHENS NO .RECTO_VERSO .FORCE_RECTO . .FAMILY A .FT R .PT_SIZE 10 .\"SMARTQUOTES DE .START . .PP Preface text here . .EL .COLLATE .DOCTYPE CHAPTER .CHAPTER 1 .CHAPTER_TITLE "Getting Started" .PREFIX_CHAPTER_NUMBER .START . .HEADING 1 "Setup" .PP Chapter content . .FINIS .nr WAS_EVEN 0 .nr WAS_ODD 0 .if e .nr WAS_EVEN 1 .if o .nr WAS_ODD 1 .TOC_PAGE_SETTINGS \!.if o .PAGENUM_POS BOTTOM LEFT .TOC_PAGE_SETTINGS END .TOC .HEADERS NO .if e .if \n[WAS_EVEN] .bp .if o .if \n[WAS_ODD] .bp 3 January 2021 ‐3‐ .PAGINATE NO .FOOTERS NO To build a PDF file from that pipe it through preconv ‐eutf8 | pdfmom ‐Tpdf ‐c ‐R ‐p ‐t ‐mden ‐mom ‐m www 2. Creating the printable version 2.1. Compressing the pdf When printing the booklet, you will send the entire PDF file to the printer. It makes sense to make the sent data as small as possible. To do that, we’ll reencode the PDF file using ghostscript—hoping that the ghostscript encoder is smarter (and more compatible) than the previous pdf en‐ coder. Execute on the terminal (this might take a short while): gs ‐sDEVICE=pdfwrite ‐dCompatibilityLevel=1.4 ‐dPDFSETTINGS=/default ‐dNOPAUSE ‐dQUIET ‐DBATCH ‐sOutputFile=doc‐reencoded.pdf doc.pdf 2.2. Formatting as a book Now format the file as a book. By default the pages will be rearranged (margins added, resized etc.) such that the result is printable. But a good typesetting software has already done that for you, so if used a typesetting software to create an A5 PDF add ‐n. pdfbook2 ‐p a4paper ‐n doc‐reencoded.pdf This will create a file named doc‐reencoded‐book.pdf. The output file name can’t be changed. 3. Printing Print the resulting document doc‐reencoded‐book.pdf us‐ ing a double‐sided printer, turning the page on the long edge. When using a non‐double‐sided printer you are on your own. Good luck! Afterwards take the stack of paper out of the printer, just add staples (no reordering of pages etc.) and fold it. 3 January 2021 ‐4‐ 4. See also • pdfbook2(1): program to generate printable pdfs for book‐ lets • gs(1): powerful pdf tool (actually more library than bi‐ nary) • mom documentation ⟨http://www.schaffter.ca/mom/momdoc/ toc.html⟩: groff macroset for typesetting 3 January 2021