Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm having trouble with the soul package and its \hl command. The soul package's manual says I should not nest soul commands, which I didn't. \textsc works inside \hl. However, the following throws an Argument of \name has an extra } error:

\documentclass[a4paper,12pt,]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{soulutf8}
\usepackage{color}

\newcommand{\name}[1]{\textsc{#1}}

\begin{document}
% this one works
Hello \hl{\textsc{Calvin}}!

% this one will throw an error, with both soul and soulutf8
Hello \hl{\name{Calvin}}!
\end{document}

Am I missing something in the way that \newcommand works? Is this a known problem with the soul package? Any other suggestions for highlighting text - which may be longer and thus needs to be wrapped?

Thanks for your reply.

share|improve this question

1 Answer 1

See the documentation of soul "Adding font commands" (page 15).

\soulregister{\name}{1}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.