CopyPasta
\documentclass[twoside,12pt]{article}
% Set some margins (columnsep is used just for 2-col layouts) and
% the paper size.
\usepackage[letterpaper, margin=1in, columnsep=0.5in]{geometry}
% Set up fonts. Use the Bembo-for-poor-people typeface for text, Libertine
% for Math equations and Inconsolata for monospace (you cannot use anything
% else with pdfLatex). Note the number styling (`osf`).
\usepackage[T1]{fontenc}
\usepackage[expansion=false]{microtype}
\usepackage[p,osf]{fbb}
\usepackage{libertinust1math}
\usepackage{amsmath, amsfonts, amsthm}
\usepackage{inconsolata}
% Other packages
\usepackage[hang,flushmargin]{footmisc}
\usepackage[labelfont=bf, textfont=it]{caption}
\usepackage{adjustbox}
\usepackage{blindtext}
\usepackage{color,soul}
\usepackage{float}
\usepackage{framed}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{multicol}
\usepackage{needspace}
\usepackage{tikz}
\usepackage{titling}
\usepackage{xfp}
% References. Managed by BibLaTeX with Biber as the backend for APA, MLA, etc.
% Hyperref will make the citations clickable.
\usepackage[style=alphabetic,backend=biber]{biblatex}
% =============================================================
% Customize maketitle
\pretitle{\begin{center}\Huge} \posttitle{\end{center}}
\preauthor{\begin{center}\Large\rmfamily} \postauthor{\end{center}}
\predate{\begin{center}\small} \postdate{\end{center}}
% Patch Tabular to use monospaced font for the tables
\AtBeginEnvironment{tabular}{\sffamily}
% Add circles to things. Good for inline lists. \circled{1}, for example.
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{\node[shape=circle,draw,inner sep=1pt] (char) {#1};}}
% Caption setup. Make the labels smallcaps and bold. Make the entire font size
% smaller. Rename the figure and table names.
\captionsetup{
labelfont={bf,small,sc},
textfont=small,
labelsep=period,
figurename=FIGURE,
tablename=TABLE
}
% Set some margins, set the typeface, do not indent paragraphs,
% adjust paragraph line heights.
\setlength{\parindent}{0em}
\setlength{\parskip}{0.75em}
% Customize footnotes
\setlength{\footnotesep}{\baselineskip}
\setlength{\footnotemargin}{0.75em}
\setlength{\skip\footins}{1em}
% Independent sign
\newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}}
\def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}}
% Header and footer
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\color{lightgray}\fontsize{8pt}{1em}\selectfont\uppercase{Clinical Epidemiology}}
\fancyhead[C]{\color{lightgray}\fontsize{8pt}{1em}\selectfont{Fall 2025}}
\fancyhead[R]{\color{lightgray}\fontsize{8pt}{1em}\selectfont\thepage}
% \fancyfoot[R]{\color{lightgray}\fontsize{8pt}{1em}\selectfont\thepage}
\renewcommand{\headrulewidth}{0pt}
% Add bibliography
% \addbibresource{References.bib}
% =============================================================
\begin{document}
\raggedbottom
\title{Constructing a Nuclear Reactor Using Only Coconuts}
\author{Nikhil Anand}
\date{Submitted \today}
\maketitle
% \begin{center}
% {\LARGE \textbf{Hello World!}}\\[0.75em]
% {\large Nikhil Anand (\texttt{NA3213})}\\[0.5em]
% {\small Submitted \today}\\[0.5em]
% \end{center}
% \vspace{0.125em}
% \noindent\rule{\columnwidth}{0.25pt}
% \vspace{0.0625em}
% =============================================================
% Here be content... Here's some Lipsum
\blindtext\blindtext
\blindtext\blindtext
\blindtext\blindtext
\blindtext\blindtext
\blindtext\blindtext
\blindtext\blindtext
\blindtext\blindtext
% =============================================================
% \printbibliography
\end{document}
Other Stuff
Equations
Refer to Equations with \eqref{}
% Equation. Entire block numbered.
\begin{equation}
\begin{aligned}
E & = mc^2 \\
\implies E & = \sum_{x=2}^{\infty}\frac{y^x}{x!} \\
F & = ma \\
F & = ma \\
\end{aligned}
\end{equation}
% Equation. Selective labeling.
\begin{align}
E & = mc^2 \label{eq:einstein} \\
F & = ma \nonumber \\
pV & = nRT \label{eq:ideal_gas}
\end{align}
Tables
Refer to tables with \ref{}
% Tables with cell padding (vertical)
% Use \newline to break content in cells
\renewcommand{\arraystretch}{1.5} % default is 1.0
\begin{table}[h!]
\centering
\begin{tabular}{|l c |r|}
% \begin{tabular}{|p{0.3\textwidth}|p{0.3\textwidth}|p{0.3\textwidth}|}
\hline
Constant & Symbol & Value \\
\hline
Speed of light & $c$ & $3.00 \times 10^8 \,\text{m/s}$ \\
Gravitational constant & $G$ & $6.67 \times 10^{-11} \,\text{N m}^2/\text{kg}^2$ \\
Planck constant & $h$ & $6.63 \times 10^{-34} \,\text{J s}$ \\
\hline
\end{tabular}
% Label should go right after Caption!
\caption{Physical constants used in the experiments}
\label{tab:constants}
\end{table}
Images/Figures
\begin{figure}[H]
\centering
\includegraphics[width=0.95\textwidth]{figure.png}
\caption{\small Kaplan-Meier Curve showing the Cumulative Probability of Death in Control and Treatment Groups}
\label{fig:km1}
\end{figure}
To rotate,
\usepackage{rotating}
\begin{sidewaysfigure}
\centering
\includegraphics[width=\textwidth]{figure.png}
\caption{Sideways figure}
\end{sidewaysfigure}
Live Math
\fpeval{round(exp(-0.997), 3)}
\def\radius{5}
\def\area{\fpeval{pi * \radius^2}}
\def\diameter{\fpeval{2 * \radius}}
Diameter is \diameter
Colors
% Define a custom color anywhere and use it.
\definecolor{mygreen}{HTML}{3FA722}
\textcolor{mygreen}{Lolzilla!}
% Or use a standard color:
% black, blue, brown, cyan, darkgray, gray, green, lightgray, lime,
% magenta, olive, orange, pink, purple, red, teal, violet, white, yellow
\textcolor{pink}{Pretty pretty pink}
Typefaces
% Use Libertine for both text and equations. Note the packages required above.
\usepackage[T1]{fontenc}
\usepackage{libertinus}
\usepackage{libertinust1math}
% Use the sans-serif variant of a typeface.
\renewcommand{\familydefault}{\sfdefault}
Boxes
% Put a nice box around something
\begin{framed}
\blindtext
\end{framed}
Double Spacing
\usepackage{setspace}
\begin{document}
\doublespacing
\end{document}
Text Highlighting
\usepackage{color,soul}
\hl{foo}
\hl{\textbf{foo}}
\textcolor{red}{foo}
\textbf{\textcolor{red}{\hl{foo}}}
\textcolor{red}{\textbf{\hl{foo}}}
Multiple Columns
Use multicol for more flexibility. Showing with lipsum text from blindtext. Note that multicol* means that it won't balance content across columns.
\usepackage{blindtext}
\begin{multicols*}{2}
\raggedcolumns
\blindtext\blindtext
\end{multicols*}
If you see the package pushing things around, try this before some block:
\needspace{8\baselineskip}
\begin{framed}
"My mama always said life was like a box of chocolates. You never know what you're gonna get."
\\\\
-- \small{Forrest Gump}
\end{framed}
Coffee Stains
\usepackage{coffeestains}
% Comes in 4 flavors: A B C D
% Syntax: \coffeestainA{alpha}{scale}{angle}{xoff}{yoff}
% Docs: https://ctan.math.illinois.edu/graphics/pgf/contrib/coffeestains/coffeestains-en.pdf
\coffeestainA{0.9}{0.85}{-25}{5cm}{1.3cm}
\coffeestainB{0.7}{1}{-30}{18 pt}{-135 pt}
\coffeestainC{1}{1}{180}{0}{-5 mm}
\coffeestainD{0.4}{0.5}{90}{3 cm}{4 cm}