May 5, 2025
Generic LaTeX Document Template
This is a generic LaTeX title header that I like to use for my documents.
\documentclass {article}
\usepackage [letterpaper, left=1in, right=1in, top=1in, bottom=1in]{geometry}
\usepackage {titling}
\usepackage {unicode-math}
\usepackage {fontspec}
\setromanfont {TeX Gyre Termes}
\setsansfont {TeX Gyre Heros}
\setmonofont {Fira Code}
\usepackage [verbatim]{lstfiracode}
\setmathfont {TeX Gyre Termes Math}
\setmathfont {TeX Gyre Termes Math}[version = bold, FakeBold = 2.0]
\newfontfamily {\MaterialDesignIcons }{MaterialDesignIcons}[
Extension = .ttf,
UprightFont = materialdesignicons-webfont,
Renderer = OpenType
]
\DeclareTextFontCommand {\texticon }{\MaterialDesignIcons \color {gray!80}}
\usepackage {xspace}
\usepackage {lua-ul}
\makeatletter
\providecommand \paragraph {}
\renewcommand *{\paragraph }[1]{\par \smallskip \noindent \textbf {\underLine {{#1 }}}\quad \xspace \@ifnextchar \par {\@gobble }{}}
\providecommand \subparagraph {}
\renewcommand *{\subparagraph }[1]{\par \smallskip \noindent \underLine {{#1 }}\quad \xspace \@ifnextchar \par {\@gobble }{}}
\makeatother
\makeatletter
\newcommand *{\topic }[1]{\gdef \@topic {#1 }}
\newcommand *{\@topic }{}
\newcommand *{\subtopic }[1]{\gdef \@subtopic {#1 }}
\newcommand *{\@subtopic }{}
\def \@maketitle {
{
\large \noindent
{\LARGE \textbf {\@title }} \bigskip \\
\textbf {\@topic } \strut \hfill \textbf {\@author } \\
\textbf {\@subtopic } \strut \hfill \@date
}
\noindent \rule {\textwidth }{1pt}
\bigskip
}
\usepackage {fancyhdr}
\fancypagestyle {plain}{
\fancyhead {}
\fancyfoot {}
\renewcommand {\headrulewidth }{0pt}
}
\pagestyle {fancy}
\fancyhead {}
\fancyfoot {}
\fancyhead [L]{\thetitle }
\fancyhead [R]{Page \thepage }
\renewcommand {\headrulewidth }{1pt}
\makeatother
\usepackage {amsmath,amsfonts}
\usepackage {hyperref}
\usepackage {xurl}
\usepackage {paralist}
\usepackage {stfloats}
\usepackage {booktabs}
\usepackage [capitalise,noabbrev]{cleveref}
\usepackage {graphicx}
\usepackage {pdfpages}
\usepackage {tikz}
\usetikzlibrary {positioning,calc,fit,arrows.meta}
\tikzset {>={Latex[length=.5em, width=.25em]}}