Tips for LaTeX

Tips for LaTeX

References

image-20250918-173413.png
Potential issues if the references are not well managed: missing types or inconsistent formatting.

To ensure a good uniformity in the way you reference elements (figures, sections, etc…) in your document, you can use the library cleveref.

The cleveref package allows you to define the format for the different types of cross-references once-and-for-all in the preamble of your document.

In the document’s preamble (e.g. root.tex), after all other packages modifying the referencing system:

\usepackage{cleveref} %% If you want to personalize the references, redefine the formatting like that: \crefname{figure}{Figure}{Figures} \crefname{table}{Table}{Tables} \crefname{section}{Section}{Sections}

In the content files:

Replace all instances of \ref by \cref.

\cref{<label>}

Note: at the beginning of a sentence, use \Cref instead of \cref.

General tips

  • To facilitate the tracking of changes and also the navigation in Overleaf from PDF to code editor, it can be useful to use a newline for each sentence. (This will not be visible in the pdf, as only double line break in the editor creates a line break in the output.)

Institut für Mechatronik im Maschinenbau (iMEK), Eißendorfer Straße 38, 21073 Hamburg