When using the cleveref capitalize
option, all my references should be capitalized. But this is only working if I do not add new babel
translations.
Running the following example results in figura
instead of Figura
:
And if I comment out my line \addto\captionsbrazil{\crefname{figure}{figura}{figuras}}
, then the capitalize
option starts working again:
How to fix the cleveref capitalize
option when using it with the babel package?
How can I report this as bug to cleveref package maintainers?
\documentclass[english,12pt,a4paper,twoside]{abntex2}
\usepackage{listings}
\usepackage[nameinlink,capitalise]{cleveref}
\addto\captionsbrazil{\crefname{figure}{figura}{figuras}}
\addto\captionsbrazil{\Crefname{figure}{Figura}{Figuras}}
\begin{document}
\chapter{Hi}
See the \Cref{acode,afigure}.
\Cref{afigure}.
\Cref{acode}.
\begin{lstlisting}[caption=Code,label=acode]
Code
\end{lstlisting}
\begin{figure}[!htb]
\caption{Figure}
\label{afigure}
Figure
\end{figure}
Something...
\end{document}
Related questions:
Update
Following @Mico suggestion to not use \addto\captionsbrazil
does not work because by default instead of showing Figura
its shows Fig.
, then I need to use \addto\captionsbrazil
to override this Fig.
abbreviation:
\documentclass[english,12pt,a4paper,twoside]{abntex2}
\usepackage{listings}
\renewcommand\lstlistingname{Listagem}
\usepackage[nameinlink,capitalise,brazilian]{cleveref}
\begin{document}
\chapter{Hi}
See the \Cref{acode,afigure}.
\Cref{afigure}.
\Cref{acode}.
\begin{lstlisting}[caption=Code,label=acode]
Code
\end{lstlisting}
\begin{figure}[!htb]
\caption{Figure}
\label{afigure}
Figure
\end{figure}
Something...
\end{document}