![O argumento de \idioma@ativo@arg< tem um } extra](https://rvso.com/image/475737/O%20argumento%20de%20%5Cidioma%40ativo%40arg%3C%20tem%20um%20%7D%20extra.png)
Eu tenho o pequeno MWE:
\batchmode
\documentclass[twoside]{book}
\usepackage[spanish]{babel}
\begin{document}
\chapter{Referencia \texorpdfstring{$<$}{<} }
\end{document}
E isso resulta (com pdflatex) no erro:
! Argument of \language@active@arg> has an extra }.
<inserted text>
\par
l.5 \chapter{Referencia \texorpdfstring{$<$}{<} }
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
Runaway argument?
! Paragraph ended before \language@active@arg> was complete.
<to be read again>
\par
l.5 \chapter{Referencia \texorpdfstring{$<$}{<} }
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
...
Alguma sugestão sobre como resolver isso de uma forma geral? (o problema também ocorre com outros personagens em textorpdfstring
)
Responder1
Hmm... você reduziu demais o MWE. Você não deveria carregar hyperref
também? De qualquer forma, <
está ativado por padrão no babel espanhol. Minha solução (considerando que eu uso a codificação unicode/utf8 de qualquer maneira) é usar sempre:
\documentclass[twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[spanish, es-noshorthands, shorthands=off]{babel}
\usepackage{hyperref}
\begin{document}
\chapter{Referencia \texorpdfstring{$<$}{<} }
\end{document}
Isso funciona em quase todos os lugares.