我有一份稿件和一份修订报告。我需要将稿件中的一些句子作为摘录放入修订报告中。除了将摘录定义为宏或将摘录放入另一个文件然后包含它们之外,有没有更好的解决方案可以在修订报告中使用稿件的文本?
我期望得到如下解决方案:
内容manuscript.tex
:
...
Pragraph is starting.
\begin{externalize}[excerpt1]
Part that must be both in the manuscript and the revision report.
\end{externalize}
Paragraph ends.
...
内容revisionReport.tex
:
...
Here we include the following excerpt from the revised manuscript:
\externalizedtext{excerpt1}
...
答案1
您可以使用filecontents
动态创建摘录文件:
内容manuscript.tex
:
\documentclass{article}
\usepackage{filecontents}
\begin{document}
...
Pragraph is starting.
\begin{filecontents}{excerpt1.tex}
Part that must be both in the manuscript and the revision report.
\end{filecontents}
\input{excerpt1.tex}
Paragraph ends.
...
\end{document}
内容revisionReport.tex
:
\documentclass{article}
\begin{document}
...
Here we include the following excerpt from the revised manuscript:
\input{excerpt1.tex}
...
\end{document}
虽然我不能完全确定我是否正确理解了你的问题,但这应该可以解决问题。