3

Here I have a MWE showing that the font size of my text in math mode is not affected by me changing the default size using \DeclareMathSizes but is changed when outside my tcolorbox. What can I do to fix this?

\documentclass{beamer}
\usepackage[most]{tcolorbox}

\newtcboxfit{\myboxSlideBody}{
                    fit basedim=14pt,
                    % standard jigsaw,
                    % opacityback=0,
                    % opacityframe=0,
                    colframe=green,
                    height=5.9cm,
                    width=10cm,
                    valign=top,
                    halign=left,
                    right=0pt,
                    left=0pt,
                    top=0pt,
                    bottom=0pt
                    }

\newcommand{\framebody}[1]{
\vskip-0.25cm
\hspace*{-0.56cm}
\begin{minipage}{1.1\textwidth}
\myboxSlideBody{#1}\par%
\end{minipage}
}

\makeatletter
\DeclareMathSizes{\f@size}{18}{14}{12}
\makeatother


\begin{document}

\begin{frame}{Frame Title}
$\vec{G} = \left\langle x,y,z\right\rangle$
\vskip0.5cm
\framebody{
$\vec{G} = \left\langle x,y,z\right\rangle$
}
    
\end{frame}

\end{document}

1 Answer 1

4

in the preamble \f@size is 10.95 so you declared math fonts for that text size, but \f@size is 14 in your frame, so gets the standard setting.

\documentclass{beamer}
\usepackage[most]{tcolorbox}

\newtcboxfit{\myboxSlideBody}{
                    fit basedim=14pt,
                    % standard jigsaw,
                    % opacityback=0,
                    % opacityframe=0,
                    colframe=green,
                    height=5.9cm,
                    width=10cm,
                    valign=top,
                    halign=left,
                    right=0pt,
                    left=0pt,
                    top=0pt,
                    bottom=0pt
                    }

\newcommand{\framebody}[1]{
\vskip-0.25cm
\hspace*{-0.56cm}
\begin{minipage}{1.1\textwidth}
\myboxSlideBody{#1}\par%
\end{minipage}
}

\makeatletter
\DeclareMathSizes{\f@size}{18}{14}{12}
%\makeatother
\def\qqq{\show\f@size}
\qqq
\begin{document}

\begin{frame}{Frame Title}
\qqq
$\vec{G} = \left\langle x,y,z\right\rangle$
\vskip0.5cm
\framebody{\qqq
$\vec{G} = \left\langle x,y,z\right\rangle$
}
    
\end{frame}

\end{document}

enter image description here

\documentclass{beamer}
\usepackage[most]{tcolorbox}

\newtcboxfit{\myboxSlideBody}{
                    fit basedim=14pt,
                    % standard jigsaw,
                    % opacityback=0,
                    % opacityframe=0,
                    colframe=green,
                    height=5.9cm,
                    width=10cm,
                    valign=top,
                    halign=left,
                    right=0pt,
                    left=0pt,
                    top=0pt,
                    bottom=0pt
                    }

\newcommand{\framebody}[1]{
\vskip-0.25cm
\hspace*{-0.56cm}
\begin{minipage}{1.1\textwidth}
\myboxSlideBody{#1}\par%
\end{minipage}
}

\makeatletter
\DeclareMathSizes{10.95}{18}{14}{12}
\DeclareMathSizes{14}{18}{14}{12}
\makeatother

\begin{document}

\begin{frame}{Frame Title}

$\vec{G} = \left\langle x,y,z\right\rangle$
\vskip0.5cm
\framebody{
$\vec{G} = \left\langle x,y,z\right\rangle$
}
    
\end{frame}

\end{document}
2
  • Is there a way I can reference it as a variable similar to calling \f@size?
    – David G.
    Feb 21, 2023 at 19:10
  • 1
    @DavidG. no it is not a set of numbers looked up in the document it is a preamble command which is used at \begin{document} to iterate through all the math fonts declared at that point and set them up at the specified sizes. Feb 21, 2023 at 19:17

You must log in to answer this question.

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