How do I customize a thesis template in LaTeX to match the university's font style and requirements?
Alex, a senior mechanical engineering student, stared at the template PDF that his department had handed out. The font was a generic sans‑serif, the margins were slightly off, and the title page looked more like a draft than a finished product. He wondered how to tweak the LaTeX source so that every page would feel like an official university document.
First, pin down the exact font rules your university demands
Before you touch a single line of code, grab the official style guide or the thesis handbook. Look for sections labeled “Typography,” “Font,” or “Formatting.” Universities usually specify a serif font for the body text—most often Times New Roman or a similar typeface—at 12‑point size. Headings might be 14‑point, bold, and sometimes a different weight or style. Don’t overlook line spacing; 1.5‑spacing is common, but some schools insist on double spacing. Also check the required margins: 1.25 inches on all sides is a frequent default, but a few institutions use 1.5 inches on the left for binding.
Mark up a quick cheat sheet: Body font: Times New Roman, 12pt; Headings: Times New Roman, 14pt, bold; Line spacing: 1.5; Margins: 1.25in. Keep this list handy while you edit the LaTeX file.
Choose the right compiler and font package
LaTeX offers multiple compilers: pdfLaTeX, XeLaTeX, and LuaLaTeX. If the template uses only standard fonts that ship with TeX Live or MiKTeX, pdfLaTeX will work fine. However, if you need to load a system font like Times New Roman that isn’t bundled with the distribution, switch to XeLaTeX or LuaLaTeX and use the fontspec package.
For pdfLaTeX, the classic way to get Times is via the mathptmx package, which replaces both text and math fonts. The code snippet looks like this:
\usepackage{mathptmx}
\usepackage[margin=1.25in]{geometry}
\usepackage{setspace}
\setstretch{1.5}
If you’re on XeLaTeX, the equivalent becomes:
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage[margin=1.25in]{geometry}
\usepackage{setspace}
\setstretch{1.5}
Remember that fontspec works only with XeLaTeX or LuaLaTeX, so change your compilation command accordingly (for example, xelatex thesis.tex).
Adjust the document class and options to match the required layout
Most university templates start with a custom class file, such as university.cls. If the class already sets the font size to 12pt, you can skip the 12pt option in \documentclass. If not, add it explicitly:
\documentclass[12pt]{university}
Sometimes the class file already loads geometry or fancyhdr. If you need to override margin settings, place the geometry package after the class declaration to ensure it takes precedence. Likewise, if the class sets a header style you want to change, load fancyhdr after the class file and reconfigure it.
Fine‑tune headers, footers, and chapter styles
Headers and footers often carry the thesis title, author name, or chapter headings. The fancyhdr package gives you full control. A typical configuration might look like this:
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE]{\leftmark}
\fancyhead[RO]{\rightmark}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
Here, \leftmark and \rightmark automatically pull the chapter and section titles. If your university wants the author's name in the footer, replace \thepage with \thepage\ \textit{Your Name}.
For chapter headings, the titlesec package can adjust font weight and size:
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\Large\bfseries}{\chaptername\ \thechapter}{0pt}{\Large}
Adjust \Large to \large or \Large to match the required heading size. If the template already uses titlesec, simply tweak the existing definitions.
Make sure figures, tables, and captions match the font rules
Figures and tables often default to the document’s body font, but some templates apply a different style to captions. To enforce Times New Roman and 12pt for all captions, add:
\usepackage{caption}
\captionsetup{font=small, labelfont=bf, textfont=normalfont}
If the university requires captions to be 10pt, change small to footnotesize or specify font={footnotesize, Times New Roman}. For tables, use the array package to set column alignment and font size:
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
Then define your table columns with L{3cm} or similar.
Verify the PDF against the style guide
After making changes, compile the document and scan the PDF. Open the university’s style guide side‑by‑side and compare key elements: page numbers, header alignment, font size, line spacing, and margin measurements. If the PDF viewer shows a ruler, you can measure margins precisely. If something looks off, adjust the corresponding package options and recompile.
Wait, What About…
Many students wonder whether changing the font will break the bibliography or citation style. The good news is that LaTeX separates font settings from citation formatting. As long as you keep your bibliography package (e.g., biblatex or natbib) untouched, the font changes will propagate automatically. If you’re using biblatex, you can enforce Times New Roman for the bibliography with:
\usepackage[style=apa]{biblatex}
\addbibresource{references.bib}
\renewcommand{\bibfont}{\small\setmainfont{Times New Roman}}
Another common concern is PDF/A compliance for archival purposes. Some universities require the final PDF to be PDF/A‑1b. The pdfx package helps create compliant PDFs:
\usepackage[a-1b]{pdfx}
Finally, be aware of font licensing. Times New Roman is a proprietary font; if your LaTeX distribution does not include it, you’ll need to install it on your system and reference it with fontspec. If you’re using a free alternative like TeX Gyre Termes, confirm that the university accepts it before proceeding.
Final thoughts and a quick sanity check
When you feel confident that every element matches the university’s specifications, run a final compilation. Open the PDF, scroll through every chapter, and double‑check that no stray footnotes or margin notes appear. Print a test page on a standard printer; sometimes what looks fine on screen shifts slightly on paper.
Remember that LaTeX is a living document. Small tweaks—like adding \usepackage{microtype}—improve text justification and overall appearance without changing fonts. If you hit a snag, search the TeX.SE community or ask your advisor; most people have faced the same issues and can offer a quick fix.
Good luck, and enjoy the process of turning that template into your own polished thesis.