2

The letter class makes it possible to generate two letters from a single run.

\documentclass[11pt]{letter}
\usepackage{lipsum}

\begin{document}
\name{John Doe}
\signature{John Doe}

\begin{letter}{Mr.\ Foo Bar}
\opening{Dear Mr.\ Bar}
\lipsum[1]
\end{letter}

\begin{letter}{Mr.\ Bar Foo}
\opening{Dear Mr.\ Foo}
\lipsum[2]
\end{letter}

\end{document}

But the resulting two letters are only logically distinct. They are generated in the same PDF file.

Is it ever possible, using any mechanism (irrelevant of letter), to get LaTeX to generate two ("physical", not logical) PDF files from a single run? Presumably the initialization in the preamble will be available for both.

My hunch is that this is not possible, and the best might be to concoct a shell script that passes a (boolean) parameter. Can you confirm?

Calaf
  • 1,471
  • Why should you generate two PDF from the same LaTeX file in a single run? – Astrinus Dec 02 '16 at 16:40
  • It depends what you define as a 'run'. If the compilation can spawn another compilation, it can compile a second PDF. This is how the externalisation of images works in PGF/TikZ, for example. But there is a separate compilation run for each PDF. Or you can use something like arara or rubber or mklatex to initiate multiple compilations. Or you can 'burst' a PDF after compilation using one of those tools to automate it. – cfr Dec 02 '16 at 16:48
  • @Astrinus Why not? Otherwise, you have to split the PDF if you want to send the letters electronically, for example. – cfr Dec 02 '16 at 16:50
  • it's here http://tex.stackexchange.com/questions/45563/splitting-a-big-document-into-several-output-pdf-files or http://tex.stackexchange.com/questions/74243/automatically-create-two-pdf-output-files-from-one-tex-file or http://tex.stackexchange.com/questions/5228/can-one-tex-file-output-to-multiple-pdf-files – touhami Dec 02 '16 at 16:50
  • @cfr you are talking about different letters, don't you? Why different documents should not go each in their own file?? – Astrinus Dec 02 '16 at 16:53
  • @Astrinus If you are merging data into a standard template, this would be tiresome. Suppose you need to send 50 similar letters with only minor variations ... – cfr Dec 02 '16 at 18:34
  • @cfr one of the linked answers targets exactly this case. And it produces one PDF per run. – Astrinus Dec 02 '16 at 20:41
  • @Astrinus So? Sorry, bit confused ... – cfr Dec 02 '16 at 22:01

0 Answers0