From a0674e7f87d1aa4a194f3b4811efe03ad3bf6bb6 Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Sun, 12 Apr 2026 21:11:51 -0700 Subject: [PATCH] Switch templates to LuaLaTeX with fontspec Moves paper, assignment, and letter templates from pdflatex to lualatex, and replaces the Type-1 font setup (mathdesign/garamond, ucs/utf8x, T1 fontenc) with fontspec using EB Garamond for the main font and TeX Gyre Heros for sans. This produces PDFs whose text extracts cleanly and is a prerequisite for tagged/accessible PDF output. Co-Authored-By: Claude Sonnet 4.6 --- assignment_template/Makefile | 2 +- assignment_template/text.tex | 8 +++----- letter_template/Makefile | 2 +- letter_template/text.tex | 11 +++-------- paper_template/Makefile | 2 +- paper_template/text.tex | 7 +++---- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/assignment_template/Makefile b/assignment_template/Makefile index 9d0527f..b9216a6 100644 --- a/assignment_template/Makefile +++ b/assignment_template/Makefile @@ -8,7 +8,7 @@ all: $(patsubst %.tex,%.pdf,$(wildcard *.tex)) # Rscript -e "library(knitr); knit('$<')" %.pdf: %.tex - latexmk -f -pdf $< + latexmk -f -lualatex $< clean: latexmk -C *.tex diff --git a/assignment_template/text.tex b/assignment_template/text.tex index b8e6ea1..1951ed7 100644 --- a/assignment_template/text.tex +++ b/assignment_template/text.tex @@ -8,11 +8,9 @@ % with article-3 \chapterstyle, change to: \pagestyle{memo} \pagestyle{mako-mem} -\usepackage[utf8]{inputenc} - -\usepackage[T1]{fontenc} -\usepackage{textcomp} -\usepackage[garamond]{mathdesign} +\usepackage{fontspec} +\setmainfont{EB Garamond} +\setsansfont{TeX Gyre Heros} \usepackage[letterpaper,left=1.65in,right=1.65in,top=1.3in,bottom=1.2in]{geometry} diff --git a/letter_template/Makefile b/letter_template/Makefile index 237689e..0a6f949 100644 --- a/letter_template/Makefile +++ b/letter_template/Makefile @@ -3,7 +3,7 @@ all: $(patsubst %.tex,%.pdf,$(wildcard *.tex)) %.pdf: %.tex - latexmk -f -pdf $< + latexmk -f -lualatex $< clean: latexmk -C *.tex diff --git a/letter_template/text.tex b/letter_template/text.tex index e10c7ae..454b1b1 100644 --- a/letter_template/text.tex +++ b/letter_template/text.tex @@ -1,13 +1,8 @@ \documentclass[12pt]{letter} -\usepackage{ucs} -\usepackage[utf8x]{inputenc} - -\usepackage[T1]{fontenc} -\usepackage{textcomp} -\renewcommand{\rmdefault}{ugm} -\renewcommand{\sfdefault}{phv} -\usepackage[garamond]{mathdesign} +\usepackage{fontspec} +\setmainfont{EB Garamond} +\setsansfont{TeX Gyre Heros} \usepackage[letterpaper,left=1.3in,right=1.3in,top=0.8in,bottom=0.8in]{geometry} diff --git a/paper_template/Makefile b/paper_template/Makefile index 0bca574..09e0e7d 100644 --- a/paper_template/Makefile +++ b/paper_template/Makefile @@ -8,7 +8,7 @@ all: $(patsubst %.tex,%.pdf,$(wildcard *.tex)) # Rscript -e "library(knitr); knit('$<')" %.pdf: %.tex - latexmk -f -pdf $< + latexmk -f -lualatex $< clean: latexmk -C *.tex diff --git a/paper_template/text.tex b/paper_template/text.tex index 0532930..7a330d4 100644 --- a/paper_template/text.tex +++ b/paper_template/text.tex @@ -7,11 +7,10 @@ % \published tag \chapterstyle{cdsc-article} -\usepackage[utf8]{inputenc} +\usepackage{fontspec} +\setmainfont{EB Garamond} +\setsansfont{TeX Gyre Heros} \usepackage{wrapfig} -\usepackage[T1]{fontenc} -\usepackage{textcomp} -\usepackage[garamond]{mathdesign} \usepackage[letterpaper,left=1.65in,right=1.65in,top=1.3in,bottom=1.2in]{geometry}