> ## Documentation Index
> Fetch the complete documentation index at: https://resources.latex-cloud-studio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing Large Documents in LaTeX

> Master multi-file LaTeX projects. Learn document structuring, file organization, cross-referencing, and compilation strategies for books, theses, and reports.

Learn professional techniques for managing large LaTeX documents like books, theses, and technical reports. This guide covers file organization, modular document structure, efficient compilation, and team collaboration strategies.> [!NOTE]
>
> **Prerequisites**: Basic LaTeX knowledge, understanding of document classes\
> **Time to complete**: 35-40 minutes\
> **Difficulty**: Advanced\
> **What you'll learn**: Project structure, input/include commands, subfiles, cross-referencing, and build optimization## Why Split Large Documents?### Benefits of Modular Structure> [card] Faster Compilation
>
> Compile only changed sections during development> [card] Better Organization
>
> Logical file structure mirrors document structure> [card] Team Collaboration
>
> Multiple authors can work on different sections> [card] Version Control
>
> Track changes at the chapter/section level### When to Split Documents> [!TIP]
>
> **Consider splitting when**:
>
> * Document exceeds 50 pages
> * Multiple authors collaborate
> * Chapters have distinct topics
> * Compilation takes over 30 seconds
> * You need different formatting per section
> * Managing bibliography becomes complex## Project Structure### Standard Directory Layout```
my-thesis/
├── main.tex                 # Master document
├── preamble/
│   ├── packages.tex        # Package imports
│   ├── settings.tex        # Document settings
│   ├── commands.tex        # Custom commands
│   └── environments.tex    # Custom environments
├── frontmatter/
│   ├── titlepage.tex       # Title page
│   ├── abstract.tex        # Abstract
│   ├── dedication.tex      # Dedication
│   └── acknowledgments.tex # Acknowledgments
├── chapters/
│   ├── introduction.tex    # Chapter 1
│   ├── literature.tex      # Chapter 2
│   ├── methodology.tex     # Chapter 3
│   ├── results.tex         # Chapter 4
│   └── conclusion.tex      # Chapter 5
├── appendices/
│   ├── appendix-a.tex      # Appendix A
│   └── appendix-b.tex      # Appendix B
├── backmatter/
│   ├── bibliography.bib    # References
│   └── index.tex           # Index entries
├── figures/                # All images
│   ├── chapter1/
│   ├── chapter2/
│   └── shared/
├── tables/                 # Complex tables
└── build/                  # Build artifacts
```### Master Document Setup```latex main.tex theme={null}
\documentclass[12pt, twoside, openright]{book}

% Load preamble components
\input{preamble/packages}
\input{preamble/settings}
\input{preamble/commands}
\input{preamble/environments}

% Document metadata
\title{Your Document Title}
\author{Your Name}
\date{\today}

\begin{document}

% Front matter
\frontmatter
\input{frontmatter/titlepage}
\input{frontmatter/dedication}
\input{frontmatter/acknowledgments}
\input{frontmatter/abstract}
\tableofcontents
\listoffigures
\listoftables

% Main matter
\mainmatter
\input{chapters/introduction}
\input{chapters/literature}
\input{chapters/methodology}
\input{chapters/results}
\input{chapters/conclusion}

% Appendices
\appendix
\input{appendices/appendix-a}
\input{appendices/appendix-b}

% Back matter
\backmatter
\printbibliography[heading=bibintoc]
\printindex

