129

I would like some portion of the text to have all three features but it's not compiling. It works two at a time but not with all three.

\hl{\textbf{foo}}
\hl{\textcolor{red}{foo}}
\textbf{\textcolor{red}{foo}}

The above three work but this doesn't

\hl{\textbf{\textcolor{red}{foo}}}

I have tried all 6 combinations.. I think.

Thanks

Amatya
  • 1,885

2 Answers2

157

Put \hl{..} inside.

\documentclass{report}
\usepackage{color,soul}
\begin{document}
  \hl{foo}
  \hl{\textbf{foo}} 
  \textcolor{red}{foo}
  \textbf{\textcolor{red}{\hl{foo}}}
  \textcolor{red}{\textbf{\hl{foo}}}
\end{document}

enter image description here

95
\documentclass{article}
\usepackage{xcolor}
\begin{document}
~\\
\colorbox{pink}{highlight}\\
\colorbox{green}{highlight}\\
\colorbox{yellow}{highlight}\\
\bfseries\colorbox{pink}{highlight + boldface}\\
\colorbox{green}{highlight + boldface}\\
\colorbox{yellow}{highlight + boldface}\\
\color{red}\colorbox{pink}{highlight  + boldface  + colored text}\\
\colorbox{green}{highlight  + boldface + colored text}\\
\colorbox{yellow}{highlight  + boldface  + colored text}\\
\color{red}\colorbox{pink}{\parbox{10cm}{
highlight  + boldface  + long long long  long long long long long long long long long long long long long long long colored text}}\\
\color{red}\colorbox{green}{\parbox{10cm}{
highlight  + boldface  + long long long  long long long long long long long long long long long long long long long colored text}}\\
\color{red}\colorbox{yellow}{\parbox{10cm}{
highlight  + boldface  + long long long  long long long long long long long long long long long long long long long colored text}}\\
\end{document}

enter image description here

SDrolet
  • 4,908