Introduction to LaTeX

Learning Objectives:

  • What is LaTeX?
  • Why LaTeX?
  • Installation of LaTeX
  • Hello world
  • Basic setup of TikZ
  • Demand and Supply Diagram

What is LaTeX? Why LaTeX?

LaTeX is a markup language to write documents. In a common word processor, we have what you see is what you get (WYSIWYG). Howver, in LaTeX, What you see is what you mean (WYSIWYM). This manes that

  • No need to bother with formatting, LaTeX will do it for you
  • Easy to include math/graphics/tables

Therefore, it becomes a standard for academic publishing.

Installation of LaTeX

Which software to install depends on your operation system:

  • If you use windows system, you need to install MikTeX.
  • If you use mac system, you need to install MacTeX.

Windows

For Windows, go to MikTeX. You will then see the following at the top of the page.

Clicking the download button will then bring you to this page.

Download MiKTeX, then install and open TexWork. You are then ready to use LaTeX on your Windows computer.

Mac

For Mac users, head to MacTeX. Click on the download MacTex button, as shown below.

LaTeX

Hello World

Since we are producing a document, we start to tell the program so by using the command \documentclass{article}. Then we need to tell which section should be included in the output file by using \begin{document} and \end{document}.

Finally, type the words “Hello World!” between the \begin{document} and \end{document}. Whatever text, pictures, or tables is included in between the 2 commands will appear on the document itself, and you can see this on the right-hand side.

\documentclass{article}
\begin{document}
Hello World!
\end{document}

If you compile the file, you should get the following pdf output:

Next