General ⇒ How to redirect latex output to multiple files?
How to redirect latex output to multiple files?
I want something like
\begin{document}
% redirect output to proj.dvi -- whatever this command is
main text
% redirect output from this point on to refs.dvi
references
\end{document}
and this should generate two dvi files with the appropriate content. Sort of like what \input does to the input text, only in reverse for the output.
Any help would be appreciated.
Thanks.
Mihran
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Re: How to redirect latex output to multiple files?
welcome to this board!
I like to say welcome to you. But I'm afraid it may not be possible what you want to do, at least I don't know a way. Either I would split with pdfpages later, or spilt into several tex files before.
Stefan
Re: How to redirect latex output to multiple files?
However, if all you want is to extract some specific page ranges in an automated way, here's what I would do.
During latex run write to an external file (or job log file) messages about the page ranges that you want to extract. After latex finishes read that info and run dvips as usual. For example placing in your document:
\immediate\write18{echo You are on \thepage\space page> msg.txt}
just after \begin{document} will create msg.txt file containing: "You are on 1 page". You will need to enable write18 for this to work (--enable-write18 switch in MiKTeX). In this way you can even create batch scripts that will do the appropriate postprocessing and just call them after latex finishes.
Cheers,
Tomek
Re: How to redirect latex output to multiple files?
Thanks again.
Mihran
How to redirect latex output to multiple files?
Now, you can control which of these parts appear in the output with the \includeonly directive. The part you omit will be invisible, although its page numbers and cross references will be preserved. You can run latex twice, with different parts included, to produce different outputs. Alternatively, you can make two master documents with different names that include the different parts. I found this feature in the following URL, which has a longer description and examples:
http://www.ics.mq.edu.au/~rdale/resourc ... truct.html
-Cengiz
Re: How to redirect latex output to multiple files?
How to redirect latex output to multiple files?
It does exclude them from the output for me.miltos wrote:Using \includeonly will only let the excluded files unprocessed. It will not exclude them from the output.