20
0
Files
cdsc_tex/slides_template/fonts.tex
Benjamin Mako Hill 27304c853a Share the font setup between the slides and the notes
The notes pages were typeset in the default Latin Modern while the slides
used OpenSans and RobotoMono, so the two halves of a presenter page did not
match.

Move the font declarations to fonts.tex, which the slides \input and
mknotes passes to the notes document. mknotes uses it by default when it
exists, so a deck that copies the two notes files in gets matching fonts
without having to remember a flag; --preamble names a different fragment,
and a file named there but missing is an error rather than ignored.

The notes document now compiles from the document directory with
-output-directory rather than running inside the temporary one, so the
relative font paths in the fragment resolve.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 07:26:23 -07:00

20 lines
790 B
TeX

% Font setup shared by the slides and by the notes pages that mknotes
% typesets, so that the two match. Loaded by example.tex directly and passed
% to mknotes with --preamble.
%
% Requires fontspec, which unicode-math pulls in on the slides side. Paths must
% stay relative to the document directory: LuaTeX fails to resolve a
% parent-relative Path= and dies with an unhelpful empty-filename error.
\setsansfont{OpenSans}[
Path = fonts/OpenSans/, Extension = .ttf,
UprightFont = *-Regular, BoldFont = *-Bold,
ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic]
\setmonofont{RobotoMono}[
Path = fonts/RobotoMono/, Extension = .ttf,
UprightFont = *-Regular, BoldFont = *-Bold,
ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic]
\renewcommand{\familydefault}{\sfdefault}