4

For some reason, using \cancel in the denominator of a fraction adds a certain height to the exponent (see minimal example below). Observe that it does not happen if the expression is in the numerator. Although the change is minimal, it becomes annoying (at least to me) when I use overlay in beamer. Is there any way to fix this?

\documentclass{beamer}
\usetheme[width=0.6in]{Hannover}
\usepackage{amsmath}                  
\usepackage{amsfonts}                 
\usepackage{amssymb}                  
\usepackage{mathrsfs}                 
\usepackage{cancel}                     
\usepackage[english]{babel}

\begin{document}
  \begin{frame}[t]
    $\dfrac{{\cancel{2^2}}\;2^2}{3^3\;\cancel{3^3}}$            

    \medskip $\dfrac{\vphantom{\cancel{2^2}}\only<2->{\cancel{2^2}}\only<1>{2^2}}
    {\vphantom{\cancel{3^3}}\only<1>{3^3}\only<2->{\cancel{3^3}}}$
  \end{frame}
\end{document}
4

In the denominator of a \dfrac, TeX uses the “cramped” textstyle, but there's no way to force it with the traditional \mathchoice command, which is used by \cancel. You need to help setting the “cramped” style manually (mathtools is needed).

\documentclass{beamer}
\usetheme[width=0.6in]{Hannover}
\usepackage{amsmath,mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{cancel}
\usepackage[english]{babel}

\begin{document}

\begin{frame}[t]

$\dfrac{{\cancel{2^2}}\;2^2}{3^3\;\cancel{\cramped{3^3}}}$

\medskip

$\dfrac{\vphantom{\cancel{2^2}}\only<2->{\cancel{2^2}}\only<1>{2^2}}
{\vphantom{\cancel{\cramped{3^3}}}\only<1>{\cramped{3^3}}\only<2->{\cancel{\cramped{3^3}}}}$

\end{frame}
\end{document}

enter image description here

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.