Latex Info
LaTeX - LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de facto standard for the communication and publication of scientific documents.
Useful links
- Awesome LaTeX - This is a curated list of awesome stuff for the (La)TeX typesetting system.
- Writing LaTeX Documents In Visual Studio Code With LaTeX Workshop - Great essay in medium.com
- Typesetting figures for Computer Science - by Andrew Mertz, William Slough and Nancy Van Cleave; practical packages for drawing stacks, byte fields, trees, automata, and more.
- What is Latex, why and how?
- Minimal intro to tikz - Amazing package for drawing in Latex. Maybe a bit old now but the basic should be more or less unchanged.
- Collaborating with LaTeX and Git - A pretty good explanation on how to use git version control to collaborate with Latex.
Best practices & Etiquette
-
As in coding, use comments to structure the code and tell what it does — this will help to keep track of your code even when you take a look at it after some time.
-
Do not use
\\
to break lines, just use enter and leave a line blank.\\
does not do paragraph break and it is cumbersome to see it all over the place.\\
is used only for certain cases and environments, only then. You say more? Check [here(]https://tex.stackexchange.com/questions/82664/when-to-use-par-and-when-or-blank-lines) -
Do not do text formatting inside
$...$
math mode. Things like$n=1,\ 1=1^2$
should be written$n=1$, $1=1^2$
. Among other things, the comma there should be in normal text, not within math mode. One should avoid any formatting inside math, math is a very special environment. You say more? Check here. -
Itemizations/enumerations always carry punctuation, either full stop if they are full sentences or semicolon if they are all part of the “same long sentence”.
-
If you are using something systematically, over and over, then set that up in a general way, not by just repeating it over and over. Same as in coding. For example, say you want to change the style of enumeration, so then you do:
\begin{enumerate}[label=\roman*)] ..... \end{enumerate}
If you are going to use that style all over, then do this in the preamble:
\renewcommand{\theenumi}{\roman{enumi})}
or
\setenumerate[0]{label=(\roman*))}
-
Similarly, if you are going to use something in many places, define a macro. For example, suppose your system being reported in your paper is called
PINCH
. Then, do not writePINCH
everywhere, but define a macro\pinch
for it:newcommand{\pinch}{PINCH}
. If you ever change the name of your system or want the name to appear in another format, you just change the macro! Similarly, if you will use \textsc{Jon Doe} in many places, define a macronewcommand{\JonDoe}{\textsc{Jon Doe}}
. -
Use more new lines to structure code than less, i.e. prefer:
\newcommand{\mycmd}[1]{% \par\addvspace{\baselineskip}% \noindent My Text:~% \parbox[t]{0.6\textwdith}{% \textbf{#1} }% \par\vspace{\baselineskip}% }
against
\newcommand{\mycmd}[1]{% \par\addvspace{\baselineskip}\noindent My Text:~\parbox[t]{0.6\textwdith}{\textbf{#1}}% \par\vspace{\baselineskip}% }
-
Define options one per line:.
\documentclass[ ngerman, fontsize=12pt, draft ]{scrartcl}
-
Indent environment contents
\begin{xyz} content \end{xyz}
-
Set equations, floats and any other environments with commented blank lines
Some text of a paragraph % \begin{figure} \centering FIGURE \caption{Nice figure} \end{figure} % more text of tis paragraph % \[ y = x^2 \] % last text.
-
Use blank lines to set off headlines from regular text, e.g.
\chapter{My Chapter} Text \section{My section} Text
-
Set
\footnotes
on their own line and indent them – don’t forget to comment the end of the preceding line to suppress the space.Text with a footnote% \footnote{Text} more text
Note: some of the above were taken from here
Do you have anything else that could be added here?