6

This is a follow-up question to Equations, change the font size

I was trying to have equal font sizes in equations like the ones in the above link. Using \DeclareMathSizes{display size}{text size}{script size}{subscript size} gives me desired effects in article, exam classes but no effect in beamer slides.

Any suggestion please to see the effects in beamer slides!

My MWE is:

\documentclass{beamer}
\usetheme{Warsaw}
\DeclareMathSizes{12}{24}{24}{24}
\begin{document}

\begin{frame}
\frametitle{test equation to have a same font size}
    \[
           x = \frac{1}{x + \frac{1}{x + \frac{1}{x}}}
    \]
\end{frame}

\end{document}

and its output is: enter image description here

  • 1
    Add the 12pt class option as in my example: \documentclass[12pt]{beamer}, or use \makeatletter\DeclareMathSizes{\@xipt}{24}{24}{24}\makeatother as egreg suggested. . – Gonzalo Medina Sep 20 '12 at 13:47
  • @Gonzalo Medina, Oh sorry, yes, it works after putting 12pt in class option. Thank you so much for the help. – Khaaba Sep 21 '12 at 5:34
6

The default text size used by beamer is 11pt, which must be referred to as \@xipt. Just for an example I tried very big math font sizes, using the Arev fonts to overcome problems in font loading:

\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage{arevtext,arevmath}
\usefonttheme{professionalfonts}

\makeatletter
\DeclareMathSizes{\@xipt}{50}{40}{30}
\makeatother

\begin{document}
\begin{frame}
Text $m_{a}+t+\sqrt{h}$
\end{frame}
\end{document}

enter image description here

Similar declarations should be made for the other sizes, if you plan to use math in \large, \small or similar contexts.

However, I don't think that changing the math sizes is a good thing to do.


After seeing the minimal example and the real problem you have, I suggest you to use the \cfrac command provided by amsmath.

\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{amsmath}
\begin{document}

\begin{frame}
\frametitle{test equation to have a same font size}
    \[
           x = \cfrac{1}{x + \cfrac{1}{x + \cfrac{1}{x}}}
    \]
\end{frame}

\end{document}

enter image description here

0

While methods given by @GonzaloMedina and @egreg work perfectly fine in cases, I have also found another method from wikibook from here-> http://en.wikibooks.org/wiki/LaTeX/Advanced_Mathematics. Very handy to use command: \everymath{\displaystyle} in the preamble. You can also use in the localized equation like:

\begin{equation}
x = a_0 + \frac{1}{\displaystyle a_1
      + \frac{1}{\displaystyle a_2
      + \frac{1}{\displaystyle a_3 + a_4}}}
\end{equation}

Note: \DeclareMathSizes{display size}{text size}{script size}{subscript size} failed in one of my big beamer file which has tikz along with many other packages.

  • 1
    You should check the \cfrac macro provided by amsmath. For this application \DeclareMathSizes is clearly overkill. – egreg Sep 27 '12 at 14:10
  • @egreg, thank you. I saw that too just now in amsmdoc. Yes, \DeclareMathSizes makes overlapping of numerator and denominator expressions sometimes. – Khaaba Sep 27 '12 at 14:32
0

Using \dfrac instead of \frac in an equation can also have the desired effect. For in-line math mode you should always use \frac, but on display mode \dfrac looks better in my opinion.

-1

You can use the same method as customizing the normal text size ...

\fontsize{9.5}{7.2}{
 \begin{equation}
\psi = \psi^{s}+\tilde{\psi} 
 \end{equation}  
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.