\end{document}
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.</details>```latex example.tex theme={null}
% Essential packages for large documents
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

% Page layout
\usepackage[
    top=1in,
    bottom=1in,
    left=1.5in,
    right=1in,
    headheight=14pt
]{geometry}

% Graphics and colors
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{tikz}

% Tables and lists
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{enumitem}

% Mathematics
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

% References and links
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage[nameinlink]{cleveref}

% Bibliography
\usepackage[
    backend=biber,
    style=authoryear,
    sorting=nyt
]{biblatex}
\addbibresource{backmatter/bibliography.bib}

% Index
\usepackage{imakeidx}
\makeindex[intoc]

% Headers and footers
\usepackage{fancyhdr}
\usepackage{emptypage}

% Code listings
\usepackage{listings}
\usepackage{minted}

% Subfigures
\usepackage{subcaption}

% Todo notes
\usepackage[disable]{todonotes} % Enable during writing
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This code depends on minted's external syntax-highlighting process. The documentation renderer deliberately disables shell escape, so the secure preview pipeline explains the effect instead of executing an external process.</details>## Input vs Include### Understanding the Differences> [tab] \input
>
> ````latex example.tex theme={null}
> % Direct text insertion
> \input{filename} % No .tex extension needed
>
> % Characteristics:
> % - No page break before/after
> % - Can be nested
> % - Good for preamble files
> % - Compiles every time
>
> % Example usage:
> \input{preamble/packages}
> \input{chapters/section1}
> ```<details><summary>Expected effect</summary>
>       \> \\[!NOTE]
> \>
> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.</details>
> ````> [tab] \include
>
> ````latex example.tex theme={null}
> % Chapter-level inclusion
> \include{filename} % No .tex extension
>
> % Characteristics:
> % - Starts new page before
> % - Clears page after
> % - Cannot be nested
> % - Works with \includeonly
> % - Creates .aux file
>
> % Example usage:
> \include{chapters/introduction}
> \include{chapters/methodology}
> ```<details><summary>Expected effect</summary>
>       \> \\[!NOTE]
> \>
> \> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.</details>
> ````> [tab] \includeonly
>
> ````latex example.tex theme={null}
> % Selective compilation
> \includeonly{
>     chapters/introduction,
>     chapters/results
> }
>
> % Only compiles listed files
> % Preserves numbering/references
> % Massive time savings
> % Perfect for focused editing
> ```<details><summary>Expected effect</summary>
>       \> \\[!NOTE]
> \>
> \> This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.</details>
> ````### Practical Examples```latex efficient-workflow.tex theme={null}
% During writing - compile only current chapter
\includeonly{chapters/methodology}

\begin{document}
% ... front matter ...

\include{chapters/introduction}    % Skipped
\include{chapters/literature}      % Skipped
\include{chapters/methodology}     % Compiled
\include{chapters/results}         % Skipped
\include{chapters/conclusion}      % Skipped
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This excerpt is structurally incomplete and cannot be compiled honestly as a standalone document. It shows document-boundary syntax rather than a visible page result.</details>```latex nested-structure.tex theme={null}
% chapters/methodology.tex
\chapter{Methodology}
\label{ch:methodology}

\section{Overview}
This chapter describes our research methodology.

% Include section files
\input{chapters/methodology/data-collection}
\input{chapters/methodology/analysis}
\input{chapters/methodology/validation}

\section{Summary}
The methodology ensures reliable results...
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.</details>## The Subfiles Package### Independent Compilation```latex main-subfiles.tex theme={null}
\documentclass{book}
\usepackage{subfiles}
% ... other packages ...

\begin{document}

\subfile{chapters/introduction}
\subfile{chapters/literature}
\subfile{chapters/methodology}

\end{document}
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.</details>```latex example.tex theme={null}
\documentclass[../main.tex]{subfiles}
\begin{document}

\chapter{Introduction}
\label{ch:intro}

This thesis investigates...

% Can be compiled independently!
% Run: pdflatex introduction.tex

\section{Background}
The research background...

\section{Objectives}
Our main objectives are...

\end{document}
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.</details>```latex standalone-chapter.tex theme={null}
% Alternative: standalone package
\documentclass{standalone}
\usepackage{import}

% Stand-alone compilable
\begin{document}
\import{../}{preamble}

\chapter{Standalone Chapter}
Content here...

\end{document}
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.</details>### Subfiles Best Practices> [!TIP]
>
> **Subfiles workflow tips**:
>
> 1. Each chapter can be compiled separately
> 2. Graphics paths are relative to main file
> 3. Bibliography works in both modes
> 4. Perfect for author collaboration
> 5. Faster development cycles## Cross-referencing### Managing References Across Files```latex smart-referencing.tex theme={null}
% Enable smart referencing
\usepackage{xr} % Cross-references to external documents
\usepackage{xr-hyper} % With hyperref support
\usepackage{cleveref}

