[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Creating booklets with Latex



On 04/29/00, Nils-Erik Svangård addressed "Creating booklets with Latex":
> I've gotten in trouble again, bragging about how good Debian is and that I
> write all my reports in Latex. Well now I might gone under. I'm supposed
> to produce a booklet i A6 (folded A5) with students songs.
> I have read some docs on the web, it seems I can create a booklet by using
> either lpr -Cduplex or using a program called psbook. But I havent figured
> out how to print it on A5 paper (A6 booklets).
> Does anyone have experiance makeing booklets?

I make lots of booklets, most of them on folded us-legal size paper.
I'm sure the procedures I use can be adapted for other sizes.  The
first step is to use the geometry LaTeX package to set the page size
to the final page size you want.
For example: \usepackage[papersize={7in,8.5in}]{geometry} 

The next step can be one of two things, depending on whether you want
to manipulate the pages into a booklet at the dvi level or the
postscript level.  I find the former a little simpler, but it doesn't
handle things like the color package or pstricks.  

To use dvi-level page manipulation, use the program dvidvi.  It has a
man page, but here's an example of how I would use it to make a
booklet on landscape-legal (14"X8.5") paper out of pages written to
fit on half that size (7"X8.5"):

% dvidvi -m "4:-1,2(7in,0in)" dvifile.dvi firstoutput.dvi
% dvidvi -m "4:-3,0(7in,0in)" dvifile.dvi secondoutput.dvi

This should make two output files which you can print sequentially on
the same stack of paper (depending somewhat on how your printer ejects
the paper) and end up with a booklet.  In other words, after printing
the first file, you can take that stack, place it in the printer
backwards, and print the second file.

To make this work right, you should *not* use a \papersize special in
the original LaTeX file.  That also means don't use the 'dvips' option
to the geometry package.  You then give certain options to dvips
(which has info documentation) to make sure it generates postscript
with the correct orientation.  An example from my legal-size bulletins:

% dvips -t landscape -t legal -f firstoutput.dvi | lpr
% dvips -t landscape -t legal -f secondoutput.dvi | lpr

OK - that was how I'd do it with dvi-level manipulation.  For
postscript level manipulation, I'd start by using the geometry package
as above, only I'd also include either the dvips package option or a
\papersize special.  For example: 

\documentclass[twocolumn]{article}
\usepackage[papersize={14in,8.5in},dvips]{geometry} 

   .. or ..

\usepackage[verbose,landscape,letterpaper,noheadfoot]{geometry}
\geometry{left=\Marginwidth, textwidth=\Textwidth}
\special{papersize=14in,8.5in}

Though it looks more complex, I use the latter.  It allows you to make
each page a real LaTeX page rather than one column in a larger page.
For me, the first two commands are hidden in a style file.  You can
see how the \geometry{} command makes it convenient to change geometry
options later on.  (\Marginwidth and \Textwidth are local to my style
file.)

To simplify the rest of the process, I wrote the following shell
script to manipulate the pages from the initial dvi file to the
printer.  All the tools I used have man pages.  The output should be
usable just like the output from the dvidvi method. An example of how
I use this script:

# To print the whole thing, one sheet at a time:
% mklegalbook dvioutput.dvi

# To print the whole thing without pausing between:
% mklegalbook dvioutput.dvi nopause

# To print only the first set of pages:
% mklegalbook dvioutput.dvi print 1

# To print only the second set of pages:
% mklegalbook dvioutput.dvi print 2


#!/bin/sh
#$Id: mklegalbook,v 1.4 1999/09/05 00:02:04 jesse Exp jesse $
dvifile=$1
nowait=$2
onepage=$3

dvips -f $dvifile -o /tmp/${$}raw.ps

# With \special{papersize=} for dvips}
if ( [ "$onepage" == 1 ] || [ -z "$onepage" ] ) ; then
	pstops -plegal  "4:-1+2(0in,-7in)" /tmp/${$}raw.ps /tmp/${$}first.ps
    ps2lj4 legal </tmp/${$}first.ps | lpr
fi
if [ -z "$nowait" ]; then
    echo "Insert paper for second side printing and hit enter to continue." 
    read blah
fi
if ( [ "$onepage" == 2 ] || [ -z "$onepage" ] ) ; then
	pstops -plegal  "4:-3+0(0in,-7in)" /tmp/${$}raw.ps /tmp/${$}second.ps
    ps2lj4 legal </tmp/${$}second.ps | lpr
fi
rm -f /tmp/${$}{raw,first,second}.ps



Hope this helps!

-- 
Jesse Jacobsen, Pastor          jjacobsen@jvlnet.com
Grace Lutheran Church (ELS)     http://www.jvlnet.com/~jjacobsen/
Madison, Wisconsin              GnuPG public key ID: 2E3EBF13


Reply to: