0

Consider the following document structure:

Project
├── Sections
│   ├── section1.tex
│   └── section2.tex
└── main.tex

And here is the content of the files:

Content of main.tex

\documentclass{article}

\begin{document}

\input{Sections/section1.tex}

\input{Sections/section2.tex}

\end{document}

Content of section1.tex

\section{Section 1}
bla bla bla

Content of section2.tex

\section{Section 2}
bla bla bla

Question: Is it possible to compile the files section1.tex and section2.tex separately to save computer resources during compilation, and add the compiled versions of section1.tex and section2.tex to the main.tex file?

  • 1
    use \include and then \includeonly when working on one section (that does not add the compiled version, it remakes everything when you want a full document, but that is needed anyway to get page numbers and cross references correct – David Carlisle Dec 14 '23 at 19:02
  • 2
    highest rated q on the site: https://tex.stackexchange.com/questions/246/when-should-i-use-input-vs-include – David Carlisle Dec 14 '23 at 19:07
  • To my understanding: no, there seems to be no way to save compile time. However, you may want to try package subfiles (https://www.ctan.org/pkg/subfiles) to compile sub-files, e.g. for checking or editing purposes. – MS-SPO Dec 15 '23 at 10:00
  • https://tex.stackexchange.com/questions/426422/what-is-best-practice-to-set-up-multi-file-tex-documents – Fran Jan 07 '24 at 21:44

0 Answers0