Here is my piece of code
\documentclass{article}
\usepackage{color,soul}
\begin{document}
\begin{quote}
\tt\
\ul{{\color{red}text}}.
\end{quote}
\end{document}
This simple piece of code generates a word "text" in red with an underline. However, if you just add a space after the word "text" or a space followed by a word, like
\documentclass{article}
\usepackage{color,soul}
\begin{document}
\begin{quote}
\tt\
\ul{{\color{red}text text}}.
\end{quote}
\end{document}
it will generate an error like
! Package soul Error: Reconstruction failed.
See the soul package documentation for explanation.
Type H <return> for immediate help.
...
l.9 \ul{{\color{red}text text}}
.
Can somebody tell me why is that? How can I do both color and underline but I can control the color of the underline?
{\color{red}text} text
inside\ul
\tt
command.