This lesson is about what LaTeX is and how to use it.

What is LaTeX?

LaTeX is used to typeset scientific documents. It is based on the programming language TeX, which is designed for writing mathematical texts. There are fundamental differences between LaTeX and other word processors such as MS Word and Pages.

Pros
Cons

The approach LaTeX used is called What You See Is What You Mean; when writing the document you can’t see the final result. Instead you see the structure of the document.

Using LaTeX

In this course you will learn to work with TeXworks. However, everything you learn about LaTeX itself is independent of your LaTeX editor.

TeXworks
A simple editor which is included in the LaTeX distributions MikTeX and TeX Live.
ShareLaTeX
An online editor where you can collaborate with others. It is convenient to use this on computers where LaTeX isn’t installed. Nowadays lots of students use ShareLaTeX, but to learn LaTeX we start using TeXworks. Afterwards students are free to use ShareLaTeX.

In the first exercise we will assume that you use TeXworks. To install this, see Installing LaTeX.

Exercise 1

  1. Open ‘TeXworks’ on your computer.
  2. Paste the following code in an empty document and save it as ‘helloworld.tex’. The extension of a TeX file always is ‘.tex’.

    \documentclass[a4paper]{article}
    \begin{document}
    Hello world!
    \end{document}
  3. Select ‘pdfLaTeX’ in the menu to the right of the green button and press the green button afterwards. We call this typesetting. LaTeX turns your code into a PDF document which you will see in a new window.
  • Useful: Select ‘Format -> Syntax Coloring -> LaTeX’ to colour your code.
  • Useful: To jump from the code to the output in TeXworks you can right-click and choose ‘Jump to PDF’. In the same way it is possible to switch from the pdf to the code.

Exercise 2

  1. On your computer create a folder LaTeX (a subfolder of the computeralgebra/latex-folder)
  2. Place the example file created above in this folder.
  3. Do the same with all the LaTeX-files you will use in this course.

Exercise 3

  1. Download this introductory LaTeX document.
  2. Open this file in TeXworks.
  3. Typeset the document.
  4. Compare the input with the output.

Exercise 4

  1. Download this introductory LaTeX document.
  2. Open this file in TeXworks.
  3. Typeset the document.
  4. Compare the input with the output.

From now on we start using TeXworks. In the final exam TeXworks will be used.

Resources

We encourage you to use not only this website, but also other resources if you can’t figure something out yourself. The following websites provide useful information:

LaTeX Wikibooks
An up-to-date collection of articles about LaTeX. The standard resource for this course.
TeX - LaTeX Stack Exchange
A question and answer site with many active users. For the students who want to know more.

Remember

  • How to open TeXworks (or ShareLaTeX)?
  • How to compile a LaTeX file?
  • Don’t be afraid to explore the web!