Soham Bagchi
Soham Bagchi CS Undergrad @ Ashoka

A User's Tutorial to LaTeX

A User's Tutorial to LaTeX

LaTeX is often made to seem more complicated than it really is. But what is it really? LaTeX is a:

  • Document Preparation System
  • It’s kindof a programming language for documents
  • It’s pronounced Lay-tech or Lah-tech not Lay-teks.
  • It’s not WYSIWIG (What You See is What You Get)

Why should any of us use LaTeX? In one word, it’s control. With Office Productivity software like Microsoft Office Word, sure you can make a pretty document, but you can’t create a header with pre-programmed author names, automatically updating dates and custom styling (or maybe you can, but then you’ll have to use your mouse and click through a bunch of different menus looking for the right setting, and then something will go wrong, and then you’ll try something else… and the list goes on and on).

And if there’s ever anything that you can’t do using LaTeX, not to worry! LaTeX has modules and packaages that you can install and import, that do all sorts of things for you - from predefined algorithm notations, coloured code outputs, even coordinate-based diagram drawing.

So, how do we get started with LaTeX?

Well, there’s a bunch of things you could do. You could go the fancy way and install a LaTeX editor on your computer (TexMaker on Windows, MacTeX on OSX), or you could go the easy way and use Overleaf - which is what we’re going to do because we’re lazy and this is fast!

Logging in on Overleaf

It’s pretty easy to use their interface to quickly build your first LaTeX document - be it your Discrete Math assignment, or the next ground-breaking research paper.

Hmm, I’m not sure I’m quite there yet…

That’s okay, here’s a brief overview of what all is there:

  1. Preamble
    • Packages - \usepackage{packagename}
    • Document Type - \documentclass{article|book}
    • Other Metadata - \title{Sample}, \author{CS Society}
  2. The Body
    • Environments
      • These are basically enclosed spaces that have a specific output format. They have a \begin and an \end (like most living things).
      • Examples
        • Math (Inline) - $(a + b)^2 = a^2 + b^2 + 2 \cdot a \cdot b$
        • Math (Multiline) - \begin{align*} ... \end{align*} (The * omits automatic line numbering, if you simply do \begin{align} each line will have a number)
        • Numbered Lists - \begin{enumerate} \item ... \item ... \end{enumerate}
        • Bullet Lists - \begin{itemize} \item ... \item ... \end{itemize}
        • Tables - \begin{tabular}{| c | c | c |} ... \end{tabular}
    • Commands
      • Formatting, alignment, all sorts of other fun things:
      • Examples
        • Bold - \textbf{Bold}
        • Italics - \textit{Italics}
        • Underline - \underline{Underline (This document wasn't written in LaTeX unfortunately)}
        • Section - \section{Section Name}
        • Section (Unnumbered) - \section*{Unnumbered Section Name}
        • Math Symbols - \int \sum \prod \times \cdot \infty
        • Math Exponents - \sqrt[n]{a} A^{20}_{10}
        • Math Fractions - \frac{10}{20}

Okay, I got this, what’s next?

Now that you’ve covered the basics, what remains is to get good, and then do the fancy pro-stuff. Here’s some stuff to get started:

  1. Bibliography
  2. Diagrams using TikZ
  3. Templates
  4. Make a Stylish LaTeX Resume
  5. Markdown - All the blogs on this website were written on Markdown, another popular (but less powerful) typesetting format.

That’s a lot to keep track of, isn’t it?

It sure is! That’s why there’s a whole bunch of different LaTeX cheatsheets available online that list the most commonly used environments, commands and packages. Here’s a few that might be useful:

  1. Winston Chang’s Cheatsheet - Geared towards Scientific Papers
  2. University of Massachusetts Amherst - A Super Brief, Yet Super Awesome, LaTeX Cheat Sheet

Have fun creating many many pretty documents in the future!

comments powered by Disqus