GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
LaTeX
Browse code
Merge commit '
eb22229
'
master
commit
386d8018592d7d033722b8941b7f6424ad7bc002
2 parents
4314c07
+
eb22229
Nigel Stanger
authored
on 27 Oct 2022
Patch
Showing
2 changed files
lectures/lecturecommon.sty
lectures/otagofonts.sty
Ignore Space
Show notes
View
lectures/lecturecommon.sty
\def\filedate{27 October 2022} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Common definitions shared across the various lecture document classes. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version. % v1.0.1 Fixed incorrect provided package name. % v1.0.2 Increased number of tab stops in codesyntaxblock environment. % v1.1 Added Unicode/XeLaTeX support. % Added exercise environment. % v1.2 Switched to "class" instead of "chapter". % v1.2.1 Fixed fontspec option clash and made font handling consistent with XML framework. % v1.2.2 Fixed incorrect Roman font in math mode. % v1.2.3 Switched XeLaTeX fonts to new University standard (Minion Pro + Open Sans). % v1.2.4 Fixed "class number plus one" so that it can be passed as a number to other macros. % v1.2.5 Disabled Mapping=tex-text for mono font to eliminate automatic curly quotes. % v1.2.6 Enabled unicode option for hyperref when using Xe(La)TeX. % v1.2.7 Reverted unicode option for hyperref due to option clash error. % v1.3 Switched to otagofonts.sty for font configuration. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesPackage{lecturecommon}[2022/10/27 INFO standard lecture setup v1.3] % Standard packages common to ALL lecture documents. \RequirePackage{amsmath} % needs to be loaded before mathspec \RequirePackage{otagofonts} \RequirePackage{boxedminipage} \RequirePackage{graphicx} \RequirePackage{hyperref} \hypersetup{pdfpagemode=UseNone} % Standard macros and package configuration common to ALL lecture notes % documents. % graphicx setup. \graphicspath{{images/}} % Simple code listing setup. \newcommand{\keyword}[1]{\texttt{\uppercase{#1}}} \newcommand{\nonterminal}[1]{\textit{\texttt{#1}}} % Note: maximum 13 tab stops in a tabbing environment. (Bah.) \newenvironment{codesyntaxblock}[1][\normalsize]% {\begingroup\ttfamily#1\begin{tabbing}mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=\kill}% {\end{tabbing}\endgroup} % Environment for boxed exercises. \newcounter{exercise} \setcounter{exercise}{0} % Arguments: #1 width of box to set the exercise text in (defaults to \columnwidth). \newenvironment{exercise}[1][\columnwidth]% {\noindent\refstepcounter{exercise}\begin{boxedminipage}{#1}\textbf{Exercise \theexercise: }}% {\end{boxedminipage}} % Starred form produces an unnumbered exercise. \newenvironment{exercise*}[1][\columnwidth]% {\noindent\begin{boxedminipage}{#1}\textbf{Exercise: }}% {\end{boxedminipage}} % Standard variables for various things, and macros for initialising them. % These can be used (or not) as necessary. % Paper variables: subject code. \newcommand{\SubjectCode}{UNDEFINED} \newcommand{\SetSubjectCode}[1]{\renewcommand{\SubjectCode}{#1}} % Paper number. \newcommand{\PaperNumber}{UNDEFINED} \newcommand{\SetPaperNumber}[1]{\renewcommand{\PaperNumber}{#1}} % Convenience macro for printing out the full paper code. \newcommand{\PaperCode}{\SubjectCode~\PaperNumber} % Paper title. \newcommand{\PaperTitle}{UNDEFINED} \newcommand{\SetPaperTitle}[1]{\renewcommand{\PaperTitle}{#1}} % Department name. \newcommand{\DepartmentName}{UNDEFINED} \newcommand{\SetDepartmentName}[1]{\renewcommand{\DepartmentName}{#1}} % Teaching period. \newcommand{\TeachingPeriod}{UNDEFINED} \newcommand{\SetTeachingPeriod}[1]{\renewcommand{\TeachingPeriod}{#1}} % Year offered. \newcommand{\YearOffered}{UNDEFINED} \newcommand{\SetYearOffered}[1]{\renewcommand{\YearOffered}{#1}} % Oracle version. \newcommand{\Oracle}{UNDEFINED} \newcommand{\SetOracleVersion}[1]{\renewcommand{\Oracle}{#1}} % Class number. \newcounter{chapterplusone} \newcommand{\ClassNumber}{\thechapter} \newcommand{\ClassNumberPlusOne}{\thechapterplusone} \newcommand{\SetClassNumber}[1]{% \setcounter{chapter}{#1}% \setcounter{chapterplusone}{#1}% \stepcounter{chapterplusone}% } % Backwards compatibility with the old syntax \newcommand{\ChapterNumber}{\ClassNumber} \newcommand{\ChapterNumberPlusOne}{\ClassNumberPlusOne} \newcommand{\SetChapterNumber}[1]{\SetClassNumber{#1}} % Class title. \newcommand{\ClassTitle}{UNDEFINED} \newcommand{\SetClassTitle}[1]{\renewcommand{\ClassTitle}{#1}} \newcommand{\ShortClassTitle}{UNDEFINED} \newcommand{\SetShortClassTitle}[1]{\renewcommand{\ShortClassTitle}{#1}} % Backwards compatibility with the old syntax \newcommand{\ChapterTitle}{\ClassTitle} \newcommand{\SetChapterTitle}[1]{\SetClassTitle{#1}} \newcommand{\ShortChapterTitle}{\ShortClassTitle} \newcommand{\SetShortChapterTitle}[1]{\SetShortClassTitle{#1}} % Class type. \newcommand{\ClassType}{Lecture} \newcommand{\SetClassType}[1]{\renewcommand{\ClassType}{#1}} \endinput
\def\filedate{13 June 2019} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Common definitions shared across the various lecture document classes. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version. % v1.0.1 Fixed incorrect provided package name. % v1.0.2 Increased number of tab stops in codesyntaxblock environment. % v1.1 Added Unicode/XeLaTeX support. % Added exercise environment. % v1.2 Switched to "class" instead of "chapter". % v1.2.1 Fixed fontspec option clash and made font handling consistent with XML framework. % v1.2.2 Fixed incorrect Roman font in math mode. % v1.2.3 Switched XeLaTeX fonts to new University standard (Minion Pro + Open Sans). % v1.2.4 Fixed "class number plus one" so that it can be passed as a number to other macros. % v1.2.5 Disabled Mapping=tex-text for mono font to eliminate automatic curly quotes. % v1.2.6 Enabled unicode option for hyperref when using Xe(La)TeX. % v1.2.7 Reverted unicode option for hyperref due to option clash error. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesPackage{lecturecommon}[2019/06/13 INFO standard lecture setup v1.2.7] % Standard packages common to ALL lecture documents. \RequirePackage{amsmath} % needs to be loaded before mathspec \RequirePackage{ifxetex} \ifxetex \RequirePackage[no-math]{fontspec} \RequirePackage{mathspec} \RequirePackage{xunicode} \RequirePackage{xltxtra} % The following line is equivalent to: % \setmainfont{Minion Pro} % \setmathsfont(Latin,Digits){Minion Pro} % \setmathrm{Minion Pro} \setprimaryfont[Mapping=tex-text]{Minion Pro} \setsansfont[Mapping=tex-text, Scale=MatchUppercase, BoldFont={Open Sans}]{Open Sans Light} % Explicitly specify Mapping=tex-text only for the primary and sans fonts, % otherwise curly quotes will automatically appear in the mono font. Since % this is pretty much exclusively used for code listings, this is a bad thing. \setmonofont[Scale=MatchLowercase]{Letter Gothic 12 Pitch} % Hack to prevent digits in hyperlinks from being set in the main font instead of the mono font. % From http://tex.stackexchange.com/questions/99770/problem-with-digits-in-urls-when-using-mathspec-and-hyperref % Note: doesn't matter if this is executed multiple times. \makeatletter \DeclareMathSymbol{0}{\mathalpha}{\eu@DigitsArabic@symfont}{`0} \DeclareMathSymbol{1}{\mathalpha}{\eu@DigitsArabic@symfont}{`1} \DeclareMathSymbol{2}{\mathalpha}{\eu@DigitsArabic@symfont}{`2} \DeclareMathSymbol{3}{\mathalpha}{\eu@DigitsArabic@symfont}{`3} \DeclareMathSymbol{4}{\mathalpha}{\eu@DigitsArabic@symfont}{`4} \DeclareMathSymbol{5}{\mathalpha}{\eu@DigitsArabic@symfont}{`5} \DeclareMathSymbol{6}{\mathalpha}{\eu@DigitsArabic@symfont}{`6} \DeclareMathSymbol{7}{\mathalpha}{\eu@DigitsArabic@symfont}{`7} \DeclareMathSymbol{8}{\mathalpha}{\eu@DigitsArabic@symfont}{`8} \DeclareMathSymbol{9}{\mathalpha}{\eu@DigitsArabic@symfont}{`9} \makeatother \else % assume PDFLaTeX otherwise \RequirePackage[T1]{fontenc} \RequirePackage{textcomp} \RequirePackage{lmodern} \RequirePackage{mathpazo} % Gill Sans to come... % \renewcommand{\sfdefault}{} \renewcommand{\ttdefault}{blg} \fi \RequirePackage{boxedminipage} \RequirePackage{graphicx} \RequirePackage{hyperref} \hypersetup{pdfpagemode=UseNone} % Standard macros and package configuration common to ALL lecture notes % documents. % graphicx setup. \graphicspath{{images/}} % Simple code listing setup. \newcommand{\keyword}[1]{\texttt{\uppercase{#1}}} \newcommand{\nonterminal}[1]{\textit{\texttt{#1}}} % Note: maximum 13 tab stops in a tabbing environment. (Bah.) \newenvironment{codesyntaxblock}[1][\normalsize]% {\begingroup\ttfamily#1\begin{tabbing}mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=\kill}% {\end{tabbing}\endgroup} % Environment for boxed exercises. \newcounter{exercise} \setcounter{exercise}{0} % Arguments: #1 width of box to set the exercise text in (defaults to \columnwidth). \newenvironment{exercise}[1][\columnwidth]% {\noindent\refstepcounter{exercise}\begin{boxedminipage}{#1}\textbf{Exercise \theexercise: }}% {\end{boxedminipage}} % Starred form produces an unnumbered exercise. \newenvironment{exercise*}[1][\columnwidth]% {\noindent\begin{boxedminipage}{#1}\textbf{Exercise: }}% {\end{boxedminipage}} % Standard variables for various things, and macros for initialising them. % These can be used (or not) as necessary. % Paper variables: subject code. \newcommand{\SubjectCode}{UNDEFINED} \newcommand{\SetSubjectCode}[1]{\renewcommand{\SubjectCode}{#1}} % Paper number. \newcommand{\PaperNumber}{UNDEFINED} \newcommand{\SetPaperNumber}[1]{\renewcommand{\PaperNumber}{#1}} % Convenience macro for printing out the full paper code. \newcommand{\PaperCode}{\SubjectCode~\PaperNumber} % Paper title. \newcommand{\PaperTitle}{UNDEFINED} \newcommand{\SetPaperTitle}[1]{\renewcommand{\PaperTitle}{#1}} % Department name. \newcommand{\DepartmentName}{UNDEFINED} \newcommand{\SetDepartmentName}[1]{\renewcommand{\DepartmentName}{#1}} % Teaching period. \newcommand{\TeachingPeriod}{UNDEFINED} \newcommand{\SetTeachingPeriod}[1]{\renewcommand{\TeachingPeriod}{#1}} % Year offered. \newcommand{\YearOffered}{UNDEFINED} \newcommand{\SetYearOffered}[1]{\renewcommand{\YearOffered}{#1}} % Oracle version. \newcommand{\Oracle}{UNDEFINED} \newcommand{\SetOracleVersion}[1]{\renewcommand{\Oracle}{#1}} % Class number. \newcounter{chapterplusone} \newcommand{\ClassNumber}{\thechapter} \newcommand{\ClassNumberPlusOne}{\thechapterplusone} \newcommand{\SetClassNumber}[1]{% \setcounter{chapter}{#1}% \setcounter{chapterplusone}{#1}% \stepcounter{chapterplusone}% } % Backwards compatibility with the old syntax \newcommand{\ChapterNumber}{\ClassNumber} \newcommand{\ChapterNumberPlusOne}{\ClassNumberPlusOne} \newcommand{\SetChapterNumber}[1]{\SetClassNumber{#1}} % Class title. \newcommand{\ClassTitle}{UNDEFINED} \newcommand{\SetClassTitle}[1]{\renewcommand{\ClassTitle}{#1}} \newcommand{\ShortClassTitle}{UNDEFINED} \newcommand{\SetShortClassTitle}[1]{\renewcommand{\ShortClassTitle}{#1}} % Backwards compatibility with the old syntax \newcommand{\ChapterTitle}{\ClassTitle} \newcommand{\SetChapterTitle}[1]{\SetClassTitle{#1}} \newcommand{\ShortChapterTitle}{\ShortClassTitle} \newcommand{\SetShortChapterTitle}[1]{\SetShortClassTitle{#1}} % Class type. \newcommand{\ClassType}{Lecture} \newcommand{\SetClassType}[1]{\renewcommand{\ClassType}{#1}} \endinput
Ignore Space
Show notes
View
lectures/otagofonts.sty
\def\filedate{27 October 2022} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Set up official Otago fonts based on what’s available. Fall back to close % facsimiles where possible. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version, rebuilt from deprecated lecturecommon package. % v1.1 Refactored font checking mechanism. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesPackage{otagofonts}[2022/10/27 Otago standard fonts v1.1] \RequirePackage{etoolbox} \RequirePackage{ifxetex} \RequirePackage{amsmath} % needs to be loaded before mathspec \ifxetex \RequirePackage[no-math]{fontspec} \RequirePackage{mathspec} \RequirePackage{xunicode} \RequirePackage{xltxtra} % Try a few different fonts that are either the official Otago font, or a reasonable % facsimile thereof. Effectively done via a bunch of nested ifs. I did try using % etoolbox's list looping macros, but the tricky part was making it generic for all % three categories of font (primary, sans, mono), and I could only successfully make % work for the first one encountered. The set of fonts is limited, so this is OK. % % Note: Explicitly specify Mapping=tex-text only for the primary and sans fonts, % otherwise curly quotes will automatically appear in the mono font. Since % this is pretty much exclusively used for code listings, this is a bad thing. % Primary font (body text, maths). \newbool{foundprimaryfont} \PackageInfo{otagofonts}{Looking for suitable primary font} \renewcommand*{\do}[1]{% \PackageInfo{otagofonts}{Trying #1...} \IfFontExistsTF{#1}{% % The following line is equivalent to: % \setmainfont{fontname}[options] % \setmathsfont(Latin,Digits){fontname} % \setmathrm{fontname} \setprimaryfont[Mapping=tex-text]{#1}% \PackageInfo{otagofonts}{Using #1 for primary font}% \booltrue{foundprimaryfont}% \listbreak% }{}% } \docsvlist{Minion Pro,Crimson Pro,Crimson Text,Times New Roman} \ifbool{foundprimaryfont}{% % Hack to prevent digits in hyperlinks from being set in the main font instead of the mono font. % Note: doesn't matter if this is executed multiple times. Only works if you use \setprimaryfont % or \setmathsfont first. From https://tex.stackexchange.com/a/99774. \makeatletter% \DeclareMathSymbol{0}{\mathalpha}{\eu@DigitsArabic@symfont}{`0}% \DeclareMathSymbol{1}{\mathalpha}{\eu@DigitsArabic@symfont}{`1}% \DeclareMathSymbol{2}{\mathalpha}{\eu@DigitsArabic@symfont}{`2}% \DeclareMathSymbol{3}{\mathalpha}{\eu@DigitsArabic@symfont}{`3}% \DeclareMathSymbol{4}{\mathalpha}{\eu@DigitsArabic@symfont}{`4}% \DeclareMathSymbol{5}{\mathalpha}{\eu@DigitsArabic@symfont}{`5}% \DeclareMathSymbol{6}{\mathalpha}{\eu@DigitsArabic@symfont}{`6}% \DeclareMathSymbol{7}{\mathalpha}{\eu@DigitsArabic@symfont}{`7}% \DeclareMathSymbol{8}{\mathalpha}{\eu@DigitsArabic@symfont}{`8}% \DeclareMathSymbol{9}{\mathalpha}{\eu@DigitsArabic@symfont}{`9}% \makeatother% }{% \PackageWarning{otagofonts}{% Could not find any suitable primary font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Minion Pro (official, commercial)\MessageBreak% \space\space Crimson Pro (https://fonts.google.com/specimen/Crimson+Pro)% \space\space Crimson Text (https://fonts.google.com/specimen/Crimson+Text)% }% } % Sans-serif font. \newbool{foundsansfont} \PackageInfo{otagofonts}{Looking for suitable sans-serif font} % font-specific defaults \defaultfontfeatures[Open Sans Light]{BoldFont={Open Sans}} \defaultfontfeatures[Roboto Light]{BoldFont={Roboto}} \renewcommand*{\do}[1]{% \PackageInfo{otagofonts}{Trying #1...} \IfFontExistsTF{#1}{% \setsansfont{#1}[Ligatures=TeX, Scale=MatchUppercase]% \PackageInfo{otagofonts}{Using #1 for sans-serif font}% \booltrue{foundsansfont}% \listbreak% }{}% } \docsvlist{Open Sans Light,Roboto Light,Arial} \ifbool{foundsansfont}{}{% \PackageWarning{otagofonts}{Could not find any suitable sans-serif font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Open Sans (https://fonts.google.com/specimen/Open+Sans)\MessageBreak% \space\space Roboto (https://fonts.google.com/specimen/Roboto)% }% } % Monospaced font, mainly for code listings. \newbool{foundmonofont} \PackageInfo{otagofonts}{Looking for suitable monospaced font} % font-specific defaults \defaultfontfeatures[Iosevka Light]{RawFeature={+ss03;-calt}} \renewcommand*{\do}[1]{% \PackageInfo{otagofonts}{Trying #1...} \IfFontExistsTF{#1}{% \setmonofont{#1}[Scale=MatchUppercase]% \PackageInfo{otagofonts}{Using #1 for monospaced font}% \booltrue{foundmonofont}% \listbreak% }{}% } \docsvlist{Iosevka Light,Letter Gothic 12 Pitch,Inconsolata} \ifbool{foundmonofont}{}{% \PackageWarning{otagofonts}{Could not find any suitable monospaced font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Iosevka (https://github.com/be5invis/Iosevka/releases, but complex!)\MessageBreak% \space\space Inconsolata (https://fonts.google.com/specimen/Inconsolata)% }% } \else % assume PDFLaTeX otherwise \RequirePackage[T1]{fontenc} \RequirePackage{textcomp} \RequirePackage{lmodern} \RequirePackage{mathpazo} \PackageWarning{otagofonts}{% Otago-compatible fonts are not yet supported for LaTeX\MessageBreak% or PDFLaTeX. XeLaTeX is preferred% } % Gill Sans to come... % \renewcommand{\sfdefault}{} % \renewcommand{\ttdefault}{blg} \fi \endinput
\def\filedate{23 February 2021} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Set up official Otago fonts based on what’s available. Fall back to close % facsimiles where possible. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version History % v1.0 Initial version, rebuilt from deprecated lecturecommon package. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}[2001/06/01] \ProvidesPackage{otagofonts}[2021/02/23 Otago standard fonts v1.0] \RequirePackage{etoolbox} \RequirePackage{ifxetex} \RequirePackage{amsmath} % needs to be loaded before mathspec \ifxetex \RequirePackage[no-math]{fontspec} \RequirePackage{mathspec} \RequirePackage{xunicode} \RequirePackage{xltxtra} % Try a few different fonts that are either the official Otago font, or a reasonable % facsimile thereof. Effectively done via a bunch of nested ifs. I did try using % etoolbox's list looping macros, but the tricky part was making it generic for all % three categories of font (primary, sans, mono), and I could only successfully make % work for the first one encountered. The set of fonts is limited, so this is OK. % % Note: Explicitly specify Mapping=tex-text only for the primary and sans fonts, % otherwise curly quotes will automatically appear in the mono font. Since % this is pretty much exclusively used for code listings, this is a bad thing. % Primary font (body text, maths). \newbool{foundprimaryfont} \PackageInfo{otagofonts}{Looking for suitable primary font} \IfFontExistsTF{Minion Pro}{% % The following line is equivalent to: % \setmainfont{Minion Pro} % \setmathsfont(Latin,Digits){Minion Pro} % \setmathrm{Minion Pro} \setprimaryfont[Mapping=tex-text]{Minion Pro}% \PackageInfo{otagofonts}{Using Minion Pro for primary font}% \booltrue{foundprimaryfont}% }{% \IfFontExistsTF{Crimson Text}{% \setprimaryfont[Mapping=tex-text]{Crimson Text}% \PackageInfo{otagofonts}{Using Crimson Text for primary font}% \booltrue{foundprimaryfont}% }{% \IfFontExistsTF{Times New Roman}{% \setprimaryfont[Mapping=tex-text]{Times New Roman}% \PackageInfo{otagofonts}{Using Times New Roman for primary font}% \booltrue{foundprimaryfont}% }{% \PackageWarning{otagofonts}{% Could not find any suitable primary font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Minion Pro (official, commercial)\MessageBreak% \space\space Crimson Text (https://fonts.google.com/specimen/Crimson+Text)% }% \boolfalse{foundprimaryfont}% }% }% } \ifbool{foundprimaryfont}{% % Hack to prevent digits in hyperlinks from being set in the main font instead of the mono font. % Note: doesn't matter if this is executed multiple times. Only works if you use \setprimaryfont % or \setmathsfont first. From https://tex.stackexchange.com/a/99774. \makeatletter% \DeclareMathSymbol{0}{\mathalpha}{\eu@DigitsArabic@symfont}{`0}% \DeclareMathSymbol{1}{\mathalpha}{\eu@DigitsArabic@symfont}{`1}% \DeclareMathSymbol{2}{\mathalpha}{\eu@DigitsArabic@symfont}{`2}% \DeclareMathSymbol{3}{\mathalpha}{\eu@DigitsArabic@symfont}{`3}% \DeclareMathSymbol{4}{\mathalpha}{\eu@DigitsArabic@symfont}{`4}% \DeclareMathSymbol{5}{\mathalpha}{\eu@DigitsArabic@symfont}{`5}% \DeclareMathSymbol{6}{\mathalpha}{\eu@DigitsArabic@symfont}{`6}% \DeclareMathSymbol{7}{\mathalpha}{\eu@DigitsArabic@symfont}{`7}% \DeclareMathSymbol{8}{\mathalpha}{\eu@DigitsArabic@symfont}{`8}% \DeclareMathSymbol{9}{\mathalpha}{\eu@DigitsArabic@symfont}{`9}% \makeatother% } % Sans-serif font. \newbool{foundsansfont} \PackageInfo{otagofonts}{Looking for suitable sans-serif font} \IfFontExistsTF{Open Sans Light}{% % Note scaling hack to fix the weird upscaling of Open Sans in Texlive 2020. % It doesn't affect the serif or monospace fonts (?!?!). \setsansfont[Mapping=tex-text, Scale=0.912, BoldFont={Open Sans}]{Open Sans Light}% % \setsansfont[Mapping=tex-text, Scale=MatchUppercase, BoldFont={Open Sans}]{Open Sans Light}% \PackageInfo{otagofonts}{Using Open Sans Light for sans-serif font}% \booltrue{foundsansfont}% }{% \IfFontExistsTF{Roboto Light}{% \setsansfont[Mapping=tex-text, Scale=MatchUppercase, BoldFont={Roboto}]{Roboto Light}% \PackageInfo{otagofonts}{Using Roboto Light for sans-serif font}% \booltrue{foundsansfont}% }{% \IfFontExistsTF{Arial}{% \setsansfont[Mapping=tex-text, Scale=MatchUppercase]{Arial}% \PackageInfo{otagofonts}{Using Arial for sans-serif font}% \booltrue{foundsansfont}% }{% \PackageWarning{otagofonts}{Could not find any suitable sans-serif font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Open Sans (https://fonts.google.com/specimen/Open+Sans)\MessageBreak% \space\space Roboto (https://fonts.google.com/specimen/Roboto)% }% \boolfalse{foundsansfont}% }% }% } % Monospaced font, mainly for code listings. \newbool{foundmonofont} \PackageInfo{otagofonts}{Looking for suitable monospaced font} \IfFontExistsTF{Iosevka Light}{% \setmonofont[Scale=MatchUppercase, Mapping=]{Iosevka Light}% \PackageInfo{otagofonts}{Using Iosevka Light for monospaced font}% \booltrue{foundmonofont}% }{% \IfFontExistsTF{Letter Gothic 12 Pitch}{% \setmonofont[Scale=MatchUppercase, Mapping=]{Letter Gothic 12 Pitch}% \PackageInfo{otagofonts}{Using Letter Gothic 12 Pitch for monospaced font}% \booltrue{foundmonofont}% }{% \IfFontExistsTF{Inconsolata}{% \setmonofont[Scale=MatchUppercase, Mapping=]{Inconsolata}% \PackageInfo{otagofonts}{Using Inconsolata for monospaced font}% \booltrue{foundmonofont}% }{% \PackageWarning{otagofonts}{Could not find any suitable monospaced font.\MessageBreak% Falling back to LaTeX default.\MessageBreak% Recommended fonts:\MessageBreak% \space\space Iosevka (https://github.com/be5invis/Iosevka/releases, but complex!)\MessageBreak% \space\space Inconsolata (https://fonts.google.com/specimen/Inconsolata)% }% \boolfalse{foundmonofont}% }% }% } \else % assume PDFLaTeX otherwise \RequirePackage[T1]{fontenc} \RequirePackage{textcomp} \RequirePackage{lmodern} \RequirePackage{mathpazo} \PackageWarning{otagofonts}{% Otago-compatible fonts are not yet supported for LaTeX\MessageBreak% or PDFLaTeX. XeLaTeX is preferred% } % Gill Sans to come... % \renewcommand{\sfdefault}{} % \renewcommand{\ttdefault}{blg} \fi \endinput
Show line notes below