latex分文件编写技巧
source link: https://blog.csdn.net/yanxiangtianji/article/details/13169699
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
什么是latex分文件编写,为什么要分
一篇大的文章或者书籍,包含很多章节,各个章节很可能是由不同的作者分别编写的。无论是在编写还是修订阶段,大量的修改是难免的,如果对于每一个修改,都要去复制粘贴地合并到同一个文件里面,很容易出现纰漏,另外还极大地降低了开发效率。即使是使用软件开发过程中常见的版本管理工具来进行,也面临很多同步问题。这显然是与latex出现的初衷向违背的。
因而latex允许我们将一个大的源文件拆分许多个小的源文件(按章节),并通过另一个文件将它们组合起来。可以近似地理解为C/C++语言中的头文件。
这样各个部分可以独立编写,非常方便合作编写和审阅修订。
\input
\include
一个论文的例子
%导言区\usepackage{...}
\input{1-abstract}
\input{2-introduction}
\input{3-model}
\input{4-data}
\input{5-solve}
\input{6-conclusion}
\input{7-acknowledgment}
\bibliography{ref}
\bibliographystyle{abbrv}
\end{document}\begin{document} \input{1-abstract} \input{2-introduction} \input{3-model} \input{4-data} \input{5-solve} \input{6-conclusion} \input{7-acknowledgment} \bibliography{ref} \bibliographystyle{abbrv} \end{document}
----------------1-abstract.tex---------------
This paper .....
\end{abstract}\begin{abstract} This paper ..... \end{abstract}
-----------------2-introduction.tex------------
\section{Introduction}..........
----------------3-model.tex----------------
\section{Model}............
..............
一些经验技巧
一个论文的例子2.0
\def\all_in_one{all_in_one}
\input{1-abstract}
\input{2-introduction}
\input{3-model}
\input{4-data}
\input{5-solve}
\input{6-conclusion}
\input{7-acknowledgment}
\bibliography{ref}
\bibliographystyle{abbrv}
\end{document}\begin{document} \input{1-abstract} \input{2-introduction} \input{3-model} \input{4-data} \input{5-solve} \input{6-conclusion} \input{7-acknowledgment} \bibliography{ref} \bibliographystyle{abbrv} \end{document}
----------------0-preamble.tex---------------
\documentclass{article}%导言区\usepackage{...}
----------------3-model.tex----------------
\ifx\all_in_one\undefined\input{0-preamble}
\begin{document}
\fi
\section{Model}
............
..............
\ifx\all_in_one\undefined
\end{document}
\fi
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK