A LaTeX document is structured in two main parts:
👉 Everything before \\begin{document}
👉 Starting with \\begin{document}
and ending with \\end{document}
% Preamble of the document
\\documentclass[10pt]{article}
\\usepackage[a4paper,hmargin=3cm,vmargin=3cm]{geometry}
\\usepackage[utf8]{inputenc}
\\usepackage[T1]{fontenc}
\\usepackage[english]{babel}
\\usepackage[english]{varioref}
\\usepackage[noabbrev,english]{cleveref}
\\begin{document} % Main part of the document starts here
% document contents
Latex is amazing!
\\end{document}
% Preamble of the document
\\documentclass[10pt]{article}
\\usepackage[letterpaper, hmargin=1in, vmargin=1in]{geometry}
\\usepackage[utf8]{inputenc}
\\usepackage[T1]{fontenc}
\\usepackage[ngerman]{babel}
\\usepackage[ngerman]{varioref}
\\usepackage[noabbrev,german]{cleveref}
\\begin{document} % Main part of the document starts here
% document contents
Latex is amazing!
\\end{document}
The \\documentclass
command is inserted during the conversion process based on the settings at the beginning of the LaTeX code. Adjust the settings if you want to change the parameters of the command.
The rest of the preamble must be written in OneNote. Technically, it doesn't matter where you place your preamble commands in OneNote. OneLatex will go through each page of the section when loading the notebook and insert the text into the preamble that is highlighted in orange or has a “Project-A” tag.
However, for a better overview of the preamble content, it is recommended to create a separate page at the beginning of the OneNote section for initialization purposes only (see Step 2: Create a OneNote page for Initializiation purposes for more details).
OneLatex automatically inserts the commands \\begin{document}
and \\end{document}
at the beginning and end of the main part.
Text from the OneNote notebook, with the exception of text with a green, orange or blue background color (remarks) or with the tag “Project A”, will be included in the main part.
Text with a yellow background color or with the tag “Project B” will be interpreted as native LaTeX code during the conversion process.