7

I am writing a presentation with beamer

\documentclass[a4paper]{beamer}
\usepackage{amsmath}
\begin{document}
\begin{frame}
\[\hat{H}=\sum(-\frac{\nabla_i^2}{2m})+\sum(-\frac{\nabla_i^2}{2M})+\dots\]
\end{frame}
\end{document}

Now, I want to show in my presentation that we can ignore the 2nd term \sum(-\frac{\nabla_i^2}{2M}) possibly putting a cross over it. So, in the next frame, I will like to have

\[\hat{H}=\sum(-\frac{\nabla_i^2}{2m})+
\A_RED_CROSS_OVER_THIS_TERM{\sum(-\frac{\nabla_i^2}{2M})}+\dots\]

Is this possible?

EDIT

\documentclass[a4paper]{beamer}
\usepackage{amsmath,color}
\definecolor{red}{RGB}{255,127,0}
\usepackage[makeroom]{cancel}
\renewcommand{\CancelColor}{red}
\begin{document}
\begin{frame}
  \[\hat{H}=\sum(-\frac{\nabla_i^2}{2m})+\xcancel{\sum(-\frac{\nabla_i^2}{2M})}+\dots\]
\end{frame}
\end{document}

Tried this, and color has not changed.

4
  • Try the package cancel and the command \cancel{<expression>} or \xcancel{<expression>}. You can even redefine the color if you use the color package and the command \renewcommand{\CancelColor}{<color_command>}.
    – Ludovic C.
    Jul 12, 2013 at 10:36
  • @LudovicC., sorry if I was not quite clear, but I think \xcancel gives a boring X over the term. I am looking for a visually attractive red cross. i.e. \xcancel with color
    – BaRud
    Jul 12, 2013 at 10:39
  • see my edit of the comment.
    – Ludovic C.
    Jul 12, 2013 at 10:39
  • here is the documentation of the cancel package for you to customize the display of the cross ftp.oleane.net/pub/CTAN/macros/latex/contrib/cancel/cancel.pdf
    – Ludovic C.
    Jul 12, 2013 at 10:41

2 Answers 2

12

The definition of \CancelColor does not take a color but a color command:

\documentclass[a4paper]{beamer}
\usepackage{amsmath,color}
\definecolor{red}{RGB}{255,127,0}
\usepackage[makeroom]{cancel}
\renewcommand{\CancelColor}{\color{red}}
\begin{document}
\begin{frame}
  \[\hat{H}=\sum(-\frac{\nabla_i^2}{2m})+\xcancel{\sum(-\frac{\nabla_i^2}{2M})}+\dots\]
\end{frame}
\end{document}

Result

5
\documentclass[a4paper]{beamer}
\usepackage{stackengine}
\usepackage{scalerel}
\usepackage{amsmath,color}
\definecolor{red}{RGB}{255,127,0}
\begin{document}
\def\x{\displaystyle\sum(-\frac{\nabla_i^2}{2M})}
\begin{frame}
  \[\hat{H}=\sum(-\frac{\nabla_i^2}{2m})+\stackengine{-.3ex}{$\x$}%
{\hstretch{3}{\scalerel*{\textcolor{red}{\times}}{\x}}}%
{O}{c}{F}{T}{L}%
+\dots\]
\end{frame}
\end{document}

enter image description here

One advantage to using this approach is that the crossout material can be anything. Changing the \hstretch from 3 to 0.6 and changing \times to something else gives

enter image description here

Make sure you have V2.0 of stackengine, available at ctan.org

You must log in to answer this question.

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