lunduniversity / templates

Lund University templates for documents and projects.
12 stars 6 forks source link

Font Issues #5

Closed Xaldew closed 1 month ago

Xaldew commented 3 months ago

Given the following beamer:

\documentclass[aspectratio=1610]{beamer}
\usepackage{fontspec}
\usepackage{iftex}
\usepackage{xcolor}
\usepackage{caption}
\usepackage{amsmath}

\ifLuaTeX\else
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
\fi

%%%%%%%
\usetheme[% Complete settings. Default value in []
% titleimagecolor=red,       % [gray], darkgray, red, blue, green
% titleimagemargin=2mm,      % Distance [2mm]    Frame around title page image
%navigationsymbols=true,   % true   / [false]  Navigation symbols in the foot
mathseriffont=true,       % true   / [false]  Serif / non-serif math fonts
foot=true,                 % [true] / false    Footline or not
nofootslidenum=false,       % true   / [false]  Keep slide num even when foot=false
footlogo=true,             % [true] / false    Put LU logo to the left of footer
english=true,              % [true] / false    English / Swedish logo
LTHlogo=true,             % true   / [false]  Use LTH logo instead of LU on title and end pages.
blackenumeratenumber=false, % [true] / false    Black enumerate numbers, o.w. Lund bronze
blackitemmark=false,       % true   / [false]  Black item marks, o.w. Lund bronze
defaultfont=lu,        % [palatino], beamer, lu
sectionframe=false,
]{ulund}
\ulundfootright{\insertframenumber/\inserttotalframenumber}

\definecolor{quotegray}{RGB}{146,139,129}
\definecolor{lundbronze}{RGB}{156,97,20}
\hypersetup{colorlinks,linkcolor=,urlcolor=lundbronze}

\title[]{\huge{}Test Beamer}
\author[]{John Doe}

\begin{document}

\begin{frame}[plain]
  \titlepage%
\end{frame}

\begin{frame}[fragile]{Test}
  $rank_{1}(B, n) = I + II + III$
\end{frame}

\end{document}

Note in particular that we have selected to use the lu fonts, AGaramond and FrutigerLTD. Even when these fonts are installed however, the above beamer will fail to compile with the error messages:

XeLaTeX:
/home/gustaf/.local/share/texlive/texmf/tex/latex/beamer/beamer/themes/ulund/beamerfontthemeulund.sty:42: Package fontspec Error: The font "AGaramondPro-Regular" cannot be found.

LuaLaTeX:
</usr/share/texmf/fonts/opentype/public/lm/lmmono10-regular.otf></home/gustaf/.local/share/fonts/FrutigerLTStd-LightItalic.otf>{/usr/share/texlive/texmf-dist/fonts/enc/dvips/ly1/texnansi.enc}</home/gustaf/.local/share/fonts/AGaramondPro-Italic.otf></usr/share/texmf/fonts/opentype/public/lm/lmmono9-regular.otf></home/gustaf/.local/share/fonts/FrutigerLTStd-Light.otf></home/gustaf/.local/share/fonts/AGaramondPro-Regular.otf></usr/share/texlive/texmf-dist/fonts/type1/public/mathdesign/mdugm/md-gmr7t.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/mathdesign/mdugm/md-gmr7v.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/mathdesign/mdugm/md-gmr7y.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/mathdesign/mdugm/md-gmri7m.pfb>
! error:  (type 1): cannot open file for reading 'ugmr8a.pfb'
!  ==> Fatal error occurred, no output PDF file produced!

The only way I have found to 'fix' this issue is to use this tool https://tug.org/fonts/getnonfreefonts/ to install the garamond and garamondx font specification. Thus, this should probably be documented in the README if it is desired to use these fonts.

bjornregnell commented 3 months ago

Sounds like a good idea! PR is welcome indeed on the README.

Xaldew commented 1 month ago

Done now that pull request #6 has been merged.