My question is related to: Strikeout in different color appears behind letters, not on top of them, except that I use beamer instead of article. Therefore, the solution provided there is somehow not working. The example I have at hand is:
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
\documentclass[t, 10 pt, mathserif]{beamer}
\usepackage{xparse,soul}
\makeatletter
\NewDocumentCommand{\sotwo}{O{red}O{black}+m}
{%
\begingroup
\setulcolor{#1}%
\setul{-.5ex}{.4pt}%
\def\SOUL@uleverysyllable{%
\rlap{%
\color{#2}\the\SOUL@syllable
\SOUL@setkern\SOUL@charkern}%
\SOUL@ulunderline{%
\phantom{\the\SOUL@syllable}}%
}%
\ul{#3}%
\endgroup
}
\makeatother
\begin{document}
Hello \sotwo{Welt} World!
\sotwo[green]{Here is a long sentence that will span across a number of lines to force a linebreak}
\sotwo[green][blue]{Here is a long sentence that will span across a number of lines to force a linebreak}
Here is a long sentence that will span across a number of lines to force a linebreak
\end{document}
Any ideas will be greatly appreciated! Thanks!
beamer
but may be some of these ideas can help you: tex.stackexchange.com/q/5959/1952, tex.stackexchange.com/a/116907/1952