isn't it easier to post process?
Not sure if pdftex can change output stream on the fly
--
/daleif (remove RTFSIGNATURE from email address)
LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html
Either use \includeonly and run pdflatex multiple times, or create
separate "top" files and run pdflatex on each, or run pdflatex once
and break up the PDF using a program like pdftk:
http://www.accesspdf.com/pdftk/
There are also other possibilities involving first converting the PDF to
Postscript.
Bob T.
For example, if I want to split the PDF into separate PDFs for every
chapter (assuming every chapter starts on a new page), and if I know on
which page each chapter starts, then I can easily do this using e.g.
ghostscript.
In general, however, the page on which a particular chapter starts my
change as the source changes. Could I define the \chapter command such
that it places a PDF \special in the final file, marking the position
where gs will split the file?
Marius
> For example, if I want to split the PDF into separate PDFs for every
> chapter (assuming every chapter starts on a new page), and if I know on
> which page each chapter starts, then I can easily do this using e.g.
> ghostscript.
You can use \include and \includeonly.
Or write the page number at each chapter start into an auxiliary file.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
> Not sure if pdftex can change output stream on the fly
No, pdfTeX generates just one output PDF file.
Yours sincerely
Heiko <ober...@uni-freiburg.de>
It should be much simpler to write those page numbers to a file and
use that in postprocessing. You could even write the entire
postprocessing script from TeX and just call it after compilation.
Cheers,
Tomek
If \write18-feature is enabled for your TeX-distribution, you
can use it in order to launch other TeX-runs from within TeX.
With each of these "other" TeX-runs, you can specify another
value for the jobname-option and thus produce different
pdf-files with different content.
The example below is tested under MiKTeX 2.4.
Ulrich
\documentclass{article}
\ifx\conditionmacro\undefined
\immediate\write18{%
pdfLaTeX --jobname="\jobname1"
\gdef\string\conditionmacro{1}\string\input\space\jobname
}%
\immediate\write18{%
pdfLaTeX --jobname="\jobname2"
\gdef\string\conditionmacro{2}\string\input\space\jobname
}%
\immediate\write18{%
pdfLaTeX --jobname="\jobname3"
\gdef\string\conditionmacro{3}\string\input\space\jobname
}%
\expandafter\stop
\fi
\begin{document}
\ifnum\conditionmacro=1 Condition is 1\fi
\ifnum\conditionmacro=2 Condition is 2\fi
\ifnum\conditionmacro=3 Condition is 3\fi
\verb|\conditionmacro| is \texttt{\meaning\conditionmacro}.
\end{document}