Skip to content

Instantly share code, notes, and snippets.

@nicholastay
Last active April 16, 2019 13:29
Show Gist options
  • Save nicholastay/58fb84ddae682719e409d6cbdb424053 to your computer and use it in GitHub Desktop.
Save nicholastay/58fb84ddae682719e409d6cbdb424053 to your computer and use it in GitHub Desktop.
My fairly basic math template for LaTeX
\documentclass{article}
% Document metadata - set here
\newcommand{\metatitle}{<++>}
\newcommand{\shorttitle}{<++>}
\newcommand{\metaauthor}{Tay, Nicholas}
\newcommand{\metaemail}{<++>}
\newcommand{\metadate}{<++>}
% ------------------- Preamble --------------------
\usepackage[a4paper, margin=2cm, top=3cm, bottom=2cm]{geometry} % A4 paper with my standard margins
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{fancyhdr}
\usepackage[shortlabels]{enumitem}
%\usepackage{amsthm}
%\usepackage{framed}
%\usepackage{float}
%\usepackage{tikz}
%\usepackage{pgfplots}
\usepackage[parfill]{parskip}
% PDF data + hyperref
\usepackage[pdftex, pdfauthor={\metaauthor{} <\metaemail{}>}, pdftitle={\metatitle{}}]{hyperref}
% Title
\title{\metatitle{}}
\author{\metaauthor \\ \href{mailto:\metaemail{}}{\small \textit{\metaemail{}}}}
\date{\metadate{}}
% Header settings
\pagestyle{fancy}
\fancyhf{}
\lhead{\shorttitle{}}
\rhead{\metaauthor{}}
\cfoot{\thepage}
% Math macros
% absolute val
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
% vectors - use bold, \veca is the old one
\let\veca\vec
\renewcommand{\vec}[1]{\mathbf{#1}}
% more shortcuts
\newcommand{\Real}{\mathbb{R}}
% ------------------- End Preamble --------------------
\begin{document}
\maketitle
<++>
\end{document}
\documentclass{article}
% Document metadata
\newcommand{\metatitle}{<++>}
\newcommand{\shorttitle}{<++>}
\newcommand{\metaauthor}{Nicholas Tay}
\newcommand{\metaemail}{<++>}
\newcommand{\metadate}{<++>}
% Slight modification of my standard math.tex for just homework-like stuff
% ------------------- Preamble --------------------
\usepackage[a4paper, margin=2cm, top=3cm, bottom=2cm]{geometry} % A4 paper with my standard margins
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{fancyhdr}
\usepackage[shortlabels]{enumitem}
%\usepackage{amsthm}
%\usepackage{cancel}
\usepackage[parfill]{parskip}
% PDF data + hyperref
\usepackage[pdftex, pdfauthor={\metaauthor{} <\metaemail{}>}, pdftitle={\metatitle{}}]{hyperref}
% Header settings
\pagestyle{fancy}
\fancyhf{}
\lhead{\metaauthor{}}
\chead{\shorttitle{}}
\rhead{\metadate{}}
\cfoot{\thepage}
% Math macros
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
% vectors - use bold, \veca is the old one
\let\veca\vec
\renewcommand{\vec}[1]{\mathbf{#1}}
% more shortcuts
\newcommand{\Real}{\mathbb{R}}
\newcommand{\Nat}{\mathbb{N}}
\newcommand{\calP}{\mathcal{P}}
\newcommand{\T}{\text{\textsf{T}}}
\newcommand{\F}{\text{\textsf{F}}}
% ------------------- End Preamble --------------------
\begin{document}
\thispagestyle{empty}
\begin{center}
\Large{\textbf{\metatitle{}}} \\ \large{\metaauthor{} \\ \href{mailto:\metaemail{}}{\small \textit{\metaemail{}}} \\ \metadate{}}
\end{center}
<++>
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment