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.

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 write PINCH 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 macro newcommand{\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?

Next