0

I would like to create slides where some sections of texts are replaced by underscores (or an underline of equivalent length) in the student handouts.

I have seen this solution but it only "blanks" the text. What I would like to do is replace it with underscores.

I have also seen this solution based on a customized \hideit command but I do not know how to replace the mbox by the appropriate number of underscores _ characters.

ECM taken from the second link:

\documentclass[handout]{beamer} 

\begin{document}

\begin{frame}{Test}

\begin{itemize}
\item Example of itemize:
  \mode<handout>{%
  \item Some text _____________________ 
  }%
  \mode<beamer>{%
  \item Some text to be replaced by underscores
  }%
  \item This is visible in both handout and presentation.
\end{itemize}
\end{frame}

\end{document}
1

1 Answer 1

2

If you want to replace some text with the equivalent width of underscores, you could use \underline{\phantom{some text}}. The following command creates both versions:

\documentclass[%
handout
]{beamer} 

\newcommand{\hide}[1]{%
\only<handout>{\underline{\phantom{#1}}}%
\only<beamer>{#1}%
}

\begin{document}

\begin{frame}{Test}

\begin{itemize}
\item Example of itemize:
\item Some text to \hide{be replaced with underscores}
\item This is visible in both handout and presentation.
\end{itemize}
\end{frame}

\end{document}

enter image description here

1
  • Perfect! I haven't tested line returns, etc. But I'll make it involve. Thanks a lot!
    – Peutch
    Sep 6, 2016 at 17:44

You must log in to answer this question.

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