[texhax] polyglossia vs. cleverref

Ulrike Fischer news3 at nililand.de
Sat Dec 1 16:09:20 CET 2018


Am Tue, 27 Nov 2018 22:11:31 -0800 schrieb Paulo Ney de Souza:

> Would anyone help elucidate what is the problem between these two packages,
> when you run it with xelatex, as show in this MWE?
> 
> I get an error:
> 
> ! Undefined control sequence.
> \@begindocumenthook ...sname extras\cref at language
>                                                   \endcsname }\@ifundefined
> ...
> l.12 \begin{document}

cleveref has an option "brazilian", but polyglossia sets the
languagename to "brazil". 

> and they work fine with Babel.

You don't get an error but not the correct language either. This
here should work (and I would prefer the babel solution):

\documentclass{article}
 
%\usepackage[brazil]{babel}

\usepackage{polyglossia}
\setmainlanguage{brazil}

\usepackage[brazilian]{cleveref}


\begin{document}
\section{abc}\label{section}
This is a test. \cref{section}
\end{document}



-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/



More information about the texhax mailing list