![Аргумент \language@active@arg< имеет дополнительный }](https://rvso.com/image/475737/%D0%90%D1%80%D0%B3%D1%83%D0%BC%D0%B5%D0%BD%D1%82%20%5Clanguage%40active%40arg%3C%20%D0%B8%D0%BC%D0%B5%D0%B5%D1%82%20%D0%B4%D0%BE%D0%BF%D0%BE%D0%BB%D0%BD%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9%20%7D.png)
У меня есть маленький MWE:
\batchmode
\documentclass[twoside]{book}
\usepackage[spanish]{babel}
\begin{document}
\chapter{Referencia \texorpdfstring{$<$}{<} }
\end{document}
И это приводит (с pdflatex) к ошибке:
! 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.
...
Есть ли какие-нибудь предложения, как решить эту проблему в общем случае? (проблема возникает и с другими персонажами в textorpdfstring
)
решение1
Хм... вы слишком сильно уменьшили MWE. Разве вы не должны hyperref
также загрузить его? В любом случае, <
он активен по умолчанию в испанском babel. Мое решение (учитывая, что я все равно использую кодировку unicode/utf8) — использовать всегда:
\documentclass[twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[spanish, es-noshorthands, shorthands=off]{babel}
\usepackage{hyperref}
\begin{document}
\chapter{Referencia \texorpdfstring{$<$}{<} }
\end{document}
Это работает почти везде.