I'm writting in French so I use babel. I'd like to use prettyref to keep from writting "Section" and co.
The problem is that I can not use it with French babel. It throws me:
! Paragraph ended before \@prettyref was complete.
<to be read again>
\par
l.36
?
Here is an MWE:
\documentclass{article}
\usepackage{prettyref}
% Form package, just for info.
\makeatletter
\def\prettyref#1{\@prettyref#1:}
\def\@prettyref#1:#2:{%
\expandafter\ifx\csname pr@#1\endcsname\relax%
\PackageWarning{prettyref}{Reference format #1\space undefined}%
\ref{#1:#2}%
\else%
\csname pr@#1\endcsname{#1:#2}%
\fi%
}
\makeatother
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\begin{document}
\section{Introduction}\label{sec:intro}
See \prettyref{fig:defs}
\section{Definitions}\label{sec:defs}
See \prettyref{sec:conclusion}
\section{Conclusion}\label{sec:conclusion}
See \prettyref{sec:intro} and \prettyref{fig:defs}. With prettyref we simply write \verb|\prettyref{sec:intro}| to get \prettyref{sec:intro}.
\end{document}
Conclusion
Ok ! For all French peaple looking here, you can't define labels like fig:a. This causes problems as soon as an automatic reference package is used.
The reason is that the : "letter" becomes an active character in French babel, which leads all these problems :s
What I made is to use cleveref with labels like fig-a.
Thanks everyone !


prettyrefis simply not compatible withbabel-french. – egreg Feb 11 '20 at 11:06:– daleif Feb 11 '20 at 11:07:in labels, even underbabel-french. I recommend against using:with this setup though, precisely because of packages likecleverefthat don't like it when active. – frougon Feb 11 '20 at 12:02cleverefas a backend) is a rather brute force one—I don't like it much. And thecleverefcode takes a lot of volume (\expandafterchains...). In order to maintainxcreflong-term, I'd need to be comfortable with thecleverefcode, but I don't read it often enough for this. – frougon Feb 11 '20 at 12:08prettyrefthat conflicts withbabel-frenchand its decision to make the:character "active" (in the TeX-sense of the word). Another afflicted cross-referencing package iscleveref. Basically, all cross-referencing packages which inspect the contents of\labeland\refmore than just cursorily will experience problems with the active:character. In the case ofprettyref, the problem is unavoidable because the presence of the:character is required -- as the divider between the format and name parts of the cross-reference. – Mico Feb 11 '20 at 12:15