I read the excellent question Difference between ref, varioref and cleveref. Decision for a thesis and various doc on the net (the varioref package documentation) and tried to use it... but with many errors
An exemple :
\documentclass{article}
\usepackage[a4paper]{geometry}
\geometry{top=25mm,bottom=25mm,inner=25mm,outer=20mm,,marginparwidth=1cm,marginparsep=10pt}
\usepackage[ansinew]{inputenc}
\usepackage[french]{babel}
\usepackage[lmodern]
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{color,xcolor}
\ifpdf%
\usepackage[pdftex,pagebackref=true,hyperindex=true,colorlinks=true]{hyperref}
\hypersetup{pdfstartview={FitH}, bookmarksnumbered={true}}
\else%
\usepackage[hypertex=true,hyperindex=true,colorlinks=false]{hyperref}
\fi
\usepackage{cleveref}
\usepackage{varioref}
\usepackage{lipsum}
\begin{document}
\section{Bla bla}\label{sec:bla}
\lipsum[1]
\newpage
\section{Second bla bla}
Test section 1 :
\begin{itemize}
\item with \verb"\ref" : \ref{sec:bla}
\item with \verb"\vref" : \vref{sec:bla}
= error "!Missing \verb"\endcsname" inserted"
\item with \verb"\cref" : \cref{sec:bla}
= error "!Missing \verb"\endcsname" inserted"
\end{itemize}
\newpage
\section{Third bla bla}
Test section 1 :
\begin{itemize}
\item with \verb"\ref" : \ref{sec:bla}
\item with \verb"\vref" : \vref{sec:bla}
= error "!Missing \verb"\endcsname" inserted"
\item with \verb"\cref" : \cref{sec:bla}
= error "!Missing \verb"\endcsname" inserted"
\end{itemize}
\end{document}
I get the error !Missing \endcsname inserted
and more other after... (same error with vref as for cref.
How is it possible to resolve this ? I don't find an answer on this forum nor on the net.
I will use those packages (vref
and cref
) for my customized environnements, for exemple with such a macro-box :
\newtheorem{theoreme}{{\sffamily Théorème}}[section]
\newcommand{\boxthm}[2]
{{\colorbox{yellow}{\begin{minipage}{0.98\linewidth}
\begin{theoreme}\label{thm:#1}
{\sffamily ~\\#2}
\end{theoreme}
\end{minipage}}}\\~}
I presume that if I can resolve the problem for a section, I also get the tip for all my macro-boxes (thm, definitions, algorithms, lemma, examples, ...) ?
varioref
aftercleveref
. What's the purpose of loadingaeguill
? It's a very obsolete package. If you haven't the CM-Super fonts installed, uselmodern
. Also giving both thefrenchb
andfrancais
options tobabel
is redundant: use either one or simplyfrench
.lmodern
or install the CM-Super fonts.