shu*_*alo 6 latex preprocessor typesetting mathematical-typesetting
我在\ latex工作了一个巨大的脚本.
我希望能够将每个章节编译为独立的,因为使用Latex进行黑客攻击会更容易.
另一方面,我想维护一份文档,其中包含迄今为止编写的整个脚本.
我不知道如何在没有永久烦人开销的情况下维护这两个文档,因为tex文件既可以单独编写,也可以包含在内.
有一个Latex预处理器可用于具有类似C的#define和#ifdef-#else- #endif语句,这将是非常有帮助的.这将在很大程度上促进写作.你知道乳胶中是否存在这样的东西,或者你怎么能做同等的事情?谷歌没有向我提供令人满意的答案.
编辑:一些评论,以避免误解:我知道非常简单的内置TEX预处理器,但这些命令不能正常工作.因此,对这些的引用不会帮助我.
我脚本中的章节应该是这样的(伪代码)
IF being_just_included defined
%No header here, and document has already begun
ELSE
\input{common_header.tex} %Header things all my documents use
\begin{document}
ENDIF
%%% Lots of stuff
IF being_just_included defined
%Nothing to do here
ELSE
\end{document}
END IF
Run Code Online (Sandbox Code Playgroud)
相反,我的完整脚本源文件应如下所示
\input{common_header.tex}
DEFINE being_just_included
\begin{document}
\input{preamble.tex}
\input{first_chapter.tex}
\input{second_chapter.tex}
\input{third_chapter.tex}
\end{document}
Run Code Online (Sandbox Code Playgroud)
你可以发布一个执行类似这样的代码吗?