varioref: "대면 페이지의" 문자열 기본값을 변경합니다.

varioref: "대면 페이지의" 문자열 기본값을 변경합니다.

문자열을 변경할 수 있었으면 좋겠습니다 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콘텐츠 추가가 이전 내용 이후에 실행되기 때문입니다. (그렇지 않으면 \addtocfr의 솔루션에서 제안한 - 접근 방식을 사용하십시오. 이는 패키지 매뉴얼에도 언급되어 있습니다 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}

여기에 이미지 설명을 입력하세요

관련 정보