20
\documentclass{beamer} 
\usepackage{soul,color} 
\begin{document} 
\begin{frame} 
\hl{Hello World} 
\end{frame} 
\end{document}

I process this with pdflatex and I do not see the expected highlight. If I try to assign a color to overstrike same thing happens, as in

\setstcolor{red}
\st{Hello}

but \st{hello} by itself does overstrike hello in black when no color is set. Why is that and what is a work-around? Many That I tried do not work with long text.

The Soul Package Documentation, footnote 5, says something about needing a Postscript driver.

I do not have a problem using soul package outside of beamer.

29

beamer redefines nearly anything ... So we have to redefine \set@color and reset@color to its original definition before using \hl:

\documentclass{beamer}
\usepackage{soul}
\makeatletter
\let\HL\hl
\renewcommand\hl{%
  \let\set@color\beamerorig@set@color
  \let\reset@color\beamerorig@reset@color
  \HL}
\makeatother
\begin{document}
\begin{frame}   
Hello World

\hl{Hello World} 
\end{frame}
\end{document}

enter image description here

  • This works also e.g. for \ul{...}. Could you add a bit of explanation how? Thanks! – fuenfundachtzig Jul 9 '18 at 21:20

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.