Possible Duplicate:
Custom command inside soul package's \hl
To make the document easier to understand (and easier to write), I have defined:
\newcommand{\code}[1]{\texttt{#1}}
I have used \code{some code} in hyperref and many many other places and everything has been fine.
However, now I used it with \ul (from soul package), like this:
\ul{\code{Hello}} world
and I get this warning:
! Argument of \code has an extra }.
<inserted text>
\par
l.52 \ul{\code{Hello}}
world
Is theresomething wrong with the way I am defining my command? If I use \ul{\texttt{Hello}} there is no problem. Shouldn't my code be effectively reduced to that?!
Note: I'm not looking for \code{\ul{Hello}} as an answer or similar things that change the text. The main reason is that I generate the text from another file that may decide to put the underline around the code. It would be much more difficult for me to change that order in text, than to fix the definition, or even replace all \codes with \texttts and forget about the macro altogether!