잘못된 페이지에 연결된 북마크

잘못된 페이지에 연결된 북마크

내가 원하는 것과 정확히 일치하는 문서가 있지만 북마크 링크가 잘못된 위치로 연결되어 있습니다. 이 MWE는 너무 많이 해킹하면 문제를 재현할 수 없기 때문에 길이가 깁니다. 불행히도 나도 문제를 분리할 수 없었습니다. 다음 코드에서는 PDFTexify를 실행하면 PDF에서 책갈피를 Acknowledgement목차에 연결하고 Abstract책갈피를 제목 페이지에 연결합니다.

읽었습니다(여기를 클릭하세요)이를 올바르게 설정 \cleardoublepage하거나 \phantomsection(그림/표 목록 페이지에서 작동) hyperref먼저 호출하거나(이전 bookmark) 패키지 호출을 올바르게 주문하는 것이 도움이 될 수 있습니다. 내가 이해하고 시도한 이러한 제안으로는 문제가 해결되지 않는 것 같습니다.

내가 어떻게 할 수있는...

  1. 승인 북마크를 올바른 페이지(toc 아님)에 연결하세요.
  2. 요약 책갈피를 올바른 페이지(제목 페이지 아님)에 연결하세요.

실제 문서의 레이아웃/모양을 동일하게 유지하면서?

내 턱받이 파일(addbibresource{biblatex-examples.bib}더 이상 작동하지 않는 것 같습니다.)

@INCOLLECTION{Adams2002,
  author = {Peter Adams},
  title = {Technology in Publishing: {A} Century of Progress},
  booktitle = {Scholarly Publishing: {B}ooks, Journals, Publishers, and Libraries
    in the Twentieth Century},
  publisher = {Wiley},
  year = {2002},
  editor = {Abel, R. and Newlin, L. W.},
  address = {New York}
}

MWE

\documentclass[12pt]{report}

\usepackage[american]{babel}
\usepackage[T1]{fontenc}
\usepackage[style=apa, backend=biber]{biblatex}
\addbibresource{mybib.bib}
\DeclareLanguageMapping{american}{american-apa}

\usepackage{outlines}
\usepackage{enumitem}
\usepackage[autostyle]{csquotes}
\usepackage{url}

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,
    urlcolor=blue,
    citecolor=blue,
}

\usepackage{booktabs}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}

\newcommand{\specialcell}[2][c]{%
  \begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}

\urlstyle{same}
\usepackage{filecontents}

%% figures and table numbered continuosly
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}

%% increase space between bib entries
\setlength\bibitemsep{2\itemsep}

%% change Bibliography name to REFERENCES
\renewcommand{\bibname}{REFERENCES}

\usepackage{setspace}
\usepackage{graphicx}
\usepackage{color,soul}

\addto\captionsamerican{
  \renewcommand{\contentsname}%
    {\large Table of Contents}%
}


\usepackage{etoolbox}
\makeatletter
\patchcmd{\l@section}
  {\hfil}
  {\leaders\hbox{\normalfont$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill}
  {}{}
\makeatother



\usepackage{titlesec}
\makeatletter
\def\@makechapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        \par\nobreak
        \vspace*{2\p@}%
        {\large \bfseries \thechapter\quad #1\par\nobreak}
        \par\nobreak
        \vspace*{2\p@}%
    %\vskip 40\p@
    \vskip 100\p@
  }}
\def\@makeschapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        \par\nobreak
        \vspace*{2\p@}%
        {\large \bfseries #1\par\nobreak}
        \par\nobreak
        \vspace*{2\p@}%
    \vskip 100\p@
  }}
\makeatother