% Reference another document
\externaldocument[ext:]{external-doc}

% In chapters/introduction.tex
\chapter{Introduction}
\label{ch:intro}

\section{Motivation}
\label{sec:intro:motivation}

As discussed in \cref{ch:methodology}, our approach...

% In chapters/methodology.tex
\chapter{Methodology}
\label{ch:methodology}

Building on \cref{sec:intro:motivation}, we develop...

% Cleveref automatically handles:
% "Chapter 3" vs "Section 1.2" vs "Figure 4.5"
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.</details>```latex reference-organization.tex theme={null}
% Systematic labeling convention
\label{type:chapter:section:subsection}

% Examples:
\label{ch:intro}                    % Chapter
\label{sec:intro:background}        % Section
\label{subsec:intro:background:history} % Subsection
\label{fig:results:accuracy}        % Figure
\label{tab:data:summary}           % Table
\label{eq:methodology:formula}      % Equation
\label{alg:analysis:process}        % Algorithm
\label{thm:theory:main}            % Theorem
\label{def:terms:important}         % Definition

% Easy to find and maintain
% Avoids naming conflicts
% Self-documenting
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.</details>### Advanced Cross-referencing```latex multi-file-refs.tex theme={null}
% Create a references file
% refs/labels.tex
\newcommand{\introduction}{\cref{ch:intro}}
\newcommand{\methodology}{\cref{ch:methodology}}
\newcommand{\maintheorem}{\cref{thm:main}}
\newcommand{\resultsfigure}{\cref{fig:results:main}}

% Use semantic references
As shown in \resultsfigure, our method outperforms...
The proof follows from \maintheorem...

% Benefits:
% - Central management
% - Easy to update
% - Semantic naming
% - Find/replace friendly
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.</details>```latex reference-checking.tex theme={null}
% Check for undefined references
\usepackage{refcheck}

% Shows unused labels
\usepackage{showlabels}

% During development only:
\usepackage[notref,notcite]{showkeys}

% Custom warning for missing refs
\makeatletter
\def\@refundefined#1{%
  \textbf{[REF: #1??]}%
  \@latex@warning{Reference `#1' undefined}%
}
\makeatother
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.</details>## Compilation Strategies### Build Systems> [tab] Makefile
>
> ```makefile theme={null}
> # Makefile for large LaTeX projects
> MAIN = main
> CHAPTERS = $(wildcard chapters/*.tex)
> FIGURES = $(wildcard figures/**/*.pdf)
> BIBTEX = biber
>
> # Default target
> all: $(MAIN).pdf
>
> # Main compilation
> $(MAIN).pdf: $(MAIN).tex $(CHAPTERS) $(FIGURES)
> 	pdflatex $(MAIN)
> 	$(BIBTEX) $(MAIN)
> 	pdflatex $(MAIN)
> 	pdflatex $(MAIN)
>
> # Quick build (no bibliography)
> quick: 
> 	pdflatex $(MAIN)
>
> # Clean auxiliary files
> clean:
> 	rm -f *.aux *.log *.out *.toc *.lof *.lot
> 	rm -f *.bbl *.blg *.bcf *.run.xml
> 	rm -f chapters/*.aux
>
> # Clean everything
> distclean: clean
> 	rm -f $(MAIN).pdf
>
> # Watch for changes
> watch:
> 	latexmk -pdf -pvc $(MAIN)
>
> .PHONY: all quick clean distclean watch
> ```> [tab] latexmk
>
> ```perl theme={null}
> # .latexmkrc configuration
> $pdf_mode = 1;        # Use pdflatex
> $bibtex_use = 2;      # Use biber
> $out_dir = 'build';   # Output directory
>
> # Custom dependencies
> add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
> add_cus_dep('acn', 'acr', 0, 'run_makeglossaries');
>
> sub run_makeglossaries {
>   if ( $silent ) {
>     system "makeglossaries -q '$_[0]'";
>   } else {
>     system "makeglossaries '$_[0]'";
>   };
> }
>
> # Continuous preview
> $preview_continuous_mode = 1;
> $pdf_previewer = 'open -a Skim';
>
> # Clean extensions
> $clean_ext = 'synctex.gz acn acr alg aux bbl bcf blg brf fdb_latexmk glg glo gls idx ilg ind ist lof log lot out run.xml toc';
> ```> [tab] VS Code Tasks
>
> ```json theme={null}
> // .vscode/tasks.json
> {
>   "version": "2.0.0",
>   "tasks": [
>     {
>       "label": "Build LaTeX",
>       "type": "shell",
>       "command": "latexmk",
>       "args": [
>         "-pdf",
>         "-synctex=1",
>         "-interaction=nonstopmode",
>         "-file-line-error",
>         "main.tex"
>       ],
>       "group": {
>         "kind": "build",
>         "isDefault": true
>       }
>     },
>     {
>       "label": "Quick Compile",
>       "type": "shell",
>       "command": "pdflatex",
>       "args": ["main.tex"],
>       "problemMatcher": []
>     },
>     {
>       "label": "Clean Auxiliary",
>       "type": "shell",
>       "command": "latexmk",
>       "args": ["-c"],
>       "problemMatcher": []
>     }
>   ]
> }
> ```### Compilation Optimization```latex draft-mode.tex theme={null}
% Fast draft compilation
\documentclass[draft]{book}
% Images shown as boxes
% Overfull boxes marked
% Much faster compilation

