Including tex files for Structuring Large Documents

For structuring large documents we need to split various sections in different files and later all these files are included in final document to produce a final single document.
input {<filename>} is used to include filenames under a singel latex document.

Example (first file section1.tex)

\\

Sample Text 1 (section1.tex file)

Example (second file section2.tex)

\\

Sample Text 2 (section2.tex file)

Example (final file final.tex)

\documentclass[10pt,a4paper]{article}
\begin{document}
First line from final.tex (original file in the main tex file)
\input{section1.tex}
\\

Second line from final.tex (original file in the main tex file)
\input{section2.tex}

\end{document}

Output

First line from final.tex (original file in the main tex file)
Sample Text 1 (section1.tex file)
Second line from final.tex (original file in the main tex file)
Sample text 2 (section2.tex file)
Share

You may also like...