# Argument of \language@active@arg" has an extra } — but shorthands should stay

I am trying to fix a problem that had not appeared earlier. Maybe the distro got updated...

With TeXLive up to 2015, the following example was working:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{soulutf8}
\usepackage[russian]{babel}
\begin{document}
\so{Князь Батог-Батыев}  % Fine
Князь Батог"=Батыев      % Fine
\so{Князь Батог"=Батыев} % Not fine
\end{document}


The macro "= produces a hyphen that allows breaks in both parts of the compound word.

Now, pdfLaTeX compiler returns an error:

! Argument of \language@active@arg" has an extra }.
<inserted text>
\par
l.8 \so{Князь Батог"=Батыев}


The solutions for similar problems here, here, and here suggest turning off shorthands. However, I am using the "= shorthand throughout the document and do not want to replace "= with - inside \so{...} because, firstly, this used to work, secondly, the words separated with a "= have really long parts, so disabling hyphenation in both parts with - will have a detrimental effect. Finally, I want to preserve homogeneity: it is highly undesirable to have \so{Firstname-Secondname} in remark sub-headings and Firstname"=Secondname inside regular paragraphs.

What can be done in this case?

• The only difference I find between TL 2012 and all subsequent releases is that with 2012 I just get “Reconstruction failed”, whereas from TL 2013 on I get the Argument of \language@active@arg" has an extra } error. – egreg Jul 26 '17 at 21:03

I get a difference only between TeX Live 2012 and the subsequent releases. With TL 2012 the error is Reconstruction Failed, whereas with TL from 2013 to 2017 I get Argument of \language@active@arg" has an extra }.

You can (and should, in my opinion) use microtype for this.

\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\usepackage{microtype}

\DeclareRobustCommand{\so}{\textls[500]}

\begin{document}

\so{Князь Батог-Батыев}

Князь Батог"=Батыев

\so{Князь Батог"=Батыев}

\parbox[t]{0pt}{\hspace{0pt}\so{Князь Батог"=Батыев}}

\end{document}


The last \parbox is for showing that hyphenation is as expected, before and after "-.

Some adjustment may be needed if the \so part starts a paragraph, as you see.

• Thank you so much! I guess soul has too many quirks and is outdated, too, so time to switch to modern alternatives... – Andreï Kostyrka Jul 26 '17 at 21:24