.png)
Tendo acabado de comprar a terceira edição do The LaTeX Companion, estou testando os exemplos dados no livro. Na p.78, o exemplo trata do uso de \labelformat e \Ref.
\documentclass[10pt,a4paper]{article}
\usepackage[nospace]{varioref}
%\usepackage{babel}
\labelformat{section}{section~#1}
\labelformat{equation}{equation~(#1)}
\begin{document}
\section{An example}\label{sec}
\Ref{sec} shows the use of the \verb=\labelformat= declaration with a reference to \ref{eq}.
\begin{equation} a = b \label{eq} \end{equation}
\end{document}
se você adicionar um
\usepackage{babel}
com qualquer idioma que você quiser, você obtém um
! Incomplete \iffalse; all text was ignored after line 11.
Se você substituir \Ref por \ref, tudo funcionará bem novamente, mas você perderá o UpperCasing da primeira letra, evidentemente.
Existe uma maneira de contornar essa incompatibilidade?
Eu tentei com [inglês]babel e [francês]babel e babel sem opção. Já tentei com pdfLaTeX, LaTeX, XeLaTeX, LuaLaTeX... mesmo problema...
Obrigado
Responder1
Você deve relatar isso, babel
mas uma solução rápida é restaurar o comando interno
\documentclass[10pt,a4paper]{article}
\usepackage[nospace]{varioref}
\makeatletter
\let\@kernel@ref@saved\@kernel@ref
\usepackage{babel}
\let\@kernel@ref\@kernel@ref@saved
\makeatother
\labelformat{section}{section~#1}
\labelformat{equation}{equation~(#1)}
\begin{document}
\section{An example}\label{sec}
\Ref{sec} shows the use of the \verb=\labelformat= declaration with a reference to \ref{eq}.
\begin{equation} a = b \label{eq} \end{equation}
\end{document}
babel
redefine alguns \label
/ \ref
internals para que os caracteres abreviados ativos funcionem, mas isso desfaz aquele patch que parece confuso com alguns
\Ref
detalhes. Portanto, alguns caracteres como "
esses que são ativados pelo babel podem não funcionar em rótulos após essa alteração.