LaTeX Templates
Below you will find some LaTeX templates provided by other math students (click each to expand). On the right, you will find the download link for the .sty or .cls file, a sample PDF, and a download link for the .tex file which produced it. You can also click the titles to view the code directly. To submit your own template, fill out this Google form.
.sty and .cls files store personalized commands that, typically, you would copy-paste to the preamble of your .tex file. To utilize an .sty file (e.g. lecture.sty), you import it as a package (e.g. \usepackage{lecture}). A .cls file, on the other hand, acts as a document class, which is typically set to article. Thus, you write \documentclass{myclass} to implement the file myclass.cls.
Sometimes the name of the file is not the class or package it provides: check for the \ProvidesClass{…} and \ProvidesPackage{…} commands to be sure.
Lastly, make sure both files are stored in the same folder. If not, you can use the import package.
Louis - Modular Notes - 2024
\ProvidesPackage{setup}
% ! Provides all preamble
\usepackage[margin=0.15in]{geometry}
\usepackage[pagestyles]{titlesec}
\usepackage[]{csquotes}
\usepackage{amsthm}
\usepackage{amsmath,amssymb}
\usepackage{mathrsfs}
\usepackage{xfrac}
% \usepackage{libertine}
\usepackage{newpxtext}
\usepackage{newpxmath}
\usepackage{tabularx}
\usepackage{multicol}
\usepackage[shortlabels]{enumitem}
\usepackage{listings}
\usepackage{tocloft}
\usepackage{setspace}
\usepackage{cancel}
\usepackage{graphicx}
\usepackage{thmtools}
\usepackage{thm-restate}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage[ragged,multiple,flushmargin]{footmisc}
\usepackage{xcolor-solarized}
\usepackage[colorlinks, allcolors=solarized-cyan, linkcolor=darkgray]{hyperref}
\usepackage{cleveref}
\usepackage{nameref}
\usepackage{xpatch}
\usepackage{catchfile}
\usepackage{marvosym}
\usepackage{pgffor}
\usepackage{physics}
\usepackage{tikz}
% \usepackage{quiver}
% \usetikzlibrary{babel}
% \usetikzlibrary{braids}
% TODO: updates below
% ! title
% \newcommand{\thetitle}{\noindent
% \begin{center}
% \begin{tabularx}{\textwidth} {
% >{\raggedright\arraybackslash}X
% >{\raggedleft\arraybackslash}X}
% \LARGE \pageauthor \\
% \LARGE \textbf{\pagetitle} & \LARGE \textbf{\pagesubtitle}\\
% \end{tabularx}\\
% \rule[2ex]{0.8\textwidth}{1pt}
% \end{center}}
\newcommand{\thetitle}{
\noindent
% \begin{center}
\vspace*{5em}\\
{\Huge\textbf{\pagesubtitle} - \pagetitle}\\
{\small{\pagedescription}}
\vspace*{2em}\\
% \vspace*{2em}
{\small Based on lectures from \pagesemester by \pageprofessor}\\
{\small Notes by \pageauthor}
\vspace*{5em}
% \end{center}
}
% TODO
\titleformat{\section}
{\color{darkgray}\centering\normalfont\Large\bfseries}
{\color{darkgray}\thesection}{1em}{}
% Proof environment
\renewcommand*{\qedsymbol}{\(\blacksquare\)}
\renewcommand*{\proofname}{\underline{Proof}}
% % Fix issues with references
\newcommand{\getenv}[2][]{%
\CatchFileEdef{\temp}{"|kpsewhich --var-value #2"}{\endlinechar=-1}%
\if\relax\detokenize{#1}\relax\temp\else\let#1\temp\fi}
\makeatletter
\define@key{thmdef}{mdthm}[{}]{%
\thmt@trytwice{\def\thmt@theoremdefiner{\mdtheorem[#1]}}{}}
\makeatother
% Theorem environments
\declaretheorem[
% thmbox=S,
name=Remark,
refname={Remark, remark},
numberwithin=section
]{remark}
\mdfdefinestyle{example}{
roundcorner=8pt,
linewidth=2pt,
linecolor=gray!30,
leftmargin=15,rightmargin=15,
backgroundcolor=solarized-cyan!20,
skipabove=5pt, skipbelow=5pt,
innertopmargin=2pt, innerbottommargin=5pt,
innerleftmargin=8pt, innerrightmargin=8pt
% nobreak=true
}
\mdfdefinestyle{general-thm}{
roundcorner=8pt,
linecolor=white,
leftmargin=5,rightmargin=5,
backgroundcolor=gray!10,
skipabove=10pt, skipbelow=10pt,
innertopmargin=2pt, innerbottommargin=5pt,
innerleftmargin=8pt, innerrightmargin=8pt,
nobreak=true
}
\declaretheorem[mdthm={style=general-thm}, title=\textcolor{solarized-red}{$\hookrightarrow$ \underline{Theorem}}, numberwithin=section]{theorem}
\declaretheorem[mdthm={style=general-thm}, title=\textcolor{solarized-orange}{$\hookrightarrow$ \underline{Corollary}}, numberwithin=section]{corollary}
\declaretheorem[mdthm={style=general-thm}, title=\textcolor{solarized-magenta}{$\hookrightarrow$ \underline{Proposition}}, numberwithin=section]{proposition}
\declaretheorem[mdthm={style=general-thm}, title=\textcolor{solarized-orange}{$\hookrightarrow$ \underline{Lemma}}, numberwithin=section]{lemma}
\declaretheorem[mdthm={style=general-thm}, title=\textcolor{solarized-orange}{$\hookrightarrow$ \underline{Axiom}}, numberwithin=section]{axiom}
\declaretheorem[mdthm={style=general-thm}, title=\textcolor{solarized-blue}{$\hookrightarrow$ \underline{Definition}}, numberwithin=section]{definition}
\declaretheorem[mdthm={style=general-thm}, title=\textcolor{solarized-blue}{$\hookrightarrow$ \underline{Question}}, numberwithin=section]{question}
% \declaretheorem[mdthm={style=general-thm}, numberwithin=section]{theorem}
\mdtheorem[style=example]{example}{$\circledast$ \underline{Example}}[section]
% \mdtheorem[style=general-thm]{theorem}{\textcolor{solarized-red}{$\hookrightarrow$ \underline{Theorem}}}[section]
% \mdtheorem[style=general-thm]{proposition}{\textcolor{solarized-magenta}{$\hookrightarrow$ \underline{Proposition}}}[section]
% \mdtheorem[style=general-thm]{corollary}{\textcolor{solarized-orange}{$\hookrightarrow$ \underline{Corollary}}}[section]
% \mdtheorem[style=general-thm]{lemma}{\textcolor{solarized-orange}{$\hookrightarrow$ \underline{Lemma}}}[section]
% \mdtheorem[style=general-thm]{axiom}{\textcolor{solarized-orange}{$\hookrightarrow$ \underline{Axiom}}}[section]
% \mdtheorem[style=general-thm]{definition}{\textcolor{solarized-blue}{$\hookrightarrow$ \underline{Definition}}}[section]
% \mdtheorem[style=general-thm]{question}{\textcolor{solarized-blue}{$\hookrightarrow$ \underline{Question}}}[section]
% fixes broken references
% \newcommand{\thmautorefname}{Theorem}
% \makeatletter
% \xpatchcmd{\theorem}{\refstepcounter}{\NR@gettitle{#1}\refstepcounter}{}{}
% \makeatother
% \newcommand{\propautorefname}{Proposition}
% \makeatletter
% \xpatchcmd{\proposition}{\refstepcounter}{\NR@gettitle{#1}\refstepcounter}{}{}
% \makeatother
% \newcommand{\axiomautorefname}{Axiom}
% \makeatletter
% \xpatchcmd{\axiom}{\refstepcounter}{\NR@gettitle{#1}\refstepcounter}{}{}
% \makeatother
% \newcommand{\corrautorefname}{Corollary}
% \makeatletter
% \xpatchcmd{\corollary}{\refstepcounter}{\NR@gettitle{#1}\refstepcounter}{}{}
% \makeatother
% \newcommand{\lemmaautorefname}{Lemma}
% \makeatletter
% \xpatchcmd{\lemma}{\refstepcounter}{\NR@gettitle{#1}\refstepcounter}{}{}
% \makeatother
% makes "quoted" text actually look correct
\MakeOuterQuote{"}
% page footer
\newpagestyle{mypage}{%
% \footrule
\setfoot{\scriptsize\textcolor{gray}{§\ref{\thesubsection}}}{\scriptsize\textcolor{gray}{\textit{{\scshape\sectiontitle}: \textbf{\subsectiontitle}}}}{\textcolor{gray}{\scriptsize p. \thepage}}
}
\titleformat{\section}
{\Large\bfseries\scshape}
{\thesection}{1em}{}
\renewcommand{\contentsname}{\bfseries\scshape\Large Contents}
Louis - Assignment - 2024
% ! Features
% ! qs, subqs, ans environment
% ! \qt and \subqt commands, auto label question
% ! eg \cref{q:1} will print "question 1"
\RequirePackage{amsmath,amssymb,amsthm,mathtools, mdframed, hyperref, cleveref, xparse,enumitem}
\crefname{questionref}{question}{questions}
% \creflabelformat{questionref}{#1 #2#3}
\newenvironment{ans}{
\begin{mdframed}
\begin{proof}}
{
\end{proof}
\end{mdframed}
}
% subquestion
\newenvironment{subqs}{
\begin{enumerate}[label=\textbf{\alph*)}]
}{
\end{enumerate}
}
\newcommand{\qt}[2][\value{enumi}+1]{
% new page if not on question 1
\ifnum\value{enumi}>0
\newpage
\fi
\setcounter{enumi}{#1 - 1}
% display question number, and automatically label it
\item \label[questionref]{q:\arabic{enumi}} \textit{#2}
}
\newcommand{\subqt}[2][1]{
% new page if not on question 1
% \ifnum\value{enumii}>0
% \newpage
% \fi
% \setcounter{enumii}{#1 - 1}
% display question number, and automatically label it
\item \label[questionref]{q:\arabic{enumi}.\alph{enumii}} \textit{#2}
}
% \newcommand{\subqt}{
% \item \label[question]{q:\arabic{enumi}\alph{enumii}}
% }
Nicholas - Lectures/Assignments - 2024
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{hayektex}[2024/04/25]
%OPTIONS{
\DeclareOption{center}{\newcommand{\@wantscenter}{}}
\DeclareOption{copyright}{\newcommand{\@copyright}{}}
\DeclareOption{authhead}{\newcommand{\@authhead}{}}
\DeclareOption{toc}{\newcommand{\@toc}{}}
\DeclareOption{title}{\newcommand{\@titpage}{}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
%}
\DeclareRobustCommand{\smallcaps}[1]{\scshape{#1}}
\LoadClass[letterpaper,11pt]{article}
%PACKAGES{
\RequirePackage{geometry}
\RequirePackage{ifthen}
\ifthenelse{\isundefined{\@wantscenter}}{\geometry{verbose,letterpaper,top=1.45in,bottom=1.35in,left=1.15in,right=2in,asymmetric,twoside}}{\geometry{verbose,letterpaper,top=1.45in,bottom=1.35in,left=1.25in,right=1.25in,asymmetric,twoside}}
\RequirePackage[widermath,narrowiints,fullsumlimits,fullintlimits]{kpfonts}
\RequirePackage[dvipsnames]{xcolor}
\RequirePackage{tikz}
\RequirePackage{pgfplots}
\RequirePackage{graphicx}
\RequirePackage{empheq}
\RequirePackage[framemethod=TikZ, xcolor]{mdframed}
\RequirePackage{fancyhdr}
\RequirePackage{mathdots}
\RequirePackage{microtype}
\RequirePackage{stmaryrd}
\RequirePackage{titlesec}
\RequirePackage[titles]{tocloft}
\RequirePackage{textcase}
\RequirePackage{setspace}
\RequirePackage{xfrac}
\RequirePackage{mathtools}
\RequirePackage{faktor}
\RequirePackage{cancel}
\RequirePackage{mparhack}
\RequirePackage{booktabs}
\RequirePackage{multirow}
\RequirePackage{csquotes}
\RequirePackage{epigraph}
\RequirePackage{fontawesome}
\DeclareMathAlphabet{\bignum}{U}{BOONDOX-ds}{m}{n}
\newcommand{\1}{\bignum{1}}
\newcommand{\0}{\bignum{0}}
\RequirePackage{amsfonts}
\RequirePackage{amsthm}
\RequirePackage{amsxtra}
\RequirePackage{amssymb}
\RequirePackage{amsmath}
\RequirePackage{mathrsfs}
\RequirePackage[colorlinks,linkcolor=black,urlcolor=black,citecolor=black]{hyperref}
%}
%SECTION FORMATTING{
\renewcommand{\@author}{}
\newcommand{\@email}{}
\newcommand{\email}[1]{\renewcommand{\@email}{#1}}
\newcommand{\subtitle}[1]{\newcommand{\@subtitle}{#1}}
\renewcommand{\author}[1]{\renewcommand{\@author}{#1}}
\newcommand{\note}[1]{\newcommand{\@note}{#1}}
\titleformat{\section}{\relax\centering\large\lsstyle}{}{0.5em}{\otherscshape\MakeLowercase}
\titleformat{\subsection}{\relax\centering}{}{1em}{\large\itshape}
\titleformat{\subsubsection}{\relax}{}{0em}{\normalsize\textbf}
\titleformat{\paragraph}[runin]{}{}{}{\normalsize\smallcaps}
\newcommand{\@curpart}{}
\let\oldpart\part
\renewcommand{\part}[1]{\oldpart{#1}\renewcommand{\@curpart}{#1}}
\renewcommand{\cftsecfont}{}
\setcounter{secnumdepth}{-1}
\setcounter{tocdepth}{3}
%}
%TEXT MACROS{
\renewcommand{\\}{\par\vspace{1.5ex}\noindent}
\newcommand{\runin}[1]{\textls[50]{\otherscshape #1}}
\newcommand{\say}[1]{\margintext{\runin{#1}}}
\newcommand{\margintext}[1]{\marginpar{\setstretch{.8}\upshape{\footnotesize{#1}}}}
%}
%TITLE PAGE AND TOC{
\renewcommand{\maketitle}{
\newgeometry{left=2in,right=2in}
\begin{center}
\rule{10cm}{0.4pt}\vspace{1cm}\\
\large{\smallcaps{\textls[150]{\MakeUppercase{\@title}}}}
\ifthenelse{\isundefined{\@subtitle}}{}{{\vskip 1.5ex\large\smallcaps{\textls[100]{\protect\MakeLowercase{\protect\otherscshape{\@subtitle}}}}}}
\ifthenelse{\isundefined{\@author}}{}{{\vskip 1.5ex\large\smallcaps{\textls[100]{\protect\MakeLowercase{\protect\otherscshape{\@author}}}}}}
\ifthenelse{\isundefined{\@note}}{}{{\vskip 2.5ex\textit{\@note}}}
\\\vspace{2.5ex}\rule{3.5cm}{0.4pt}
\newpage
\end{center}
\restoregeometry
}
\AtBeginDocument{
\pagenumbering{gobble}
\ifthenelse{\isundefined{\@titpage}}{}{\maketitle}
\ifthenelse{\isundefined{\@toc}}{}{\newgeometry{left=2in,right=2in}\tableofcontents
\ifthenelse{\isundefined{\@copyright}}{}{\vspace{\fill}\\\textcopyright \; \@author\; \the\year{} \;\; \href{mailto:\@email}{\faEnvelopeO}}\restoregeometry\newpage
}
\pagenumbering{arabic}
\pagestyle{fancy}
\\
}
%}
%HEADERS{
\cfoot{}
\fancyhead[LE]{\smallcaps\@title}
\fancyhead[RE]{\smallcaps\thepage}
\ifthenelse{\isundefined{\@authhead}}{
\fancyhead[RO]{\smallcaps\protect\MakeLowercase{\protect\textls[70]{\@curpart}}}
}{
\fancyhead[RO]{\smallcaps\protect\MakeLowercase{\protect\textls[70]{\@author}}}
}
\fancyhead[LO]{\smallcaps\thepage}
%}
%ENVIORNMENTS{
\newcommand{\@theoremcolor}{Maroon}
\newcommand{\theoremcolor}[1]{\renewcommand{\@theoremcolor}{#1}}
\mdfdefinestyle{theorem}{
roundcorner=10pt,
linewidth=2pt,
backgroundcolor=\@theoremcolor!10,
linecolor=\@theoremcolor}
\mdfdefinestyle{proof}{
roundcorner=5pt,
linewidth=0pt,
backgroundcolor=gray!10}
\newenvironment{theorem}{\begin{mdframed}[style=theorem]}{\end{mdframed}}
\renewenvironment{proof}[1][]{\say{\vspace{.4cm}\\Proof#1.}\begin{mdframed}[style=proof]}{\qed\end{mdframed}}
\newenvironment{proofn}[1][]{\say{\vspace{.4cm}\\Proof#1.}\begin{mdframed}[style=proof]}{\end{mdframed}}
%}
Léo - Assignment - 2013
%SUMS Template for assignments.-2013
\documentclass[letterpaper, 11pt]{article}
\usepackage{amsmath, amssymb, amsfonts}%math
\usepackage{mathtools}
\usepackage[left=1.5in,right=1.5in]{geometry}%margins
\usepackage{setspace}%change space settings
\usepackage[utf8x]{inputenc}%ASCII characters
\usepackage[T1]{fontenc}
\usepackage{lmodern}%for accentuated characters and accents
\usepackage{graphicx}%inserting pdf-jpg pictures
\usepackage{enumerate}%changing enumerate
\usepackage[natural, dvipsnames, pdftex]{xcolor}
\usepackage{tikz} %Drawing pretty pictures
\usepackage{verbatim} %adding code
\setlength{\parindent}{0pt}%No spacing at beginning of paragraph
\usepackage[pdftex, colorlinks=true]{hyperref}%Hyperlinks, with \href
\hypersetup{urlcolor=RoyalBlue, linkcolor=RedOrange, citecolor=black}
%Playing around with formatting- ex with section
%\titleformat{\section}[block]{\sffamily}
%{\color{Blue} \centering \Large Chapter \thesection}{0pt}{\linebreak
%\color{Blue} \Large \centering}
%\usepackage{makeidx}
\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{n} %mathpzc alphabet
\usepackage[mathscr]{eucal} %mathscr alphabet
%-------------Additional material
%Change section headings
\usepackage[calcwidth, sc, medium, center, compact]{titlesec}
%Redefine theorem environments
\usepackage[amsmath, thref, thmmarks, hyperref]{ntheorem}
%Redefining theorem style
\theoremstyle{break}
\theoremheaderfont{\bf}
\theorembodyfont{\normalfont}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{cor}[theorem]{Corollary}
\newtheorem{prop}[theorem]{Proposition}
\newtheorem*{claim}{Claim}
\newtheorem*{sol}{Solution}
\newtheorem{defn}[theorem]{Definition}
\newtheorem{ex}{Example}[section]
\newtheorem*{remark}{Remark}[section]
\newtheorem*{obs}{Observation}[section]
\newtheorem*{note}{Note}[section]
\renewcommand{\Box}{\rule{1. 5ex}{1.5ex}} % end of proof
\newenvironment*{proof}{\par\noindent{\normalfont{\bf{Proof.
}}}}{\hfill \small$\blacksquare$\\[2mm]}
%Counter for equations according to section: 1.2 vs
%\renewcommand{\theequation}{\thesection.\arabic{equation}}
%Some examples of new commands
%To define your commands, use \newcommand or \renewcommand if it already exist
\renewcommand{\emph}[1]{\textbf{#1}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\E}[1]{{\mathrm E}\left(#1\right)}
\newcommand{\bs}[1]{\boldsymbol {#1}}
\newcommand{\Ra}{\Rightarrow}
\newcommand{\limni}{\lim_{n \ra \infty}}
\renewcommand{\iff}{\Leftrightarrow}
\newcommand{\all}{ \; \forall \;}
\newcommand{\eps}{\varepsilon}
\newcommand{\I}[1]{{\mathbf 1}_{(#1)}}
\newcommand{\Perp}{\perp \! \! \! \perp}
\relpenalty=9999 %Penalty for widow and orphan
\binoppenalty=9999
\usepackage{verbments}%fancy verbatim
\usepackage{enumerate}%allow to change the spacing of enumerate
\usepackage[shortlabels]{enumitem}
\setlist{nolistsep,leftmargin=0.1cm,itemindent=0.4cm}
\allowdisplaybreaks
\newcommand{\createHeader}[4]{
\framebox{
\begin{minipage}{0.5\textwidth}
\begin{flushleft}
Pr. #1 \\ \textsf{#2} - MATH #3
\end{flushleft}
\end{minipage}
\begin{minipage}{0.49\textwidth}
\begin{flushright}
Name, Student ID\\
Assignment #4
\end{flushright}
\end{minipage}
}\linebreak
}
\begin{document}
\createHeader{PROF NAME}{COURSE NAME}{COURSE CODE}{AS NUM - due
DUE DATE}\vspace{5pt}
\begin{enumerate}%[(a)]
\item text here
\end{enumerate}
\end{document}