빈 페이지를 추가하지 않고 수동으로 추가된 목차 항목의 페이지 번호 변경

빈 페이지를 추가하지 않고 수동으로 추가된 목차 항목의 페이지 번호 변경

나는 기본 LaTeX 문서와 함께 포함했던 외부 PDF를 가지고 있습니다 pdfpages(멋져 보입니다!). 하지만 이제 외부의 섹션과 하위 섹션을 참조하기 위해 TOC 항목을 삽입하고 싶습니다 .pdf. 나는 그것을 다음과 같이 하고 있다:

\newcounter{page-backup}
\setcounter{page-backup}{\value{page}}
% begin to fake-numerate
\setcounter{page}{106}
% increment chapter counter and reset section and subsection
\addtocounter{chapter}{1}
\setcounter{section}{1}
\setcounter{subsection}{1}
% add chapter
\addcontentsline{toc}{chapter}{\numberline{\thechapter} CHAPTER}
% add section
\addcontentsline{toc}{section}{\numberline{\thesection} Section}
% add more...    
\setcounter{page}{125}
\addcontentsline{toc}{section}{\numberline{\thesection} Section}
% add some stuff
\addtocounter{tottables}{42}
\addtocounter{totfigures}{3}
% restore main page numeration
\setcounter{page}{\value{page-backup}}

그러나 목차에서는 106페이지(가짜 열거의 첫 번째 페이지)에 모든 항목이 표시됩니다. 삽입된 목차 항목의 페이지 번호를 수동으로 변경하려면 어떻게 해야 합니까? 내가 아는 것처럼 a가 있지만 \addtocontents매우 수동적입니다. 모든 항목을 수동으로 포맷해야 합니다...

답변1

이것은 질문에 대한 부분적인 대답일 뿐입니다.

비슷한 상황에서 다음과 같은 방법을 사용하여 개별 섹션을 분리했습니다.

...
\tableofcontents
... initial part (with no tricks)

\addcontentsline{toc}{section}{...ext sec title 1}    
\includepdf[pages={1-20}]{external.pdf}
\addcontentsline{toc}{section}{...ext sec title 2}
\includepdf[pages={21-30}]{external.pdf}

... for all the external pdf units

...continuation (no tricks)

이런 방식으로 LaTeX가 작업을 수행합니다(가짜 페이징이 필요하지 않음).

외부 PDF에 번호를 지정하지 않고 includepdf 명령에 다음을 추가하고 싶습니다.

\includepdf[pages=...,pagecommand={\thispagestyle{fancy}}]{...}

(조정 필요) 외부 PDF에 페이지 번호를 추가하려면.

(제안: 새 명령을 작성하세요 \externalPDFunit{type}{pages}{title}{file})

관련 정보