Possible Duplicate:
Automating quoting across LaTeX documents
I'm working on 2 documents: 1.tex and 2.tex.
2.tex is a metadocument about 1.tex, so that 2.tex has a lot of quotations from 1.tex. Thus, if I modify 1.tex, I need to modify 2.tex to reflect the changes accordingly. Such a procedure, however, is tedious and error-prone.
My question is: how can I store content from 1.tex for later insertion in 2.tex? I was wondering if there is any package like this:
1.tex:
\documentclass{book}
\usepackage{foo}
\begin{document}
First sentence. \StoreAndPrint{<key>}{Second sentence}. Third sentence.
\end{document}
2.tex:
\documentclass{article}
\usepackage{foo}
\begin{document}
The author says:
\begin{quote}
\RetrieveAndPrint{<key>}
\end{quote}
\end{document}
Running $ latex 1, and then $ latex 2, would output an automatically updated 2.dvi.
\input
I could create as many separate tex files as quotations, and then \input them into both documents, but that would make editing 1.tex too hard.
1.texand2.texwill be used to produce two distinct documents? – egreg Jan 11 '13 at 18:22