A LaTeX template for writing mathematics and computer science lecture notes. Built on the AMS Book class with theorem environments, figures, algorithms, commutative diagrams and bibliography support.
This repository provides a complete Real Analysis example project with 3 chapters, an appendix, and bibliography demonstrating every feature, plus a clean reusable template inside template/ for starting your own projects.
git clone https://github.com/devesh8090/math-notes-template-latex.git MyMathNotes
cd MyMathNotes/templateEdit notes.tex and start writing chapters.
math-notes-template/
notes.tex main document (metadata, chapter includes)
notes-preamble.sty shared style file (macros, formatting)
refs.bib bibliography
chapters/ chapter content (.tex files)
images/ figure files
assets/ README screenshots (not in the document)
template/ clean starter template for new projects
README.md
Fill in metadata at the top of notes.tex. Fields left as {} are hidden.
\notestitle{Real Analysis Lecture Notes}
\notesauthor{Your Name}
\notesemail{[email protected]}
\noteswebsiteone{https://github.com}
\notesversion{v1.0 \today}
\notespreamble{A short description of these notes.}Generated automatically. Chapters, sections and subsections appear; subsubsections are numbered but hidden from the ToC.
Eight environments are predefined. Theorem, Proposition, Lemma, Corollary, Definition and Example share a single counter reset per section. Remark and Notation are unnumbered.
\begin{theorem}[Intermediate Value Theorem]
\label{theorem:ivt}
Let $f\colon[a,b]\to\R$ be continuous with $f(a)<0<f(b)$.
Then there exists $c\in(a,b)$ with $f(c)=0$.
\end{theorem}Reference with \cref{theorem:ivt} which produces "Theorem 3.1.1" or \Cref{theorem:ivt} for a capital start. Label prefixes follow environment names: theorem:, proposition:, lemma:, corollary:, definition:, example:.
Custom environments are supported:
\createtheorem[numbered]{axiom}{Axiom}
\createtheorem[unnumbered]{claim}{Claim}Place images in images/ and use the convenience macros. Figures are numbered per section (Figure 2.1, 2.2, ...).
\figone{0.6\textwidth}{images/foo.png}{Caption.}{fig:label}
\figtwo{images/a.png}{images/b.png}{Cap A}{Cap B}{fig:a}{fig:b}
\figtwoshared{images/a.png}{images/b.png}{One caption.}{fig:both}
\figthree{images/a.png}{images/b.png}{images/c.png}
{Cap A}{Cap B}{Cap C}{fig:a}{fig:b}{fig:c}
\figfour{{images/a.png}{Cap A}{fig:a}}{{images/b.png}{Cap B}{fig:b}}
{{images/c.png}{Cap C}{fig:c}}{{images/d.png}{Cap D}{fig:d}}The algorithm float with a thin algobox frame. Numbered per section.
\begin{algorithm}[H]
\caption{Bisection Method}
\label{alg:bisection}
\begin{algobox}
\begin{algorithmic}[1]
\Require continuous $f$ on $[a,b]$ with $f(a)f(b)<0$, tolerance $\varepsilon$
\Ensure $c$ with $|f(c)|$ small and $|b-a|<\varepsilon$
\While{$b-a>\varepsilon$}
\State $c\gets(a+b)/2$
\If{$f(a)\cdot f(c)<0$}
\State $b\gets c$
\Else
\State $a\gets c$
\EndIf
\EndWhile
\State \Return $(a+b)/2$
\end{algorithmic}
\end{algobox}
\end{algorithm}The tikz-cd package is loaded and ready to use.
\[
\begin{tikzcd}
\Q \arrow[r, hook] \arrow[dr, "\text{incl.}"'] & \R \\
& \Q \arrow[u, hook]
\end{tikzcd}
\]BibTeX with amsalpha.bst style. Citations produce compact keys like [Rud76].
\cite{key} % inline citation
\footcite{key} % citation in a footnoteOpen template/notes.tex and fill in the fields:
\notestitle{Your Notes Title}
\notesauthor{Your Name}
\notesemail{[email protected]}
\notespreamble{A short description.}Create .tex files in chapters/. Start with \section{} and use the theorem environments. No preamble needed.
\section{My Section}
\begin{definition}
A widget is a ...
\end{definition}
\begin{theorem}
Every widget is frobnicated.
\end{theorem}In notes.tex, add a block for each chapter:
\chapter{Chapter Title}
\chapterdesc{One-sentence description.}
\input{chapters/your_file}- Place figures in
images/and use\figone,\figtwo, etc. - Add citations to
refs.biband use\cite{key}or\footcite{key}. - Use
\begin{algorithm}[H]with analgoboxfor algorithms. - Use
tikzcdenvironments for commutative diagrams.
| Element | Format | Resets At |
|---|---|---|
| Chapter | 1, 2, 3 | Never |
| Section | 2.1, 3.4 | Each chapter |
| Subsection | 2.1.3 | Each section |
| Subsubsection | 2.1.3.4 | Each subsection |
| Theorem, Proposition, Lemma, Corollary, Definition, Example | 2.1.5 | Each section (shared counter) |
| Remark, Notation | unnumbered | None |
| Figures | 2.1, 2.2 | Each section |
| Algorithms | 2.1, 2.2 | Each section |
| Equations | (1), (2), (3) | Global |
Upload the folder as a new project. Set compiler to pdfLaTeX and main file to notes.tex.
pdflatex notes.tex
bibtex notes
pdflatex notes.tex
pdflatex notes.texRun all four the first time and whenever you add citations or new sections. After that, one pdflatex notes.tex is usually enough.
| Category | Commands |
|---|---|
| Number sets | \R \Z \Q \C \N \F |
| Font shortcuts | \cali{C} \got{g} \mbb{R} \scr{F} |
| Common symbols | \eqdef \defeq \mto \dd \pd{f}{x} \ppd{f}{x}{y} \wt{x} \wh{x} |
| Delimiters | \abs{x} \norm{x} \ip{x}{y} \set{x} |
| Operators | \im \rank \Span \supp \diam \dist \Int \Ext \cl \interior \bd \codim \coker \Hom \End \Aut \Inn \Ad \ad \GL \SL \sgn \grad \divg \curl \esssup \essinf |
| Draft | \todo{note} |
| Footnote cite | \footcite{key} |
- Add
onesideto avoid blank pages:\documentclass[11pt,oneside]{amsbook}. - All headings are left-aligned and minimal.
- The compiled
notes.pdfis committed so readers can view the output without LaTeX.





