A short video overview, auto-generated by NotebookLM is available at the bottom of this page.
Table of Contents
Organization of LaTeX documents
For short documents (e.g., a paper of 15 pages or less, a short report, a book chapter):
If a single author (the first author) is mainly responsible for writing and editing the paper, possibly with inputs from co-authors, then use a single file main.tex and write the entire content in it (i.e., do not split each section into a separate file).
However, if multiple authors will co-edit the paper at the same time, especially using a version control system like git, there is a risk of conflicts and the document should be split into multiple files as for long documents (see below).
For long documents (e.g., a very long paper or report, a thesis, a book, which often has multiple “chapters”), or when there is a significant risk of conflicts when multiple authors edit the paper at the same time:
Split the document into multiple TeX files, one for each logical part of the document, such as a chapter or a section.
Use descriptive names for these files, such as intro.tex and experiment.tex; do not use generic names like section1.tex and do not include orders in the file names like 1-intro.tex. The order should be specified in the main document, not fixed by the file name. The main document main.tex then include / input these part files, using \input (or in certain cases, \include or \includeonly).
If desired or if the preamble is too long and complex (e.g., many complex settings, custom commands, etc.), write the preamble in a separate file such as preamble.tex and \input it in the main file.
For figures:
Store the figure files in a folder figs or figures (lowercase letters, no spaces) and include them from that folder.
If a figure is created with LaTeX (like TikZ, pgfplots), use a separate TeX file for it (don’t put the code in the main LaTeX file), store that file in the figure folder, and \input it in the main document.
If a figure is created using a tool like draw.io, IPE, or Dia, include the source file in the folder in addition to the exported figure file (preferably PDF).
Tables should be written directly in the main TeX file, unless it’s a long and complex table (like a whole-page table) or it’s created automatically by another tool then it may be stored in a separate TeX file and included in the main document. A useful tool for LaTeX tables, especially complex ones, is https://www.tablesgenerator.com/.
BibTeX files and other support files are separate.
General rules
Line breaks: these rules are created to work well with version control, like git.