1

I'm preparing a mathematical talk here and have some problems with formatting. The theme of my university seems to force Arial (which I find ok), but that somehow also affects the appearance of mathematical symbols and letters. Here is an example: I write Most annoying are $\dot x$ and $L^1(0,T;\mathbb U)$ and get

enter image description here

Why is that \mathbb U so huge?

Here is an example file:

\documentclass[aspectratio=43]{beamer}
\usepackage{csquotes}
\usepackage{xcolor}
\usepackage{graphicx}

\title{I'm a Title}
\author{T. Author}
\institute{Great Uni}
\date{\today}

\def\footercontent{\insertsection}

% Load theme
\usetheme{TUIl}



\begin{document}
\titleframe

\frame{
    \frametitle{Outline}

    Hi folks. Try this: $\dot x$ and $\mathbb U$, while U.
}

Here are the four themes files:

beamerthemeTUIl.sty:

\mode<presentation>

% If you don't intend to use pictures in the first and last frame, you can remove the following two lines
\RequirePackage{tikz} % (tikz is needed for absolute placement independent of aspect ratio)
\usetikzlibrary{calc, positioning}

% Don't edit the text below

% No monospace font for URLs
\RequirePackage{url}
\urlstyle{same}

\RequirePackage{xcolor}
\RequirePackage{ifthen}

% interpret empty string for pictures as undefined
\newcommand{\undefineEmpty}[1]{
    \ifdefined#1
        \ifthenelse{\equal{#1}{}}{
            \let #1 \undefined
        }{}
    \fi
}
\undefineEmpty{\titleimage}
\undefineEmpty{\lastimage}

\ifthenelse{ % If aspect ratio is 4:3
    \lengthtest{\dimexpr\paperwidth*254/7227\relax=12.8pt}
    \AND
    \lengthtest{\dimexpr\paperheight*254/7227\relax=9.6pt}
}{ % define dimensions specific to 4:3 aspect ratio
    \def\frametitlev{2.5mm}
    \def\framesubtitlev{1mm}
    \def\bottompicscale{1.3}
    \def\footerdp{6mm}
    \def\footerht{7mm}

    % scale down font
    \def\fontscale{0.8}

    % set global margins
    \setbeamersize{text margin left=7mm,text margin right=5mm}
    \def\beamerleftmargin{7mm}
}{ % define geometry specific to 16:9/16:10 aspect ratio
    \def\frametitlev{0mm}
    \def\framesubtitlev{2.5mm}
    \def\bottompicscale{1}
    \def\footerdp{5mm}
    \def\footerht{6mm}

    % increase margins
    \def\fontscale{1}
    \renewcommand{\baselinestretch}{1.1}

    % set margin for itemize
    \let\olditemize=\itemize
    \let\endolditemize=\enditemize
    \renewenvironment{itemize}{\olditemize \itemsep1mm \parskip1mm}{\endolditemize}

    % set margin for enumerate
    \let\oldenum=\enumerate
    \let\endoldenum=\endenumerate
    \renewenvironment{enumerate}{\oldenum \itemsep1mm \parskip1mm}{\endoldenum}

    % set margin for description
    \let\olddescr=\description
    \let\endolddescr=\enddescription
    \renewenvironment{description}{\olddescr \itemsep1mm \parskip1mm}{\endolddescr}

    % set global margins
    \setbeamersize{text margin left=8mm,text margin right=5mm}
    \def\beamerleftmargin{8mm}
}

\ifdefined\titlesize\else
    \def\titlesize{18}
\fi
\ifdefined\subtitlesize\else
    \def\subtitlesize{13}
\fi

\ifdefined\Umathchardef
    % If XeLaTeX or LuaTeX, setup fontspec
    % First try Arial, then Helvetica and TeX Gyre Heros, last fallback option is Liberation Sans
    \usepackage{fontspec}
    \IfFontExistsTF{Arial} {
        \setsansfont[
            Ligatures=TeX,
            Scale=\fontscale,
            BoldFont={Arial Bold},
            ItalicFont={Arial Italic},
            BoldItalicFont={Arial Bold Italic}
        ]{Arial}
    }{
        \IfFontExistsTF{Helvetica} {
            \setsansfont[
                Ligatures=TeX,
                Scale=\fontscale,
                BoldFont={Helvetica Bold},
                ItalicFont={Helvetica Italic},
                BoldItalicFont={Helvetica Bold Italic}
            ]{Helvetica}
        }{
            \IfFontExistsTF{TeX Gyre Heros} {
                \setsansfont[
                    Ligatures=TeX,
                    Scale=\fontscale,
                    BoldFont={TeX Gyre Heros Bold},
                    ItalicFont={TeX Gyre Heros Italic},
                    BoldItalicFont={TeX Gyre Heros Bold Italic}
                ]{TeX Gyre Heros}
            }{
                \setsansfont[
                    Ligatures=TeX,
                    Scale=\fontscale,
                    BoldFont={Liberation Sans Bold},
                    ItalicFont={Liberation Sans Italic},
                    BoldItalicFont={Liberation Sans Bold Italic}
                ]{Liberation Sans}
            }
        }
    }
\else
    % if fontspec is not available, include the font packages accordingly
    \usepackage[T1]{fontenc}
    % Only use arial if installed, else fall back to hevetica
    \IfFileExists{uarial.sty}{
        \RequirePackage[scaled=\fontscale]{uarial}
    }{
        \RequirePackage[scaled=\fontscale]{helvet}
    }
\fi

% Define picture placement on first and last frame (not intended to be used manually)
\newcommand{\bottompic}[2]{
    \usebackgroundtemplate{
        \begin{tikzpicture}[remember picture,overlay]
            \node[text width=\paperwidth, anchor=south west,inner sep=0pt] (A) at ($(current page.south west)+(-0.2pt,\dimexpr{\footerdp + \footerht + 0.4mm})$) {
                \includegraphics[width=\bottompicscale\paperwidth]{#1} % Include picture
            };
            \node[text width=\paperwidth](B)[above=0 mm of A]{ % Add text above picture
                \hspace{\beamerleftmargin}\parbox{0.9\textwidth}{
                    \textcolor{TUIl-grey}{\tiny #2}
        }
            };
        \end{tikzpicture}
    }
}

% User commands
% Creates the titlepage (Extra command needed because bottompic needs to be set before creating the frame)
\newcommand{\titleframe}{
    {
        \ifdefined\titleimage
            \bottompic{\titleimage}{} %<- Don't change this
        \fi
        \frame {
            \titlepage
        }
    }
}

\newcommand{\imageframe}[6][TUIl-orange]{
    {
        % Set background picture
        \usebackgroundtemplate{
            \vbox to \paperheight{
                \vspace{-#6}
                \hspace{\dimexpr #5 - 0.8mm \relax}
                \includegraphics[width=#4\paperwidth]{#2}
            }
        }
        % Set color of the title
        \setbeamercolor{frametitle}{fg=#1}

        % Create frame
        \frame{
            \frametitle{#3}
        }
    }
}

\newcommand{\lastframe}[3]{
    {
        % Redefine subtitle (unset bfseries)
        \setbeamerfont{framesubtitle}{size*={9}{11}\selectfont\normalfont}
        \ifdefined\lastimage
            \bottompic{\lastimage}{#3}
        \fi

        % Redefine frame title to have a larger gap between title and subtitle
        \setbeamertemplate{frametitle}{
            \vspace{\frametitlev}
          \usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}\insertframetitle

          \vspace{5mm}
          \usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle
        }

        % Create frame
        \frame{
            \ifdefined\lastimage
                \frametitle{#1}
                \framesubtitle{#2}
            \else
                \usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}#1
                \vspace{5mm}

                \usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}#2
            \fi
        }
    }
}

\newcommand{\titlefont}[1]{
    \textcolor{TUIl-blue}{\textbf{#1}}
}

% Include other sty files
\useinnertheme{TUIl}
\useoutertheme{TUIl}
\usecolortheme{TUIl}

\mode<all>

beamerouterthemeTUIl.sty:

% Remove beamer navigation bar
\beamertemplatenavigationsymbolsempty

% footer/footline definition
\setbeamertemplate{footline}{
  \color{TUIl-green}{\rule{\textwidth}{0.3pt}} % Draw line
  \begin{beamercolorbox}[wd=\textwidth, dp=\footerdp, ht=\footerht]{footer}
    \begin{minipage}[t]{0.125\paperwidth} % Page number
      \hspace{7mm}
      \insertpagenumber
    \end{minipage}
    \begin{minipage}[t]{0.5\paperwidth} % Footer content
      \footercontent
    \end{minipage}
    \hfill
    \begin{minipage}[t]{42mm} % Logo
      \vspace{-5mm}
      \includegraphics[scale=.6]{images/tuil-logo.pdf}
    \end{minipage}
  \end{beamercolorbox}
}

beamerinnerthemeTUIl.sty

% frame title
\setbeamertemplate{frametitle}{
  \vspace{\frametitlev}
  \usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}\insertframetitle

  \vspace{\framesubtitlev}
  \usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertframesubtitle
}

% title page
\setbeamertemplate{title page}
{
  \ifdefined\titleimage
    \frametitle{\inserttitle}
    \framesubtitle{\insertsubtitle}
  \else
    \begin{center}
      \usebeamerfont{frametitle}\usebeamercolor[fg]{frametitle}\inserttitle

      \vspace{\framesubtitlev}
      \usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\insertsubtitle

      \vspace{1.5mm}
      \insertauthor\\
      {\scriptsize\insertinstitute}\\~\\
      {\small\insertdate}
    \end{center}
  \fi
}

beamercolorthemeTUIl.sty

% Color scheme definitions
\definecolor{TUIl-orange}{RGB}{255, 121, 0}
\definecolor{TUIl-blue}{RGB}{0, 51, 89}
\definecolor{TUIl-green}{RGB}{0, 116, 122}
\definecolor{TUIl-grey}{RGB}{165, 165, 165}

% = Font Colors =
% background
\setbeamercolor*{background canvas}{bg=white}

% title/subtitle
\setbeamercolor{frametitle}{fg=TUIl-orange}
\setbeamercolor{framesubtitle}{fg=TUIl-blue}

% text
\setbeamercolor*{normal text}{fg=TUIl-blue}

% itemize
\setbeamercolor*{itemize item}{fg=TUIl-orange}
\setbeamercolor*{itemize subitem}{fg=TUIl-blue}
\setbeamercolor*{itemize subsubitem}{fg=TUIl-blue}

% enumerate
\setbeamercolor*{enumerate item}{fg=TUIl-orange}
\setbeamercolor*{enumerate subitem}{fg=TUIl-blue}
\setbeamercolor*{enumerate subsubitem}{fg=TUIl-blue}

% block colors/style
\setbeamercolor{block body}{fg=TUIl-blue,bg=TUIl-blue!10!bg}
\setbeamercolor{block title}{parent=structure,fg=white,bg=TUIl-blue}
\setbeamertemplate{blocks}[rounded][shadow=false]

% alert
\setbeamercolor{alerted text}{fg=TUIl-orange}

% footer
\setbeamercolor*{footer}{bg=white, fg=TUIl-grey}
\setbeamercolor*{page number in head/foot}{fg=TUIl-grey}

% bibliography
\setbeamercolor{bibliography entry author}{fg=TUIl-blue}
\setbeamercolor{bibliography entry title}{fg=TUIl-blue}
\setbeamercolor{bibliography entry journal}{fg=TUIl-blue}
\setbeamercolor{bibliography entry note}{fg=TUIl-blue}

% = Font Sizes =
% title/subtitle
\setbeamerfont{frametitle}{size*={\the\numexpr \titlesize \relax}{\the\numexpr \titlesize + 1\relax}\selectfont,series=\bfseries}
\setbeamerfont{framesubtitle}{size*={\the\numexpr \subtitlesize \relax}{\the\numexpr \subtitlesize + 1 \relax}\selectfont}

% Font size for thebibliography environments
\setbeamerfont{bibliography entry author}{size=\footnotesize}
\setbeamerfont{bibliography entry title}{size=\footnotesize}
\setbeamerfont{bibliography entry journal}{size=\footnotesize}
\setbeamerfont{bibliography entry note}{size=\footnotesize}

% Font size for BibLaTeX (\printbibliography)
\@ifpackageloaded{biblatex}{\AtBeginBibliography{\footnotesize}}{}

% bullet points for itemize
\defbeamertemplate{itemize item}{image}{\tiny \raisebox{0.5ex}{$\bullet$}}
\defbeamertemplate{itemize subitem}{image}{\tiny \raisebox{0.5ex}{$\bullet$}}
\defbeamertemplate{itemize subsubitem}{image}{\tiny \raisebox{0.5ex}{$\bullet$}}

\setbeamertemplate{itemize item}[image]
\setbeamertemplate{itemize subitem}[image]
\setbeamertemplate{itemize subsubitem}[image]

% bibliography icons
\setbeamertemplate{bibliography item}{\lower3.5pt\hbox{\hskip2pt\scalebox{0.7}{\pgfuseimage{beamericonarticle}}\hskip1pt}}
4
  • Please extend this to a full example others can copy and test on their own
    – daleif
    Apr 28, 2021 at 12:56
  • Ok, I added an example and the four theme files.
    – amsmath
    Apr 28, 2021 at 14:13
  • Could this be related to the fact that the Arial font does not have the character and therefore LaTeX defaults to a different font with another overall size? Something like that should be found in your log-files, I suppose.
    – Markus G.
    Apr 28, 2021 at 16:04
  • @MarkusG. Log file says the following concerning "Arial": (C:\Users\fmphi\AppData\Roaming\MiKTeX\2.9\tex/latex/arial\t1ua1.fd File: t1ua1.fd 2006/03/21 Fontinst v1.928 font definitions for T1/ua1. ) LaTeX Font Info: Font shape T1/ua1/m/n will be (Font) scaled to size 8.76003pt on input line 285. Line 285 starts with "\begin{document}" ;-)
    – amsmath
    Apr 28, 2021 at 16:38

0

You must log in to answer this question.

Browse other questions tagged .