Lecture Notes: Complete Guide to Learning LaTeX
📘 Table of Contents
1. Introduction to LaTeX
2. Setting Up LaTeX
3. Document Structure
4. Text Formatting
5. Special Characters in LaTeX
6. Sections and Subsections
7. Lists in LaTeX
8. Mathematical Typesetting
9. Tables in LaTeX
10. Including Images
11. Page Layout and Customization
12. Referencing and Citations
13. Cross-references
14. Common Packages and Their Uses
15. Document Classes
16. Presentations with Beamer
17. Bibliographies and BibTeX
18. Advanced Tips and Best Practices
19. Practice Problems
1. 📌 Introduction to LaTeX
LaTeX is a typesetting system widely used for producing technical and scientific documentation. Unlike word
processors, LaTeX uses plain text with markup commands to format content.
Advantages:
• Precise control over document structure and formatting
• Ideal for mathematical and academic writing
2. 🛠️ Setting Up LaTeX
Offline Setup
• Windows: Install MiKTeX
• macOS: Install MacTeX
• Linux: Install TeX Live
1
Online Editors
• Overleaf: No installation, real-time collaboration
3. 🧱 Document Structure
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Hello, LaTeX!
\end{document}
Explanation:
• \documentclass{} specifies the type of document
• \usepackage{} adds extra functionality
• \begin{document} marks the start of content
4. ✍️ Text Formatting
\textbf{Bold} \textit{Italic} \underline{Underline}
\emph{Emphasized} \texttt{Monospace}
Line breaks:
First line\\
Second line
Paragraphs: Add an empty line
5. 🔤 Special Characters in LaTeX
Characters with special meaning:
# $ % & _ { } ~ ^ \
Escape them using backslashes:
2
\$ \% \# \_ \{ \} \textasciitilde \textasciicircum \textbackslash
6. 🧩 Sections and Subsections
\section{Main Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
Automatically numbered, can be referenced using \label and \ref .
7. 📝 Lists in LaTeX
Unordered List
\begin{itemize}
\item First item
\item Second item
\end{itemize}
Ordered List
\begin{enumerate}
\item First item
\item Second item
\end{enumerate}
Description List
\begin{description}
\item[Apple] A fruit
\item[Dog] A pet
\end{description}
3
8. ➕ Mathematical Typesetting
Inline Math
\( a^2 + b^2 = c^2 \)
Display Math
\[ \int_0^\infty e^{-x} dx = 1 \]
Examples
\frac{a}{b}, \sqrt{2}, a_n, x^2, x_1
\sum_{i=1}^{n} i, \lim_{x \to 0} \frac{\sin x}{x}
\alpha, \beta, \theta, \pi, \infty
9. 📊 Tables in LaTeX
\begin{tabular}{|c|c|c|}
\hline
Name & Age & Country \\
\hline
Alice & 24 & India \\
Bob & 30 & USA \\
\hline
\end{tabular}
Alignment:
• l = left, c = center, r = right
10. 🖼️ Including Images
\usepackage{graphicx}
...
\includegraphics[width=0.5\textwidth]{example-image}
You can adjust width , height , angle .
4
11. 📄 Page Layout and Customization
\usepackage[a4paper, margin=1in]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
Headers and footers:
\lhead{Left} \chead{Center} \rhead{Right}
12. 🔗 Referencing and Citations
\section{Method}\label{sec:method}
As explained in Section~\ref{sec:method}.
\cite{author2020paper}
13. 📚 Cross-references
• Use \label{} in sections, figures, and tables.
• Refer using \ref{} or \eqref{} .
14. 📦 Common Packages and Their Uses
\usepackage{amsmath, graphicx, hyperref, geometry, fancyhdr}
• amsmath : Advanced math
• graphicx : Insert images
• hyperref : Add clickable links
• geometry : Set page size and margins
• fancyhdr : Customize headers/footers
5
15. 🧾 Document Classes
\documentclass[12pt]{article}
Common classes:
• article : for short documents
• report : for theses
• book : for books
• beamer : for presentations
16. 🎞️ Presentations with Beamer
\documentclass{beamer}
\begin{document}
\begin{frame}{Welcome}
Hello, this is a slide!
\end{frame}
\end{document}
Features:
• Themes: \usetheme{Madrid}
• Blocks, alerts, math in slides
17. 🖼️ Bibliographies and BibTeX
\bibliographystyle{plain}
\bibliography{references}
Example BibTeX entry:
@article{einstein1905,
author = {Einstein, A.},
title = {On the Electrodynamics of Moving Bodies},
journal = {Annalen der Physik},
year = {1905}
}
6
18. 💡 Tips and Best Practices
• Use % for comments
• Modularize with \input{} or \include{}
• Use Overleaf for collaboration
• Always preview output frequently
19. 🧪 Practice Problems
Problem 1:
Create a document with:
• Title and author
• Two sections with a formula in each
• One list (ordered)
Problem 2:
Make a table with 3 columns (name, subject, score). Add 3 rows.
Problem 3:
Create a slide in Beamer showing:
• A bullet list
• A formula E = mc2
Problem 4:
Use BibTeX to cite a book or article.
End of Lecture Notes ✅