@slide(layout=chapter-slide) @number 4 @title Complex projects @slide(layout=content-and-preview) @title Goal @content Create a bigger LaTeX project and … * prevent LaTeX documents from growing monstrously 👹 * keep the overview over the project structure @preview {style="padding: .2em; height: 100vh"} @slide(layout=content-and-preview) @title Main file 👑 @content * contains basic structure * includes separate sections with \ `\input{path/to/file}` ``` {.lang-tex .hljs data-sourcefile=main.tex} \documentclass{article} \usepackage{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \title{A Title} \begin{document} \maketitle \tableofcontents \input{section1.tex} \input{section2.tex} \end{document} ``` @preview  @slide(layout=content-and-preview) @title File with a section @content * contains **no preamble** * contains **no** `\begin{document}` or `\end{document}` ``` {.hljs .lang-tex data-sourcefile=part1.tex} \section{This is section 1} A paragraph about the content of section 1. % … ``` ``` {.hljs .lang-tex data-sourcefile=part2.tex} \section{This is section 2} A paragraph about the content of section 2. % … ``` @preview {.thin-padding} @slide(layout=content-and-preview-with-category) @category Excursion @title Specifying file paths 👣 @content * important for `\input{}`, but later also for other media types * file and folder structure = tree structure 🌳 * with `\input{}`, you can specify the path relative to the main file
In **LaTeX,** you have to use UNIX-style paths. They are separated by a forward slash: `path/to/file`. We will use those from here on.
@preview  @slide(layout=content-and-preview-with-category) @category Excursion @title Specifying file paths 👣 @content`main-exercises.tex` → `praeamble.tex`
`main-exercises.tex` → `basic-document-structure.tex` (in a subfolder)
./content/basic-document-structure.tex@preview  @slide(layout=content-and-preview-with-category) @category Excursion @title Specifying file paths 👣 @content
`basic-functionality.tex` → `graphics.raw.tex`
(`basic-functionality.tex` is imported into `main-exercises.tex`)
./exercises/graphics/graphics.raw.tex
Paths are always relative to the root document that imports other files as fragments.