Apr 2, 2025

Generic LaTeX Document Template

This is a generic LaTeX title header that I like to use for my documents.

\documentclass{article} \usepackage[left=.5in, right=.5in, top=1in, bottom=.5in]{geometry} \usepackage{titling} \usepackage{unicode-math} \usepackage{fontspec} \setromanfont{TeX Gyre Termes} \setsansfont{TeX Gyre Heros} \setmonofont{TeX Gyre Cursor} \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{{#1}.}\xspace\@ifnextchar\par{\@gobble}{}} \providecommand\subparagraph{} \renewcommand*{\subparagraph}[1]{\par\smallskip\noindent\underLine{{#1}.}\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}