Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In a beamer frame I have a item list

\begin{itemize}
\item<1-> World peace
\item<2-> Peace in our neighbourhood
\end{itemize}

How can I strike through the first item on the second (overlay) slide?

Slide 1:

  • World Peace

Slide 2:

  • World Peace
  • Peace in our neighbourhood
share|improve this question

2 Answers 2

up vote 10 down vote accepted

You can use the \only notation and the ulem package for strike through. The code would look like this:

\documentclass{beamer}
\usepackage{ulem}
\begin{document}
  \begin{frame}
    \begin{itemize}
      \item\only<1>{World peace}\only<2->{\sout{World peace}}
      \item<2-> Peace in our neighbourhood
    \end{itemize}
  \end{frame}
\end{document}

Update: Alternatively, you can use beamer's facilities to create an overlay aware version of the \sout command. That is done as follows:

\documentclass{beamer}
\usepackage{ulem}
\renewcommand<>{\sout}[1]{
  \only#2{\beameroriginal{\sout}{#1}}
  \invisible#2{#1}
}
\begin{document}
  \begin{frame}
    \begin{itemize}
      \item\only<1>{World peace}\only<2->{\sout{World peace}}
      \item<2-> Peace in our neighbourhood
      \item<3-> \sout<3>{Peace struck}
      \item<4-> Peace unstruck
    \end{itemize}
  \end{frame}
\end{document}

This basically states that the argument to \sout should be struck through on slides matching the overlay specifier and should be shown normally on slides that don't match it. I like this method a little better, because it is more concise in the slides itself. Note that it plays nicely together with the overlay specifier on the item. That is, if you were to remove the overlay specifier on \item<3-> the Peace struck would be shown without being struck through on slides 1 and 2 as well. The original method still works as well after the redefinition of \sout.

share|improve this answer

I know that this topic is old, but I've tried Roelof Spijker's solution and it has a small drawback. Ideed, the following code:

\documentclass{beamer}
\usepackage{ulem}
\renewcommand<>{\sout}[1]{
  \only#2{\beameroriginal{\sout}{#1}}
  \invisible#2{#1}
}
\begin{document}
  \begin{frame}
    \begin{itemize}
      \item \sout<2>{World Peace} \onslide<2>{World War}
    \end{itemize}
  \end{frame}
\end{document}

would give the following result on slide 2:

  • World Peace                             World War

with a big blank corresponding to an invisible "World Peace". In addition, one may have issues with a long item text because of this blank.

I think the following macro would be more suitable:

\documentclass{beamer}
\usepackage{ulem}
\renewcommand<>{\sout}[1]{
  \alt#2{\beameroriginal{\sout}{#1}}{#1}
}

which actually results in

Slide 2:

  • World Peace World War
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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