% Conditional draft mode
\usepackage{ifdraft}
\ifdraft{
  \usepackage[disable]{todonotes}
  \overfullrule=5pt
}{
  \usepackage{todonotes}
  \overfullrule=0pt
}

% Skip expensive operations
\ifdraft{
  \renewcommand{\includegraphics}[2][]{%
    \fbox{#2}% Just show filename
  }
}{}
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.</details>```latex externalization.tex theme={null}
% Externalize TikZ pictures
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize[prefix=tikz/]

% Compile once, reuse many times
\begin{tikzpicture}
  % Complex diagram
  % Only recompiled if changed
\end{tikzpicture}

% Externalize other content
\usepackage{standalone}
\usepackage{docmute}

% In main.tex:
\input{figures/complex-diagram}
% Can also compile standalone
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.</details>## Version Control### Git Best Practices```bash .gitignore theme={null}
# LaTeX auxiliary files
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb

# Bibliography auxiliary
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml

# Build artifacts
build/
*.pdf
!figures/*.pdf
!templates/*.pdf

# Editor files
.vscode/
*.swp
*.swo
*~
.DS_Store

# Temporary files
*.tmp
*.bak
*.backup
``````bash git-workflow.sh theme={null}
# Meaningful commits for documents
git add chapters/methodology.tex
git commit -m "Add data analysis section to methodology"

git add figures/chapter3/*.pdf
git commit -m "Add experimental results figures"

git add preamble/commands.tex
git commit -m "Define custom theorem environments"

# Tag milestones
git tag -a v1.0-draft -m "First complete draft"
git tag -a v2.0-submission -m "Journal submission version"

# Branch for major revisions
git checkout -b revision-reviewer-1
git checkout -b conference-version
```### Collaboration Strategies> [!TIP]
>
> **Team collaboration tips**:
>
> 1. **One sentence per line** - Easier diffs
> 2. **Semantic linebreaks** - Break at clauses
> 3. **Chapter ownership** - Assign primary authors
> 4. **Regular integration** - Daily merges
> 5. **Automated builds** - CI/CD for PDFs## Managing Bibliography### Modular Bibliography```latex bibliography-setup.tex theme={null}
% Split bibliography by chapter
\usepackage[refsection=chapter]{biblatex}
\addbibresource{references/intro.bib}
\addbibresource{references/theory.bib}
\addbibresource{references/experiments.bib}

% Print chapter bibliographies
\printbibliography[heading=subbibintoc]

% Or global bibliography
\printbibliography[heading=bibintoc]

% Bibliography categories
\DeclareBibliographyCategory{own}
\addtocategory{own}{myarticle2020,mybook2021}

\printbibliography[
  category=own,
  title={Own Publications}
]
``````bibtex references/management.bib theme={null}
% Organize by topic
% references/machine-learning.bib
@article{lecun2015deep,
  title={Deep learning},
  author={LeCun, Yann and Bengio, Yoshua and Hinton, Geoffrey},
  journal={Nature},
  volume={521},
  number={7553},
  pages={436--444},
  year={2015}
}

% references/statistics.bib
@book{hastie2009elements,
  title={The elements of statistical learning},
  author={Hastie, Trevor and Tibshirani, Robert and Friedman, Jerome},
  year={2009},
  publisher={Springer}
}
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.</details>## Multi-format Output### Conditional Formatting```latex conditional-output.tex theme={null}
% Different formats from same source
\usepackage{ifthen}
\newboolean{printversion}
\setboolean{printversion}{true} % or false

% Conditional content
\ifthenelse{\boolean{printversion}}{
  % Print version
  \usepackage[colorlinks=false]{hyperref}
  \geometry{twoside}
}{
  % Digital version
  \usepackage[colorlinks=true]{hyperref}
  \geometry{oneside}
}

% Format-specific content
\newcommand{\printonly}[1]{%
  \ifthenelse{\boolean{printversion}}{#1}{}%
}
\newcommand{\digitalonly}[1]{%
  \ifthenelse{\boolean{printversion}}{}{#1}%
}

% Usage
\digitalonly{\href{https://example.com}{Click here for details}}
\printonly{See \url{https://example.com} for details}
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.</details>## Troubleshooting Large Documents### Common Issues> [!WARNING]
>
> **Large document problems and solutions**:
>
> 1. **Undefined references**
>    ```latex theme={null}
>    % Run LaTeX multiple times
>    pdflatex main && pdflatex main && pdflatex main
>    ```
>
> 2. **Memory errors**
>    ```bash theme={null}
>    # Increase memory limits
>    export extra_mem_top=2000000
>    export extra_mem_bot=2000000
>    ```
>
> 3. **Slow compilation**
>    * Use `\includeonly` during writing
>    * Enable draft mode
>    * Externalize graphics
>
> 4. **File not found**
>    ```latex theme={null}
>    % Check paths
>    \input{./chapters/intro} % Explicit path
>    \graphicspath{{./figures/}{./images/}}
>    ```
>
> 5. **Conflicting packages**
>    * Load hyperref last
>    * Check package documentation
>    * Use compatibility options## Complete Example Project```latex complete-thesis-structure.tex theme={null}
% main.tex - Complete thesis example
\documentclass[
    12pt,
    a4paper,
    twoside,
    openright,
    english,
    bibliography=totoc,
    listof=totoc
]{scrbook}

% ====== PREAMBLE SETUP ======
\input{preamble/packages}
\input{preamble/settings}
\input{preamble/commands}

% Conditional compilation
\includeonly{
    chapters/introduction,
    chapters/methodology,
    chapters/results
}

% ====== DOCUMENT INFO ======
\title{Advanced Research in LaTeX Document Management}
\author{Your Name}
\date{\today}

\begin{document}

% ====== FRONT MATTER ======
\frontmatter
\input{frontmatter/titlepage}
\input{frontmatter/declaration}
\input{frontmatter/abstract}
\input{frontmatter/acknowledgments}

\tableofcontents
\listoffigures
\listoftables
\input{frontmatter/abbreviations}

% ====== MAIN MATTER ======
\mainmatter
\include{chapters/introduction}
\include{chapters/literature}
\include{chapters/theory}
\include{chapters/methodology}
\include{chapters/implementation}
\include{chapters/results}
\include{chapters/discussion}
\include{chapters/conclusion}

% ====== APPENDICES ======
\appendix
\include{appendices/code}
\include{appendices/data}
\include{appendices/proofs}

% ====== BACK MATTER ======
\backmatter
\printbibliography[heading=bibintoc]
\include{backmatter/glossary}
\printindex

\end{document}
``````bash project-setup.sh theme={null}
#!/bin/bash
# Setup script for large LaTeX project

# Create directory structure
mkdir -p {preamble,frontmatter,chapters,appendices,backmatter}
mkdir -p {figures,tables,build}
mkdir -p figures/{chapter1,chapter2,shared}

# Create preamble files
touch preamble/{packages,settings,commands,environments}.tex

# Create chapter files
for i in {1..8}; do
    touch chapters/chapter$i.tex
done

# Create front/back matter
touch frontmatter/{titlepage,abstract,acknowledgments}.tex
touch backmatter/bibliography.bib

# Create Makefile
cat > Makefile << 'EOF'
MAIN = main
LATEX = pdflatex
BIBTEX = biber
BUILDDIR = build

all: $(MAIN).pdf

$(MAIN).pdf: $(MAIN).tex
	$(LATEX) -output-directory=$(BUILDDIR) $(MAIN)
	cd $(BUILDDIR) && $(BIBTEX) $(MAIN)
	$(LATEX) -output-directory=$(BUILDDIR) $(MAIN)
	$(LATEX) -output-directory=$(BUILDDIR) $(MAIN)
	cp $(BUILDDIR)/$(MAIN).pdf .

clean:
	rm -rf $(BUILDDIR)/*

.PHONY: all clean
EOF

echo "Project structure created!"
```<details><summary>Expected effect</summary>
      \> \\[!NOTE]
\>
\> This code group documents a multi-step workflow across LaTeX and another file or command language. The blocks work together in a project, so there is no single standalone LaTeX page that would honestly represent the whole group.</details>## Best Practices Summary> [!TIP]
>
> ✅ **Large document checklist**:
>
> * [ ] Logical file structure
> * [ ] Consistent naming convention
> * [ ] Modular preamble
> * [ ] Smart cross-referencing
> * [ ] Version control setup
> * [ ] Build automation
> * [ ] Backup strategy
> * [ ] Collaboration guidelines
> * [ ] Documentation/README
> * [ ] Regular integration builds## Next StepsContinue mastering advanced LaTeX:> [card] Collaboration Workflow
>
> Team collaboration strategies[Open](https://resources.latex-cloud-studio.com/learn/latex/how-to/collaboration-workflow.md)> [card] Using Templates
>
> Create and use document templates[Open](https://resources.latex-cloud-studio.com/learn/latex/how-to/using-templates.md)> [card] Fixing Errors
>
> Troubleshoot compilation issues[Open](https://resources.latex-cloud-studio.com/learn/latex/basics/errors.md)> [card] Book Publishing
>
> Professional book creation[Open](https://resources.latex-cloud-studio.com/learn/latex/how-to/book-publishing.md)> [card] Knowledge Base Docs
>
> Keep the core papers and source PDFs for a large project inside the same workspace as the document tree.[Open](https://resources.latex-cloud-studio.com/product/knowledge-base.md?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=large_documents)> [card] AI Research Agent Docs
>
> Use accepted-source expansion and literature follow-up work when a chapter needs stronger evidence.[Open](https://resources.latex-cloud-studio.com/product/ai-research-agent.md?utm_source=resources\&utm_medium=internal_card\&utm_campaign=research_workflow\&utm_content=large_documents)### Large Document Structure Toolkit- [Sections and chapters](https://resources.latex-cloud-studio.com/learn/latex/document-structure/sections-and-chapters.md)
- [Table of contents](https://resources.latex-cloud-studio.com/learn/latex/document-structure/table-of-contents.md)
- [Glossaries and acronyms](https://resources.latex-cloud-studio.com/learn/latex/document-structure/glossaries.md)
- [Indexes](https://resources.latex-cloud-studio.com/learn/latex/document-structure/indexes.md)
- [Hyperlinks](https://resources.latex-cloud-studio.com/learn/latex/document-structure/hyperlinks.md)
- [Multi-file projects](https://resources.latex-cloud-studio.com/learn/latex/document-structure/multi-file-projects.md)
- [filecontents package](https://resources.latex-cloud-studio.com/learn/latex/document-structure/filecontents-package.md)
- [BibLaTeX guide](https://resources.latex-cloud-studio.com/learn/latex/bibliography/biblatex-guide.md)***> [!NOTE]
>
> **Pro tip**: Start with a well-organized structure from the beginning. It's much harder to reorganize a monolithic document later. Use version control from day one and establish clear naming conventions for your team.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.