다른 폴더에 있는 파일의 레이블을 참조하려는 시도 중 하나 이상을 수정하려면 어떻게 해야 합니까?

다른 폴더에 있는 파일의 레이블을 참조하려는 시도 중 하나 이상을 수정하려면 어떻게 해야 합니까?

다른 파일에서 a \ref를 수행하라는 지시를 따르는 데 실패했습니다 . \label궁극적으로 이는 다른 폴더에 있는 파일에 대한 것입니다. 설치 안내서 파일용 폴더가 하나 있고 시스템 관리 안내서 파일용 폴더가 또 있습니다.

아래 (1)과 (2)에 설명된 두 가지 다른 방법을 시도했습니다. 내 코드는 (3)과 (4)에 있습니다.

(1) 사용 시도 결과 \input{../TestFolder/outiedoc.aux}: 장 번호가 올바르게 삽입되었습니다. 그러나 "writefiletoc" 및 "writefilelofwritefilelot"과 같은 추가 쓰레기가 이탤릭체로 나타납니다. 작은 테스트 파일이 아닌 실제 문서에서 명령을 사용하면 해당 명령이 사라질 것으로 예상해야 합니까?

(2) 사용 결과

\usepackage{xr}
\externaldocument{../Testfolder/outiedoc} :

쓰레기는 없지만 ?? 장 번호 대신.

(3) 이것이 내가 outiedoc에 가지고 있는 것입니다:

\documentclass{book}

\begin{document}
    \chapter{The Far Shore}\label{ch:outieRef}
    This is the first chapter of the book.
\end{document}

(4) 위의 (1)과 (2) 행을 번갈아 사용하는 것 외에 호출 문서에 있는 내용은 다음과 같습니다.

\documentclass{book}

\begin{document}
    You can find what you are looking for in chapter~\ref{ch:outieRef} 
\end{document}

답변1

호출 문서에서 \usepackage{xr}다음을 사용해야 합니다 .\externaldocument{outiedoc}maindoc.tex

\documentclass{book}
\usepackage{xr}
\externaldocument{outiedoc}

\begin{document}
    You can find what you are looking for in chapter~\ref{ch:outieRef} 
\end{document}

그리고outiedoc.tex

\documentclass{book}

\begin{document}
    \chapter{The Far Shore}\label{ch:outieRef}
    This is the first chapter of the book.
\end{document}

두 파일을 두 번 컴파일하십시오. outiedoc.tex먼저 컴파일한 다음 maindoc.tex.

관련 정보