2

I'm trying to create a template for my lecture handout. I'm using Segoe UI as the main font for the presentation and I want to use BaskervilleF (https://tug.org/FontCatalogue/baskervillef/) for the handout part that appears right below the slide.

Since Segoe is a system installed font and must be declared separately using \setmainfont and BaskervilleF is loaded as a pacakge I'm not sure how this is done. I tried using Sabon previously and declared it as a new font and it worked as intended but I just liked BaskervilleF more (just a perfonal prefernce). So, I was wondering if this can be done without too much hassle, in which case I would just go ahead with Sabon.

P.S: I don't like the Baskervville font from the Google font (https://fonts.google.com/specimen/Baskervville?query=basker), it's just not the same.

Thanks in advance.

Here's the MWE:

\documentclass[aspectratio=169]{beamer}

\usepackage{pgfpages}
\makeatletter 
\def\beamer@framenotesbegin{
    \usebeamercolor[fg]{normal text}
    \gdef\beamer@noteitems{}% 
    \gdef\beamer@notes{}% 
}

\defbeamertemplate*{note page}{custom}
{%
    {%
        \scriptsize
        \usebeamerfont{note title}\usebeamercolor[fg]{note title}%
        \ifbeamercolorempty[bg]{note title}{}{%
            \insertvrule{.25\paperheight}{note title.bg}%
            \vskip-.25\paperheight%
            \nointerlineskip%
        }%
        \nointerlineskip
        \vbox to .25\paperheight{\vskip0.5em
            %\hbox{\insertshorttitle[width=0.75\textwidth]}%
            \setbox\beamer@tempbox=\hbox{\insertsection}%
            \hbox{\ifdim\wd\beamer@tempbox>1pt{\hskip4pt\raise3pt\hbox{\vrule
                        width0.4pt height7pt\vrule width 9pt
                        height0.4pt}}\hskip1pt\hbox{\begin{minipage}[t]{0.71\textwidth}\def\breakhere{}\insertsection\end{minipage}}\fi%
            }%
            \setbox\beamer@tempbox=\hbox{\insertsubsection}%
            \hbox{\ifdim\wd\beamer@tempbox>1pt{\hskip17.4pt\raise3pt\hbox{\vrule
                        width0.4pt height7pt\vrule width 9pt
                        height0.4pt}}\hskip1pt\hbox{\begin{minipage}[t]{0.71\textwidth}\def\breakhere{}\insertsubsection\end{minipage}}\fi%
            }%
            \setbox\beamer@tempbox=\hbox{\insertshortframetitle}%
            \hbox{\ifdim\wd\beamer@tempbox>1pt{\hskip30.8pt\raise3pt\hbox{\vrule
                        width0.4pt height7pt\vrule width 9pt
                        height0.4pt}}\hskip1pt\hbox{\insertshortframetitle[width=0.67\textwidth]}\fi%
            }%
            \vfil}%
    }%
    \ifbeamercolorempty[bg]{note page}{}{%
        \nointerlineskip%
        \insertvrule{.75\paperheight}{note page.bg}%
        \vskip-.75\paperheight%
    }%
    \vskip.25em
    \nointerlineskip
    \insertnote
}
\makeatother

\setbeamersize{text margin left=7mm,text margin right=7mm}
\usetheme[sectionpage=progressbar,subsectionpage=progressbar,progressbar=frametitle]{metropolis}
\usecolortheme{dove}
\useinnertheme{rectangles}

\setbeamertemplate{note page}[custom]
\setbeameroption{show notes on second screen=bottom}
\setbeamercolor{note title}{fg=black,bg=gray!30}
\setbeamercolor{note page}{fg=black,bg=white}
\setbeamerfont{note page}{size=\scriptsize}
\addtobeamertemplate{note page}{\setbeamerfont{itemize/enumerate subbody}{size=\scriptsize}}{}
\addtobeamertemplate{note page}{\setbeamerfont{itemize/enumerate subsubbody}{size=\tiny}}{}

\renewcommand*\footnoterule{}
\setbeamerfont{footnote}{size=\tiny}

%Font
\usepackage{fontspec}
\setmainfont{Segoe UI}
\usepackage{newtxmath}
\setmonofont{Roboto Mono}
\newfontfamily{\Sab}{SabonLTStd-Roman}
\setbeamerfont{note title}{family=\Sab}
\setbeamerfont{note page}{family=\Sab}
\let\sfdefault\rmdefault
%

%%
%Bold frametitle
\setbeamerfont{frametitle}{size=\Large,series=\bfseries}
%
%Bold block title
\setbeamerfont{block title}{series=\bfseries}
%
%%

\title{title}
\author{author}
\date{\today}

\begin{document}
    \begin{frame}[plain]
        \maketitle
        \note{This handout contains the slides used in the video and corresponding notes. Candidates are advised to use this handout as a supplement to the video lectures.}
    \end{frame}
    
    \begin{frame}
        content...
    \end{frame}
\end{document}
2
  • 1
    You don't need \usepackage{amsmath} as beamer automatically loads this for you and \usepackage{float} does not make a lot of sense in a document class without floating mechanism Sep 25 at 8:23
  • @samcarter_is_at_topanswers.xyz Actually I hacked most of the code from other templates, and this is just for making a handout, so if the file compiles and the output looks good, it's all good with me. But thanks for pointing it out, I will remove them. Sep 29 at 4:43

1 Answer 1

2

Per the baskervillef documentation, the package comes with fontspec-compatible OpenType fonts. As a result, your TeX distribution should be able to detect the fonts inside its default file paths.

Consequently, all you need to do is to replace your three lines of Sabon with three lines of Baskerville:

\newfontfamily{\baskerville}{baskervillef}
\setbeamerfont{note title}{family=\baskerville}
\setbeamerfont{note page}{family=\baskerville}
1
  • Thanks so much for the quick reply. It works perfectly. Sep 25 at 5:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .