![El argumento de \language@active@arg< tiene un } extra](https://rvso.com/image/475737/El%20argumento%20de%20%5Clanguage%40active%40arg%3C%20tiene%20un%20%7D%20extra.png)
Tengo el MWE pequeño:
\batchmode
\documentclass[twoside]{book}
\usepackage[spanish]{babel}
\begin{document}
\chapter{Referencia \texorpdfstring{$<$}{<} }
\end{document}
Y esto da como resultado (con pdflatex) el error:
! 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.
...
¿Alguna sugerencia sobre cómo solucionar esto de forma general? (El problema también ocurre con otros personajes en textorpdfstring
)
Respuesta1
Hmm... redujiste demasiado el MWE. ¿No deberías cargar hyperref
también? De todas formas, <
viene activado por defecto en babel español. Mi solución (dado que uso la codificación Unicode/utf8 de todos modos) es usar siempre:
\documentclass[twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[spanish, es-noshorthands, shorthands=off]{babel}
\usepackage{hyperref}
\begin{document}
\chapter{Referencia \texorpdfstring{$<$}{<} }
\end{document}
Eso funciona en casi todas partes.