The following code presents a strange error found using polyglossia and soul packages.
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage[variant=brazilian]{portuguese}
\setotherlanguage[variant=american]{english}
\usepackage{soul}
\begin{document}
\textit{bbb \& \ul{aaaaa}}
\end{document}
The error message is:
! Extra \else.
\portuguese@sh@tmp ...\portuguese@sh@next --\else
\expandafter \portuguese@@...
l.7 \textit{bbb \& \ul{aaaaa}}
Note that removing one "a" from \ul{aaaaa} does compile without error.
Is it a bug? From polyglossia or soul?
ulempackage, using the\ulinecommand. ("The package should be loaded with thenormalemoption, otherwise the\emphmacro is changed to underline the text.") https://tex.stackexchange.com/questions/9550/why-does-underlined-text-not-get-wrapped-once-it-hits-the-end-of-a-line – LEo Oct 07 '22 at 17:38