LaTeX¶
There is plenty documentation and introductions to LaTeX (see e.g. the overleaf documentation). We will assume that you are familiar with the basics of LaTeX and present some more advanced tips and tricks.
Some additional help can be found in the How to write a Laboratory Report Guide and there is a thesis template available.
Consistent Typesetting¶
LaTeX makes some assumptions about your text that might not always be true.
Latex assumes a period ends a sentence, unless it is preceded by an uppercase letter
This means we have two problematic cases in the following sentence: We had e.g. bad SNR.
- The first two periods are not ending a sentence, but this is not clear for the second one
- The final dot is preceded by an uppercase letter
To make spacing consistent write the previous example as We had e.g.\ bad SNR@.
Not all spaces should also allow a break, therefore use non-breaking spaces where applicable
Example: ...\ by Zingsheim et al.~\cite{Foo:2000:BAR}
Bibliography¶
Here are some tipps to get nice consistent bibliographies:
- Get entry from reliable source (ads, doi via curl or doi2bib)
- Abbreviate journal names (use the ISO4 standard)
- Resolve capitals in titles (double braces around first letter or modify .bst file)
- Check other errors (sub- and superscript, units, names of authors, especially van, de, ...)
If you want to cite multiple references, specify them as a comma separated list:
- \cite{Ref1, Ref2, Ref3} instead of \cite{Ref1}, \cite{Ref2}, \cite{Ref3}
- This will allow, depending on your citation style, to sort and compress the references: [1-3] instead of [1], [2], [3]
- For natbib this can be done for example with \usepackage[numbers,sort&compress]{natbib}
Reference managers can greatly simplify this procedure (see e.g. JabRef) and offer many of the above mentioned functions.
Referencing¶
The trusted \ref command is a great tool but for larger texts \autoref might be even more useful. It is a command from the hyperref package which adds an automatic prefix to the reference.
- \ref produces something like 1
- \autoref produces Figure 1
- the prefix can be controlled via \renewcommand{\figureautorefname}{Fig.}
- this allows to quickly adapt a paper to specific journal guidelines
- Bonus: with autoref the prefix belongs to the clickable link
Also make sure that each figure, table, or other float is referenced from within the text and idealy in the right order.
Numbers and Units¶
Information from this section is presented in more detail in A. Thompson, B. Taylor, Guide for the Use of the International System of Units (SI).
General¶
- Values consist of a number, an unit, and sometimes an uncertainty
- Quantity symbols are written in italic type while the number and unity are written in roman type
- The value and unit are separated by a (half non-breaking) space
- There is no space between a prefix and the unit (e.g. km, nm, ...)
Uncertainties¶
- Uncertainties are typically given either in parentheses or with a ± sign:
- A = 100(1) μm
- A = (100 ± 1) μm
- The number of significant digits can be indicatd by the journal, otherwise consider that the maximum possible relative rounding error is
- 100 % for one significant digit
- 5 % for two significant digits
- 0.05 % for three significant digits
- Therefore choose a sensible tradeoff between precision and readibility
Additional¶
- Constants, chemical elements, and defined functions or operators are written in roman type
- Subscript and superscript appear in roman or italic type
- Roman type is applied for descriptive sub- and superscripts (e.g. the density of oil ρoil)
- Italic type is applied if a quantity is represented (e.g. for running numbers $\sum_i x_i$).
Packages¶
- Use the siunitx package for values and ranges (\SI, \SIrange)
- allows to easily change formats of all quantities
- also offers the S table column type to align values at the decimal sign
- Use the mhchem package for all kind of chemistry formulas