great, thanks Will! We will give it a try.
Gary
On Sun, 2 Mar 2008, Will Lowe wrote:
OK. The following is not pleasant, but appears to
work and is easily
scriptable.
Organize the source into separate files and _two_ master files. As in the
previous example let the separate files be:
---------- firstbit.tex ----------
\section{First Section}\label{sec:1}
The first section's text. There will be more text in section~\ref{sec:2}.
---------- secondbit.tex ----------
\section{Second Section}\label{sec:2}
The second section's text. There was more text in section~\ref{sec:1}.
----------
In the first master file, use \input to create a whole document, like this:
--------- main-whole.tex ----------
\documentclass{article}
\begin{document}
\input{firstbit}
\input{secondbit}
\end{document}
------------
Compile as usual to make the whole document. Now turn to the other master
file. It is just like the file above but uses \include, like this:
--------- main-part.tex ----------
\documentclass{article}
\begin{document}
\include{firstbit}
\include{secondbit}
\end{document}
----------
And compile it. For reasons best known to TeX this will not create the same
output when compiled: there will be a page break after each included file.
Throw away the superfluously-spaced pdf output and insert
\includeonly{secondfile}
just before the \begin{document} and compile again. The result should be a
document containing only the contents you want, but with the cross
references and other numbering working right.
\includeonly takes comma-separated filenames if you want more than one
section to stand alone. This works because \include gives each included
file its own aux files (and adds a page break) whereas \input does neither.
That should allow you the flexibility to pull out particular sections
irrespective of whether they happen to start on a new page.
Will
--------------------
Thanks Will. This is helpful. I think we need one more step tho. Instead
of outputting pages 7-10, say, as a separate document, we want to output the
contents of a \chapter or \section as a separate document. any idea how to
do that? and, as you recognize, the solution has to be scriptable given how
often we do builds.
Gary
On Sun, 2 Mar 2008, Will Lowe wrote:
On 2 Mar 2008, at 2:50, Gary King wrote:
unfortunately, running latex another time doesn't help; we just haven't yet
figured out how to both have the latex referencing working properly and the
parts compiled separately. its a bit complicated with vignettes and all.
we're looking into it.
You could cheat and simply pull the relevant vignette pages out of the
larger document. Acrobat will do this sort of thing, but here's a
scriptable solution using the pagesel.sty package:
---------------
\documentclass{article}
\usepackage[2]{pagesel} %% just output page 2, or [2-7], etc.
%% For the old school
%% \documentstyle[selectp]{article}
%% \outputonly{2}
\begin{document}
\section{First Section}\label{sec:1}
The first section's text. There will be more text in section~\ref{sec:2}.
\newpage
\section{Second Section}\label{sec:2}
The second section's text. There was more text in section~\ref{sec:1}.
\end{document}
---------------
To make the \ref and \label bits work properly, first _comment out_ the
\usepackage statement and compile until the references work (that's the
complete document done), then _uncomment_ the \usepackage statement, and
compile again (that's section 2 only done). The second (and subsequent)
runs use the .aux files from the first part.
Clearly this should be scripted, but I assume you already have a makefile or
somesuch that can trigger the preprocessing sequence, move the output pdf
files, etc.
Apologies if you've already considered this route,
Will
Gary
On Sun, 2 Mar 2008, Emilio Luque wrote:
Dear all,
> Wouldn't the question marks in Zelig's Installation PDF section calls >
mean
that it needs another LaTeX run?
Best,
Emilio
--
Emilio Luque
Dir. Investigación IUED
[C/Juan del Rosal, 10, Fac. Psicología, Despacho 0.17, 913986685]
Prof. Medio Ambiente y Sociedad; Director Adj. Postgrado en Juventud y
Sociedad
[Dep. Sociología II, C/Obispo Trejo, s/n, Despacho 3.14, 913988354]
UNED 28040 Madrid (España)
> ATACD EU Project partner:
http://atacd.net