%% possessive citation
\newcommand\posscite[1]{\citeauthor{#1}'s (\citeyear{#1})}
\newcommand\poscite[1]{\citeauthor{#1}' (\citeyear{#1})}

\usepackage{bookmark}

%% All headers 12pt
\usepackage{sectsty,textcase}
\allsectionsfont{\large\MakeUppercase}
\chapterfont{\large\MakeUppercase}

%% refs to toc
%\usepackage[nottoc,numbib]{tocbibind}

\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\large\bfseries}{\chaptertitlename\ \thechapter}{12pt}{\large\MakeUppercase}
\titlespacing*{\chapter}{0pt}{-50pt}{40pt}

%% appendices
\usepackage[title,titletoc]{appendix}

%% dot fill chapters
\usepackage{tocloft}

\renewcommand\cftchapdotsep{\cftdotsep}
\renewcommand\cftchapleader{\large\cftdotfill{\cftchapdotsep}}
\renewcommand\cftloftitlefont{\large\textbf}
\renewcommand\cftlottitlefont{\large\textbf}

%% Set margins to 1 inch
\usepackage[margin=1in]{geometry}
\setlength\cftbeforetoctitleskip{-1cm}  %toc
\setlength\cftbeforeloftitleskip{-1cm}  % list of figs
\setlength\cftbeforelottitleskip{-1cm}  % lsit of tables

\singlespace

\author{\vspace{0cm} \large by Me}
\title{\vspace{-5cm} \large The Title}

\setcounter{secnumdepth}{0}


\begin{document}

\maketitle
\pagenumbering{roman}
\thispagestyle{empty}

\newpage
\section*{}
\doublespacing
\vspace{14cm}
\begin{center}
Copyright by  \\
2014 \\
\end{center}

\newpage
\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{Acknowledgement}
%\section{Acknowledgment}

\newpage
\pdfbookmark[section]{\contentsname}{toc}
\tableofcontents

\newpage
\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{List of Tables}
\listoftables

\newpage
\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{List of Figures}
\listoffigures

\newpage

%https://tex.stackexchange.com/questions/30122/generate-table-of-contents-when-section-sections-without-numbering-has-been
\section{Abstract}

Some Info

\newpage
\pagenumbering{arabic}

\setcounter{secnumdepth}{2}

\part{Fox and Cat}

\chapter{Dog}

\section{Food}
\chapter{Run}

\part{Chicken and Hen}

\chapter{Introduction}

\part{Discussion}

\chapter{Discussion}

\clearpage

\section*{Tables}
\addtocounter{section}{3}

\begin{table}[!ht]
    \parbox{7.5cm}{\caption{Yepper}}
      \centering
\begin{singlespace}
\begin{tabular}{lrrrr}
\hline \\
%\multicolumn{5}{c}{\textbf{Average Student Engagement Level}} \\
\multicolumn{5}{c}{} \\
\multicolumn{1}{c}{} & \multicolumn{2}{c}{Special Ed.} & \multicolumn{2}{c}{Reg. Ed.} \\
\cmidrule(lr){2-3}
\cmidrule(l ){4-5}
Gender & Charter & Public & Charter & Public \\
\midrule
Male & 643 & 793 & 590 & 724 \\
Female & 735 & 928 & 863 & 662 \\
\end{tabular}
\end{singlespace}
\end{table}

\clearpage

\section*{Visuals}
hello

\begin{appendices}
\renewcommand{\appendixname}{APPENDIX}

\bookmarksetup{startatroot}
\chapter{Foo}
some text

\bookmarksetup{startatroot}
\chapter{Bar}
some more text
\end{appendices}

\addcontentsline{toc}{chapter}{REFERENCES}

\nocite{*}
\renewcommand{\bibname}{\vspace{1cm} REFERENCES}

\newpage
\singlespacing
\bookmarksetup{startatroot}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{REFERENCES}
\printbibliography

\end{document}

출력 파일에 대한 링크
PDF로 링크

답변1

주어진 MWE를 약간 변경했습니다. 예를 들어 패키지 호출 순서를 변경하고 북마크를 수정하기 위해 누락된 명령을 추가했습니다.

새로운 MWE를 귀하의 MWE와 비교해 보십시오. 그러면 원하는 결과를 얻기 위해 코드를 변경해야 했다는 것을 알게 될 것입니다.

그런데: \newpage모두 \clearpage.

MWE:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{JoeDoe2012,
  Author  = {Joe Doe},
  Title   = {My article's title},
  Journal = {My journal's title},
  Editor  = {Ben Editor},
  URL     = {http://webpage.com},
}
@INCOLLECTION{Adams2002,
  author    = {Peter Adams},
  title     = {Technology in Publishing: {A} Century of Progress},
  booktitle = {Scholarly Publishing: {B}ooks, Journals, Publishers, and Libraries
    in the Twentieth Century},
  publisher = {Wiley},
  year      = {2002},
  editor    = {Abel, R. and Newlin, L. W.},
  address   = {New York},
}
@article{Agarwal2011,
  author   = {Agarwal, Gautam and Isacoff, Ehud},
  doi      = {10.1152/jn.00591.2010},
  issn     = {1522-1598},
  journal  = {Journal of neurophysiology},
  keywords = {Animals,Behavior, Animal,Behavior, Animal: physiology,Calcium,Calcium: metabolism,Drosophila,Drosophila: physiology,Electric Stimulation,Female,Male,Odors,Olfactory Pathways,Olfactory Pathways: physiology,Sex Attractants,Sex Attractants: physiology},
  month    = apr,
  number   = {4},
  pages    = {1711--21},
  pmid     = {21289134},
  title    = {{Specializations of a pheromonal glomerulus in the Drosophila olfactory system.}},
  url      = {http://jn.physiology.org/cgi/content/abstract/105/4/1711},
  volume   = {105},
  year     = {2011},
}
\end{filecontents*}


\documentclass[12pt]{report}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}

\usepackage[style=apa, backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\DeclareLanguageMapping{american}{american-apa}

\usepackage{outlines}
\usepackage{enumitem}
\usepackage[autostyle]{csquotes}

\usepackage{booktabs}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}

\newcommand{\specialcell}[2][c]{%
  \begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}


%% figures and table numbered continuosly
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}

%% increase space between bib entries
\setlength\bibitemsep{2\itemsep}

%% change Bibliography name to REFERENCES
\renewcommand{\bibname}{REFERENCES}

\usepackage{setspace}
\usepackage{graphicx}
\usepackage{color,soul}

\addto\captionsamerican{
  \renewcommand{\contentsname}%
    {\large Table of Contents}%
}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\l@section}
  {\hfil}
  {\leaders\hbox{\normalfont$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill}
  {}{}
\makeatother

\usepackage{titlesec}
\makeatletter
\def\@makechapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        \par\nobreak
        \vspace*{2\p@}%
        {\large \bfseries \thechapter\quad #1\par\nobreak}
        \par\nobreak
        \vspace*{2\p@}%
    %\vskip 40\p@
    \vskip 100\p@
  }}
\def\@makeschapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        \par\nobreak
        \vspace*{2\p@}%
        {\large \bfseries #1\par\nobreak}
        \par\nobreak
        \vspace*{2\p@}%
    \vskip 100\p@
  }}
\makeatother

%% possessive citation
\newcommand\posscite[1]{\citeauthor{#1}'s (\citeyear{#1})}
\newcommand\poscite[1]{\citeauthor{#1}' (\citeyear{#1})}

%% All headers 12pt
\usepackage{sectsty,textcase}
\allsectionsfont{\large\MakeUppercase}
\chapterfont{\large\MakeUppercase}

\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\large\bfseries}{\chaptertitlename\ \thechapter}{12pt}{\large\MakeUppercase}
\titlespacing*{\chapter}{0pt}{-50pt}{40pt}

%% appendices
\usepackage[title,titletoc]{appendix}

%% dot fill chapters
\usepackage{tocloft}

\renewcommand\cftchapdotsep{\cftdotsep}
\renewcommand\cftchapleader{\large\cftdotfill{\cftchapdotsep}}
\renewcommand\cftloftitlefont{\large\textbf}
\renewcommand\cftlottitlefont{\large\textbf}

%% Set margins to 1 inch
\usepackage[margin=1in]{geometry}
\setlength\cftbeforetoctitleskip{-1cm}  %toc
\setlength\cftbeforeloftitleskip{-1cm}  % list of figs
\setlength\cftbeforelottitleskip{-1cm}  % lsit of tables

\singlespace

\author{\vspace{0cm} \large by Me}
\title{\vspace{-5cm} \large The Title}

\usepackage{url}
\urlstyle{same}

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,
    urlcolor=blue,
    citecolor=blue,
}
\usepackage{bookmark}

\begin{document}

\pagenumbering{roman}    % starts numbering with: i
%\thispagestyle{empty}
\maketitle


\clearpage
\section*{~}
\doublespacing
\vspace{14cm}
\begin{center}
Copyright by  \\
2014 \\
\end{center}

\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{Acknowledgement}
\section*{Acknowledgment}

\clearpage
\pdfbookmark[section]{\contentsname}{toc}
\tableofcontents

\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{List of Tables}
\listoftables

\cleardoublepage
\phantomsection
\addcontentsline{toc}{section}{List of Figures}
\listoffigures


%http://tex.stackexchange.com/questions/30122/generate-table-of-contents-when-section-sections-without-numbering-has-been
\clearpage
\phantomsection
\addcontentsline{toc}{section}{Abstract}
\section*{Abstract}

Some Info

\clearpage
\pagenumbering{arabic}

\part{Fox and Cat}

\chapter{Dog}

\section{Food}
\chapter{Run}

\part{Chicken and Hen}

\chapter{Introduction}

\part{Discussion}

\chapter{Discussion}

\clearpage
\section*{Tables}
\addtocounter{section}{3}

\begin{table}[!ht]
    \parbox{7.5cm}{\caption{Yepper}}
      \centering
\begin{singlespace}
\begin{tabular}{lrrrr}
\hline \\
\multicolumn{5}{c}{} \\ 
\multicolumn{1}{c}{} & \multicolumn{2}{c}{Special Ed.} & \multicolumn{2}{c}{Reg. Ed.} \\
\cmidrule(lr){2-3}
\cmidrule(l ){4-5}
Gender & Charter & Public & Charter & Public \\
\midrule
Male   & 643     & 793    & 590     & 724 \\
Female & 735     & 928    & 863     & 662 \\
\end{tabular}
\end{singlespace}
\end{table}

\clearpage

\section*{Visuals}
hello

\begin{appendices}
\renewcommand{\appendixname}{APPENDIX}

\bookmarksetup{startatroot}
\chapter{Foo}
some text

\bookmarksetup{startatroot}
\chapter{Bar}
some more text
\end{appendices}

\nocite{*}
\renewcommand{\bibname}{\vspace{1cm} REFERENCES}

\cleardoublepage
\singlespacing
\bookmarksetup{startatroot}
\phantomsection
\addcontentsline{toc}{chapter}{REFERENCES}
\printbibliography

\end{document}

관련 정보