LaTeX lecture notes template
A LaTeX lecture notes template for a course handout, with numbered theorem environments and one section per lecture.
- Engine: pdfLaTeX
- License: Public domain, use freely.
Open in LaTeX.to Download all files (zip)
Files:
main.tex
\documentclass[11pt,a4paper]{article}
\usepackage[margin=2.5cm,headheight=14pt]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}
\usepackage{fancyhdr}
\usepackage{hyperref} % keep hyperref last
% All of these share one counter, so the numbering runs 1.1, 1.2, 1.3 through
% a section whatever kind of block comes next.
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\newtheorem{example}[definition]{Example}
\theoremstyle{plain}
\newtheorem{theorem}[definition]{Theorem}
\newtheorem{lemma}[definition]{Lemma}
\theoremstyle{remark}
\newtheorem{remark}[definition]{Remark}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{Course 101}
\fancyhead[R]{Lecture Notes}
\fancyfoot[C]{\thepage}
% Course, lecturer and term.
\title{Course 101: Introduction to Real Analysis \\ Lecture Notes}
\author{Your Name \\ University of Somewhere}
\date{Fall Term}
\begin{document}
\maketitle
\thispagestyle{fancy}
\tableofcontents
\newpage
\section{Lecture 1: Sequences and Limits}
A sequence is an infinite list of real numbers $a_1, a_2, a_3, \dots$, written
$(a_n)$. The whole of this lecture is about one question: what it means for
such a list to settle down on a value.
\begin{definition}[Convergence]
A sequence $(a_n)$ converges to $L \in \mathbb{R}$ if for every
$\varepsilon > 0$ there is an $N \in \mathbb{N}$ such that
\begin{equation} \label{eq:convergence}
|a_n - L| < \varepsilon \quad \text{for all } n \ge N .
\end{equation}
We write $\lim_{n \to \infty} a_n = L$, or $a_n \to L$.
\end{definition}
Read \eqref{eq:convergence} as a game: your opponent names a tolerance
$\varepsilon$, and you have to name a point $N$ in the sequence beyond which
every term is within that tolerance of $L$. Figure~\ref{fig:neighborhood}
shows the picture on the number line.
\begin{figure}[htbp]
\centering
\begin{tikzpicture}
\draw[->] (-0.5,0) -- (8.5,0) node[right] {$\mathbb{R}$};
\foreach \x/\lbl in {2/{L - \varepsilon}, 4/{L}, 6/{L + \varepsilon}} {
\draw (\x,0.15) -- (\x,-0.15) node[below] {$\lbl$};
}
\fill (4,0) circle (1.6pt);
\draw[very thick] (2,0.5) -- (6,0.5);
\node[above] at (4,0.55) {$a_n$ for every $n \ge N$};
\end{tikzpicture}
\caption{Beyond the index $N$, the whole tail of the sequence lies inside
the band of width $2\varepsilon$ around $L$.}
\label{fig:neighborhood}
\end{figure}
\begin{example}
The sequence $a_n = 1/n$ converges to $0$. Given $\varepsilon > 0$, choose
any $N$ larger than $1/\varepsilon$. Then for $n \ge N$ we have
$|1/n - 0| = 1/n \le 1/N < \varepsilon$.
\end{example}
\begin{theorem}[Uniqueness of the limit]
A sequence has at most one limit.
\end{theorem}
\begin{proof}
Suppose $a_n \to L$ and $a_n \to M$ with $L \neq M$. Take
$\varepsilon = |L - M| / 2$. Beyond some index every term is within
$\varepsilon$ of $L$, and beyond some other index every term is within
$\varepsilon$ of $M$. Past both indices a single term is within
$\varepsilon$ of each, so $|L - M| < 2\varepsilon = |L - M|$, which is
impossible.
\end{proof}
\begin{remark}
The definition never mentions how fast the terms approach $L$. Convergence
is about what happens in the end, so changing finitely many terms of a
sequence changes neither whether it converges nor what it converges to.
\end{remark}
\section{Lecture 2: Continuity}
Continuity is the same idea moved from a sequence to a function: small changes
in the input are to make only small changes in the output.
\begin{definition}[Continuity at a point]
A function $f : \mathbb{R} \to \mathbb{R}$ is continuous at $c$ if for every
$\varepsilon > 0$ there is a $\delta > 0$ such that $|x - c| < \delta$
implies $|f(x) - f(c)| < \varepsilon$.
\end{definition}
\begin{lemma}[Sequential criterion]
$f$ is continuous at $c$ if and only if $f(a_n) \to f(c)$ for every sequence
$(a_n)$ with $a_n \to c$.
\end{lemma}
This lemma is the reason Lecture 1 came first: it turns every question about
continuity into a question about sequences, so every result about limits of
sums and products carries straight over.
\begin{theorem}[Extreme value theorem]
A continuous function on a closed bounded interval $[a, b]$ attains a
largest and a smallest value on that interval.
\end{theorem}
\begin{example}
The function $f(x) = 1/x$ attains no largest value on the open interval
$(0, 1)$. The interval is bounded but not closed, so the theorem does not
apply, which shows the hypothesis is doing real work.
\end{example}
\begin{remark}
Next lecture: uniform continuity, and why $f(x) = x^2$ is continuous
everywhere but not uniformly continuous on the whole real line.
\end{remark}
\end{document}
How to use this template
Everything runs in your browser: nothing to install, no login, no compile timeout.
- Click Open in LaTeX.to. The template opens as a project in the Projects pane, with main.tex in the editor and its finished PDF in the preview.
- Click Preview, or press Ctrl+Enter (Cmd+Enter on a Mac), to compile. The preview shows the new PDF; you do not need to save first.
- If the compile fails, the Console pane opens with the LaTeX log. The first error in it says what went wrong and on which line.
- To add an image, a .bib file or another .tex file, open the project's menu (the three dots next to its name in the Projects pane) and choose Upload file or New file.
- The arrow next to Preview has Download PDF. Ctrl+S saves your edits, and the project stays in your browser on this device.
How to add a lecture
Each lecture is a \section, and the numbering of definitions and theorems restarts with it.
- Add
\section{Lecture 3: Differentiation}after the end of lecture 2 and write below it. - Definitions, theorems, lemmas, examples and remarks share one counter per section, so the third block in lecture 3 is 3.3 whatever kind it is.
- The table of contents at the top lists the new lecture on the next compile.
How to keep one file per lecture
A term of notes gets long, and a file per lecture keeps main.tex short.
- In the Projects pane, open the project's menu, choose New file and name it
lecture-03.tex. - Put the
\sectionand everything under it in that file, with no preamble and no\begin{document}. - In
main.tex, put\input{lecture-03}where the lecture belongs, one line per file. - To compile a single lecture, put
%in front of the other\inputlines; the section numbers then start from 1.
How to state a theorem with a proof
The environments for the blocks are set up at the top of the file.
- Write
\begin{theorem}[Name of the theorem]and\end{theorem}around the statement; the name in brackets is optional. - Put the proof between
\begin{proof}and\end{proof}, which ends it with the square. - Give the block a
\label{thm:name}on its first line and refer to it withTheorem~\ref{thm:name}.
More templates: Exam and all templates.