TOC와 PDF의 인덱스가 일치하지 않습니다.

TOC와 PDF의 인덱스가 일치하지 않습니다.

이것은"목차의 잘못된 페이지 번호 매기기"에 대한 후속 조치. 목차는 잘 나오지만 문서 뷰어의 색인에서는 제대로 재생되지 않습니다. 계층 구조가 깨지고 페이지 번호가 약간 어긋납니다. Evince(Outline이라는 인덱스)와 동일한 문제입니다.

플랫폼: Linux Mint 19, AucteX v 11.91

CLI

$ evince --version
GNOME Document Viewer 3.28.4
$ latex --version
pdfTeX 3.14159265-2.6-1.40.19 (TeX Live 2018)
kpathsea version 6.3.0
Copyright 2018 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.34; using libpng 1.6.34
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.00

유액:

\documentclass[
french,
%draft,
%  paper=A4,
%  version=last,
%  NF,
  12pt
 % ,
 % toc=bibnumbered
]{scrreprt}%artcl}
% \usepackage{adjustbox}
\usepackage[french]{babel}
\usepackage{fancyhdr}
\usepackage[T1]{fontenc}
%\usepackage{fontspec}
\usepackage{keyfloat}
\usepackage{lastpage}
\usepackage{mwe}
\usepackage{pdfpages}
\usepackage{refcount}
%%\usepackage{scrpage2}
%\usepackage{scrlayer-scrpage}
\usepackage{textcomp}
\usepackage{tocloft}
\usepackage{ulem}
\usepackage{xparse}
\usepackage{xwatermark}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}

%must come last
\usepackage{hyperref}


%\AtEndDocument{\label{LastPage}}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[c]{\thepage/\pageref{LastPage}}
\pagestyle{fancy}


\begin{document}


  \begin{titlepage}


TITRE

\end{titlepage}

\tableofcontents

\part{A}



  \section{my section}

\clearpage
\phantomsection
\addcontentsline{toc}{subsection}{Foo}
\label{foo}
\includepdf[pages={1}]{example-image-plain.pdf}

\clearpage
\csname phantomsection \endcsname
\addcontentsline{toc}{subsection}{Bar}
\label{bar}
\includepdf[pages={1}]{example-image-plain.pdf}


\clearpage
\csname phantomsection \endcsname
\addcontentsline{toc}{subsection}{Baz}
\label{baz}
\includepdf[pages={1}]{example-image-plain.pdf}


\part{B}

\end{document}

표시하다

답변1

\chapter사이에는 없습니다 . 따라서 다음과 같은 경고가 표시됩니다.\part\section

북마크 수준 차이(2)가 1보다 크고, 입력 시 수준이 고정되어 있습니다.

북마크의 잘못된 계층 구조.

bookmark이 문제를 방지하려면 패키지를 로드할 수 있습니다 .

예(정말로 package 가 필요/원한다고 가정 xwatermark):

\documentclass[
  french,
  12pt
]{scrreprt}
\usepackage[french]{babel}

\usepackage[T1]{fontenc}
\usepackage{lastpage}
\usepackage{mwe}
\usepackage{pdfpages}

\usepackage{xwatermark}% loads fancyhdr

%must come last
\PassOptionsToPackage{hyphens}{url}
\usepackage{hyperref}
\usepackage{bookmark}% <- added

\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[c]{\thepage/\pageref{LastPage}}
\pagestyle{fancy}
\begin{document}
\tableofcontents
\part{A}
\section{my section}
\includepdf[pages={1},addtotoc={1,subsection,\subsectionnumdepth,Foo,foo}]{example-image-plain.pdf}
\includepdf[pages={1},addtotoc={1,subsection,\subsectionnumdepth,Bar,bar}]{example-image-plain.pdf}
\includepdf[pages={1},addtotoc={1,subsection,\subsectionnumdepth,Baz,baz}]{example-image-plain.pdf}
\part{B}
\end{document}

결과:

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

관련 정보