3

I'm trying to use uwave and cleveref together:

\documentclass{article}
\usepackage{ulem}
\usepackage{cleveref}
\begin{document}
\uwave{\cref{sec:A}}
\section{A}
\label{sec:A}
\end{document}

After calling pdflatex twice, I get following output:

! Extra }, or forgotten \endgroup. \UL@stop ...z@ \else \UL@putbox \fi \else \egroup \egroup \UL@putbox \fi \if... l.5 \uwave{\cref{sec:A}}

?

What am I doing wrong or whom should I ask for a fix?

Similar effect with soulpos and cleveref:

\documentclass{article}
\usepackage{xcolor}
\usepackage{soul}
\usepackage{cleveref}
\begin{document}
\hl{\cref{sec:A}}
\section{A}
\label{sec:A}
\end{document}

! Argument of \cref has an extra }. \par l.6 \hl{\cref{sec:A}}

?

  • Off-topic comment: Is it really necessary to use \uwave for references? – user31729 Oct 3 '15 at 15:30
  • It is a MCVE showing as little commands and text as possible. The use case is to track changes in a document. Instead of using the changes package, I use \uwave and \pdfcomment to highlight changes and to explain them. – koppor Oct 3 '15 at 18:20
3

In these cases, add \mbox around the offending piece; it works also with soul.

\documentclass{article}
\usepackage{ulem}
\usepackage{cleveref}

\begin{document}

\uwave{\mbox{\cref{sec:A}}}

\section{A}
\label{sec:A}

\end{document}

enter image description here

  • For the record: The box keeps the text together. I've defined a command \citet mirroring natbis's command: \newcommand{\citet}[1]{\citeauthor{#1} \cite{#1}}. Putting an mbox around \citet might cause strange layouts. But it's good enough for me... – koppor Oct 3 '15 at 18:33

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.