
Me gustaría poder cambiar las varioref
cuerdas. En particular, el on the facing page
.
No deberia ser un problema. La documentación indica claramente varias macros utilizadas y creo que podría cambiarlas usando:
\renewcommand\reftextfaceafter{on the following page}
\renewcommand\reftextafter {on the next page}
\renewcommand\reftextfacebefore{on the previous page}
\renewcommand\reftextbefore {on the previous page}
Esto funciona bien, a menos que lo use babel
junto con varioref
.
MWE sigue:
\documentclass{book}
\usepackage[english]{babel} % works if this line is commented out
\usepackage{varioref}
\renewcommand\reftextfaceafter{on the following page}
\renewcommand\reftextafter {on the next page}
\renewcommand\reftextfacebefore{on the previous page}
\renewcommand\reftextbefore {on the previous page}
\begin{document}
empty page
\clearpage
\begin{figure}
\centering
\rule{5cm}{3cm}
\caption{Caption}
\label{fig}
\end{figure}
\clearpage
Figure \vref{fig}
\end{document}
Respuesta1
Si pones la \renewcommand
s después \begin{document}
, funciona bien. Si los coloca en el preámbulo, se sobrescriben cuando se configuran elementos al final del preámbulo/principio del documento.
Sin embargo, no creo que ponerlos después \begin{document}
sea la solución correcta. Consulte el manual para vervariador, encontramos instrucciones modificadas para documentos que utilizanBabel. Estos sugieren el siguiente código:
\documentclass[english]{book}
\usepackage{babel} % works if this line is commented out
\usepackage{varioref}
\addto\extrasenglish{% page 5 of varioref's manual
\renewcommand\reftextfaceafter{on the following page}%
\renewcommand\reftextafter {on the next page}%
\renewcommand\reftextfacebefore{on the previous page}%
\renewcommand\reftextbefore {on the previous page}%
}
\begin{document}
empty page
\clearpage
\begin{figure}
\centering
\rule{5cm}{3cm}
\caption{Caption}
\label{fig}
\end{figure}
\clearpage
Figure \vref{fig}
\end{document}
Tenga en cuenta que al pasar english
a la clase de documento, en lugar de directamente a babel
, otros paquetes que reconocen el idioma podrán retomar la configuración.
Respuesta2
babel
hace algunas redefiniciones directamente en \AtBeginDocument
, por lo que las \renewcommand
macros \ref....
deben engancharse incluso más adelante, es decir, usarse \AtBeginDocument{...}
alrededor de \renewcommand
y los cambios entran en acción, ya que esta nueva \AtBeginDocument
adición de contenido se ejecuta después de las anteriores. (De lo contrario, utilice el \addto
enfoque - como lo sugiere la solución de CFR; esto varioref
también se menciona en el manual del paquete)
\documentclass{book}
\usepackage[english]{babel} % works if this line is commented out
\usepackage{varioref}
\AtBeginDocument{%
\renewcommand\reftextfaceafter{on the following page}
\renewcommand\reftextafter{on the next page}
\renewcommand\reftextfacebefore{on the previous page}
\renewcommand\reftextbefore{on the previous page}
}
\begin{document}
empty page
\clearpage
\begin{figure}
\centering
\rule{5cm}{3cm}
\caption{Caption}
\label{fig}
\end{figure}
\clearpage
Figure \vref{fig}
\end{document}