Using soul package, I try to underline in black a text containing some words. One of the words is colored in grey.

    \ul{Hello \textcolor{Gray}{this} is an example}

Produces the error: "Package soul Error: Reconstruction failed."
I tried a dirty solution:

\ul{Hello }\textcolor{Gray}{\ul{this}}\ul{ is an example}

which doesn't produce error, but underlines my text with a Gray line. I'd like to underline in black.


  • 2
    Please help us (and also you) and add a minimal working example (MWE), that illustrates your problem.
    – Bobyandbob
    Aug 18, 2017 at 17:42
  • Sorry, as there is no special environnement (except soul package in tags) I thought it was clear enought withou MWE. I edited to make it better for future use. thanks
    – mquantin
    Aug 19, 2017 at 8:46

1 Answer 1


Package soul can support commands without and with one argument. \textcolor uses two arguments, therefore a new command is defined in the following example for \soulregister.

The different line color can be fixed by setting the color for the line explicitly using \setulcolor.




  \ul{Hello \ColorGray{this} is an example}


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.