
문자열을 변경할 수 있었으면 좋겠습니다 varioref
. 특히, on the facing page
하나.
문제가 되지 않습니다. 문서에는 사용된 다양한 매크로가 명확하게 나와 있으며 다음을 사용하여 매크로를 변경할 수 있을 것이라고 생각합니다.
\renewcommand\reftextfaceafter{on the following page}
\renewcommand\reftextafter {on the next page}
\renewcommand\reftextfacebefore{on the previous page}
\renewcommand\reftextbefore {on the previous page}
babel
와 함께 사용하지 않는 한 이것은 잘 작동합니다 varioref
.
MWE는 다음과 같습니다:
\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}
답변1
\renewcommand
뒤에 s를 넣으면 \begin{document}
잘 작동합니다. 프리앰블에 넣으면 문서의 프리앰블 끝/시작 부분에서 구성할 때 덮어쓰게 됩니다.
하지만 뒤에 두는 것이 \begin{document}
올바른 해결책은 아니라고 생각합니다. 매뉴얼을 보면가변 참조, 우리는 다음을 사용하는 문서에 대한 수정된 지침을 찾습니다.바벨. 이는 다음 코드를 제안합니다.
\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}
english
에 직접 전달하는 대신 문서 클래스에 전달하면 babel
언어를 인식하는 다른 패키지에서 설정을 선택할 수 있습니다.
답변2
babel
는 에서 바로 일부 재정의를 수행하므로 \AtBeginDocument
매크로 \renewcommand
의 \ref....
는 나중에 연결되어야 합니다. 즉, 를 사용하면 \AtBeginDocument{...}
변경 \renewcommand
사항이 적용됩니다. 왜냐하면 이 새로운 \AtBeginDocument
콘텐츠 추가가 이전 내용 이후에 실행되기 때문입니다. (그렇지 않으면 \addto
cfr의 솔루션에서 제안한 - 접근 방식을 사용하십시오. 이는 패키지 매뉴얼에도 언급되어 있습니다 varioref
.)
\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}