1 of 20

Introduction to Overleaf and LaTex

Alexander Knetsch

21 June 2024

2 of 20

The first thing you see

Overleaf Tutorial – Summer students 2024

2

3 of 20

The overleaf editor: Let’s take it apart

Overleaf Tutorial – Summer students 2024

3

4 of 20

The overleaf editor: Let’s take it apart

Not just one file

  • .tex file contains code

  • Image files are external to code

  • .bib files contain reference library

Overleaf Tutorial – Summer students 2024

4

5 of 20

The overleaf editor: Let’s take it apart

The editor

  • Forget WYSIWYG

  • You are ‘programming’ a document

  • Write prose section in plain text.

  • Text format, title, author, sections, images, … is done via command.

  • LaTeX interprets code and produces a beautiful document for you

Overleaf Tutorial – Summer students 2024

5

6 of 20

The overleaf editor: Let’s take it apart

The output

  • Typically PDF document ready to download

  • Some compilation options available

Overleaf Tutorial – Summer students 2024

6

7 of 20

The overleaf editor: Let’s take it apart

Collaborative writing

  • Review: Collaborator can add comments next to the code

  • Share: Share your documents with collaborators as read-only or editable

  • Submit: Facilitates paper submission process to some journals and databases (e.g. arXiv)

  • History: Your documents have a version control. Make sure to regularily create ’labels’ .

Overleaf Tutorial – Summer students 2024

7

8 of 20

Highlights of the LaTeX syntax

Minimum example

  • Commands start with \

  • \documentclass[]{} defines the type of document and starts the code.
    • Many different classes available (article,report,book,…)
    • More parameter in [], e.g. twocolumn

  • Comments start with %

  • \begin{} \end{} define specialized sections

  • Document body is opened and closed with \begin{document} and \end{document}

Overleaf Tutorial – Summer students 2024

8

9 of 20

Highlights of the LaTeX syntax

Introducing structure

  • \title{} and \author{} are examples of commands that set parameters before \begin{document}
  • \maketitle compiles a document title from prior defined information.

  • Title style can vary depending on documentclass and used packages

  • \begin{abstract} \end{abstract}

  • Sections are structured like this
  • \section{}
    • \subsection{}
      • \subsubsection{}

Overleaf Tutorial – Summer students 2024

9

10 of 20

Highlights of the LaTeX syntax

Introducing lists

  • Itemized lists are written between \begin{itemize} and \end{itemize}

  • Bullet points start with \item …

  • To write sub-bulletpoints one can nest the list

Overleaf Tutorial – Summer students 2024

10

11 of 20

Highlights of the LaTeX syntax

Equations

  • \usepackage{} loads more packages and adds available functionality and commands.

  • \usepackage{amsmath} introduces math environment

  • $$ frames equations in text

  • $$ ... $$ saparates the math environment from the text

  • \begin{equation} … \end{equation} for referenceable equations

  • \begin{align} … \end{align} for referenceable consecutive equations

Overleaf Tutorial – Summer students 2024

11

12 of 20

Highlights of the LaTeX syntax

Figures

  • Important package: graphicx

  • \begin{figure} … \end{figure}[] sets the environment

  • [h,t,b,…] to position figure here, on top, or bottom of page.

  • \centering centers figure in the horizontal direction

  • \includegraphics[size]{filename} links to graphic.

  • \caption{} sets the text under the graphic.

Overleaf Tutorial – Summer students 2024

12

13 of 20

Citations in LaTeX and Overleaf

Overleaf Tutorial – Summer students 2024

13

identifier

14 of 20

Highlights of the LaTeX syntax

Citation

  • Cite publications with \cite{identifier}

  • Identifier needs to be the same in .tex and .bib file

  • References section is automatically generated through \bibliography{}

  • Library entries that are not cited, won’t appear in the References section

  • But: You can only cite entries that are in your library.

  • \bibliographystyle{} sets the style how citations are generated. Examples are: abbr, alpha, unsrt, …

Overleaf Tutorial – Summer students 2024

14

15 of 20

How to build your library

With Google scholar

Overleaf Tutorial – Summer students 2024

15

16 of 20

How to build your library

With doi2bib

Overleaf Tutorial – Summer students 2024

16

17 of 20

How to build your library

Overleaf Tutorial – Summer students 2024

17

Import your Mendeley library

18 of 20

Ressources

Useful links

https://www.overleaf.com/learn/ 🡪 Extensive explications and command database for LaTeX and overleaf

https://ctan.org/ 🡪 CTAN Comprehensive TeX Archive Network: A compendium of TeX packages

https://detexify.kirelabs.org/🡪 Detexify, draw symbols or equations for the math environment. Also available as android app

https://www.doi2bib.org 🡪 Build your reference library

https://scholar.google.de/ 🡪 Build your reference library

ChatGPT is also pretty good at writing LaTeX code

Overleaf Tutorial – Summer students 2024

18

19 of 20

Part II: The Exercise

19

You will be assigned as a group to an overleaf document

We meet again in ca. 15 minutes and the groups present their document

Your document should be populated with the following parts:

  • An author list, a title and a short abstract. Bonus points for affiliations
  • A section ‘Introduction’ including a citation of a real publication of your choice
  • A second section with a figure. (for example FACET related (https://facet-ii.slac.stanford.edu/photos) )
  • A section with an equation, which is referenced

Don’t bother about content or quality of text or equations, this is just for fun !

Good luck !

20 of 20

Part II: The Results

20