I'm trying to dashed underline a word in a caption using the ulem package. While the \dashuline{} command works fine everywhere else, I get "Undefined control sequence" as error message in caption.

    While it does work \dashuline{here}
    \caption{It does not work \dashuline{here}}

Has anyone an idea why it doesn't work and how to get it working?

  • This does work correctly with ulem (and it should have been the case already back then given the last update of the package), ie \dashuline is already robust! Jun 20, 2018 at 20:42

1 Answer 1


Protecting the command should solve the problem:




    While it does work \dashuline{here}
    \caption{It does not work \protect\dashuline{here}}


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.