1

I want to highlight some text using package soul. However, I fail setting the color transparency, which is normally possible by writing !trans_value after the color. As soon as I add this transparency value to the color:

  \begingroup
  \sethlcolor{red!30}%
  \hl{some text here}%
  \endgroup

It only colors the white spaces between the words. How can I fix this?

2

A workaround:

\documentclass{article}
\usepackage{xcolor}
\usepackage{soul}

\colorlet{soulred}{red!30}

\begin{document}

\begingroup
  \sethlcolor{soulred}%
  \hl{some text here}%
\endgroup

\end{document}

Result

BTW, the part after ! in xcolor's color expressions has nothing to do with transparency. It means rather mixing with another color: 30 % red + 70 % white.

2
\documentclass{article}
\usepackage{xcolor,soul}
\begin{document}
\colorlet{usercolorname}{red!30}
\sethlcolor{usercolorname}
\hl{some text here}
\end{document}

enter image description here

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.