Skip to content

Instantly share code, notes, and snippets.

@phrz
Last active May 5, 2018 17:47
Show Gist options
  • Save phrz/2484b53a111d43655ed5c6c052c45da6 to your computer and use it in GitHub Desktop.
Save phrz/2484b53a111d43655ed5c6c052c45da6 to your computer and use it in GitHub Desktop.
% !TEX TS-program = XeLaTeX
% DOCUMENT FORMATTING
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{fullpage}
\usepackage{fancyhdr} % better looking title
\usepackage[all]{nowidow}
% MATH FORMATTING
\usepackage{amsmath}
\usepackage{amssymb} % \varnothing \nexists \therefore
\usepackage{mathtools} % allows \xrightarrow{over-text}
% TEXT FORMATTING
\usepackage[shortlabels]{enumitem} % allows custom enumerate labels [a.]
\usepackage{ulem} % \sout (strikeout)
\usepackage{booktabs} % \toprule \midrule \bottomrule in table environment
\usepackage[table,x11names]{xcolor} % {\color{} scope}
\usepackage{datetime} % \currenttime \today
% REFERENCES
\usepackage{cleveref} % better than hyperref, use \cref and \label
\crefname{equation}{Equation}{Equations}
% TYPOGRAPHY (XeLaTeX)
\setmainfont{CMU Serif}
\setsansfont{Helvetica}
\setmonofont[Scale=0.9]{InputMono}
% TABLES
% alias for black square
\newcommand\x{\cellcolor{black!100}}
% alias for mathbf for matrices
\newcommand\Mat[1]{\mathbf{{#1}}}
% PRESENTATIONAL FORMATTING
%\usepackage{algorithm} % \begin{algorithm} (wrapper for algorithmic)
%\usepackage{algpseudocode} % \begin{algorithmic}, \If{}, \State $x \gets 0$, \Else, \EndIf
% GRAPHING
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
% remember: \clearpage for a new page
%%%%%%%%%%%%%%%%%%%%%%%
% FANCY HEADER
%%%%%%%%%%%%%%%%%%%%%%%
% TITLE FORMATTING
\makeatletter
\renewcommand{\maketitle}{
\vspace{36pt}
\bgroup\setlength{\parindent}{0pt}
\begin{flushleft}
{\Huge{\textbf{\@title}}}\\
\vspace{24pt}
\@author\\
\@date
\end{flushleft}\egroup
% Uncomment for fancy empty space
% under title
%\vspace{0.7in}
}
\makeatother
% FIRST PAGE FORMATTING (NO TITLE ON LEFT HEADER)
\fancypagestyle{plain}{
\fancyhf{}
\rhead{Paul Herz}
\rfoot{Page \thepage}
\setlength{\headheight}{15pt}
\setlength{\headsep}{24pt}
}
% DEFAULT PAGE FORMATTING
\makeatletter
\fancyhf{}
\rhead{Paul Herz}
\lhead{\textit{\@title}}
\rfoot{Page \thepage}
\setlength{\headheight}{15pt}
\setlength{\headsep}{24pt}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%
\title{Title}
\author{Paul Herz}
\date{\today}
%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\pagestyle{fancy}
\thispagestyle{plain}
\maketitle
\setlength{\parindent}{0em}
\setlength{\parskip}{1em}
% CONTENT
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment