목차를 클릭해도 작동하지 않습니다

목차를 클릭해도 작동하지 않습니다

논문을 준비하고 있습니다. 소개와 일부 기사로 구성되어 있습니다. 다음 템플릿을 사용하고 있습니다. 시각적으로 .pdf모든 것이 괜찮아 보입니다. 그런데 목차를 클릭하면 문제가 나타납니다.

소개를 클릭하면 목차에 남아있습니다. 1.항과 "서론 참고자료"를 제외한 나머지 부분은 잘 작동하지 않습니다. 그리고 기사의 경우, 목차를 클릭하면 기사가 아닌 "서론 참고자료"로 이동합니다.

게다가 PDF를 열었을 때 화면 왼쪽에 나타나는 목차 툴바에 목차 구조가 제대로 반영되지 않습니다.

\clearpage비고: 명령이 제거되지 않기를 바랍니다 .

\documentclass[12pt,reqno]{report}

\usepackage{hyperref}
\usepackage[usenames]{color}
\usepackage[latin1]{inputenc} 
\usepackage{float}
\usepackage{bbm}
\usepackage[english]{babel} 
\usepackage{amssymb, amsmath}
\usepackage{geometry,graphicx}
\usepackage[final]{pdfpages}

\addto\captionsenglish{%
  \renewcommand{\bibname}{\centerline{{\Large References for the introduction}}}
}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma} 
\newtheorem{definition}[theorem]{Definition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{example}[theorem]{Example}
\geometry{a4paper,twoside,top=3.5cm,bottom=3.5cm,left=3cm,right=3cm,headsep=1cm}

\setlength{\parskip}{0.5em}

\begin{document}

\includepdf[pages=-]{./coverthesis.pdf}

\newpage\null\thispagestyle{empty}\newpage

\begin{center}
\textbf{Abstract}
\end{center}

This is my abstract.

\tableofcontents

\clearpage

\begin{center}
\Large \textbf{Introduction} \normalsize
\addcontentsline{toc}{chapter}{Introduction}
\end{center}

\clearpage

\begin{center}
\textbf{1. First part introduction} 
\addcontentsline{toc}{section}{1. First part introduction}
\end{center}

Something...

\clearpage

\noindent \textbf{1.1. Subsection 1 in the first part} 
\addcontentsline{toc}{subsection}{1.1. Subsection 1 in the first part}

Something...

\clearpage

\noindent \textbf{1.2. Subsection 2 in the first part} 
\addcontentsline{toc}{subsection}{1.2. Subsection 2 in the first part}

Something...

\clearpage

\begin{center}
\textbf{2. Second part introduction} 
\addcontentsline{toc}{section}{2. Second part introduction}
\end{center}

\clearpage

\noindent \textbf{2.1. Subsection 1 in the second part} 
\addcontentsline{toc}{subsection}{1.1. Subsection 1 in the second part}

Something...

\clearpage

\noindent \textbf{2.2. Subsection 2 in the second part} 
\addcontentsline{toc}{subsection}{1.2. Subsection 2 in the second part}

Something...

\clearpage

\begin{thebibliography}{a}
\addcontentsline{toc}{section}{References for the introduction}

\bibitem{Author}
Author. \textit{Title}. Edition and year.

\end{thebibliography}

\clearpage

\begin{center}
\textbf{Article 1.} 
\addcontentsline{toc}{chapter}{Article 1}
\end{center}

\includepdf[pages=-]{./art1.pdf}

\clearpage

\begin{center}
\textbf{Article 2.} 
\addcontentsline{toc}{chapter}{Article 2}
\end{center}

\includepdf[pages=-]{./art2.pdf}

\end{document}

답변1

나는 일반 단면 명령을 사용하겠습니다.

\documentclass[12pt,reqno]{report}

\usepackage[usenames]{color}
\usepackage[latin1]{inputenc} 
\usepackage{float}
\usepackage{bbm}
\usepackage[english]{babel} 
\usepackage{amssymb, amsmath}
\usepackage{geometry,graphicx}
\usepackage[final]{pdfpages}
\usepackage{hyperref}

\addto\captionsenglish{%
  \renewcommand{\bibname}{References for the introduction}
}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma} 
\newtheorem{definition}[theorem]{Definition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{example}[theorem]{Example}
\geometry{a4paper,twoside,top=3.5cm,bottom=3.5cm,left=3cm,right=3cm,headsep=1cm}

\setlength{\parskip}{0.5em}

\renewcommand{\thesection}{\arabic{section}}

\begin{document}

%\includepdf[pages=-]{./coverthesis.pdf}

\newpage\null\thispagestyle{empty}\newpage

\begin{center}
\textbf{Abstract}
\end{center}

This is my abstract.

\tableofcontents

\clearpage


\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}

\clearpage



\section{First part introduction} 



Something...

\clearpage

\subsection{Subsection 1 in the first part} 


Something...

\clearpage

\subsection{Subsection 2 in the first part} 


Something...

\clearpage

\section{Second part introduction} 

\clearpage

\subsection{Subsection 1 in the second part} 


Something...

\clearpage

\subsection{Subsection 2 in the second part} 


Something...

\clearpage

\begin{thebibliography}{a}
\addcontentsline{toc}{section}{References for the introduction}

\bibitem{Author}
Author. \textit{Title}. Edition and year.

\end{thebibliography}

\clearpage

\chapter*{Article 1.} 
\addcontentsline{toc}{chapter}{Article 1.}

%\includepdf[pages=-]{./art1.pdf}

\clearpage

\chapter*{Article 2.}
\addcontentsline{toc}{chapter}{Article 2.}

%\includepdf[pages=-]{./art2.pdf}

\end{document}

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

답변2

등 의 이상한 사용법 \textbf{1.1 Subsection}은 에서 잡을 수 있는 하이퍼앵커를 제공하지 않습니다 \addcontentsline.

이러한 사용법이 지속되어야 하는 경우 \phantomsection하이퍼앵커를 생성하는 데 매크로가 필요하지만 이러한 수동적이고 오류가 발생하기 쉬운 스타일은 권장하지 않습니다 \textbf{...}.

\documentclass[12pt,reqno]{report}

\usepackage[usenames]{color}
\usepackage[latin1]{inputenc} 
\usepackage{float}
\usepackage{bbm}
\usepackage[english]{babel} 
\usepackage{amssymb, amsmath}
\usepackage{geometry,graphicx}
\usepackage[final]{pdfpages}

\addto\captionsenglish{%
  \renewcommand{\bibname}{\centerline{{\Large References for the introduction}}}
}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma} 
\newtheorem{definition}[theorem]{Definition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{example}[theorem]{Example}
\geometry{a4paper,twoside,top=3.5cm,bottom=3.5cm,left=3cm,right=3cm,headsep=1cm}

\setlength{\parskip}{0.5em}


\usepackage{hyperref}

\begin{document}

%\includepdf[pages=-]{./coverthesis.pdf}

\newpage\null\thispagestyle{empty}\newpage

\begin{center}
\textbf{Abstract}
\end{center}

This is my abstract.

\tableofcontents

\clearpage

\begin{center}
\Large \textbf{Introduction} \normalsize
\phantomsection
\addcontentsline{toc}{chapter}{Introduction}
\end{center}

\clearpage

\begin{center}
\textbf{1. First part introduction} 
\phantomsection
\addcontentsline{toc}{section}{1. First part introduction}
\end{center}

Something...

\clearpage

\noindent \textbf{1.1. Subsection 1 in the first part} 
\addcontentsline{toc}{subsection}{1.1. Subsection 1 in the first part}

Something...

\clearpage

\noindent \textbf{1.2. Subsection 2 in the first part} 
\addcontentsline{toc}{subsection}{1.2. Subsection 2 in the first part}

Something...

\clearpage

\begin{center}
\textbf{2. Second part introduction} 
\addcontentsline{toc}{section}{2. Second part introduction}
\end{center}

\clearpage

\noindent \textbf{2.1. Subsection 1 in the second part} 
\addcontentsline{toc}{subsection}{1.1. Subsection 1 in the second part}

Something...

\clearpage

\noindent \textbf{2.2. Subsection 2 in the second part} 
\addcontentsline{toc}{subsection}{1.2. Subsection 2 in the second part}

Something...

\clearpage

\begin{thebibliography}{a}
\addcontentsline{toc}{section}{References for the introduction}

\bibitem{Author}
Author. \textit{Title}. Edition and year.

\end{thebibliography}

\clearpage

\begin{center}
\textbf{Article 1.} 
\addcontentsline{toc}{chapter}{Article 1}
\end{center}

%\includepdf[pages=-]{./art1.pdf}

\clearpage

\begin{center}
\textbf{Article 2.} 
\addcontentsline{toc}{chapter}{Article 2}
\end{center}

%\includepdf[pages=-]{./art2.pdf}

\end{document}

중앙 섹션(섹션만, 아님) 등을 개선하여 \subsections문제 bookmarks도 해결합니다.

\documentclass[12pt,reqno]{report}

\usepackage[usenames]{color}
\usepackage[latin1]{inputenc} 
\usepackage{float}
\usepackage{bbm}
\usepackage[english]{babel} 
\usepackage{amssymb, amsmath}
\usepackage{geometry,graphicx}
\usepackage[final]{pdfpages}

%\addto\captionsenglish{%
%  \renewcommand{\bibname}{\begingroup\protect\centering \protect\Large References for the introduction\endgroup}
%}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma} 
\newtheorem{definition}[theorem]{Definition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{notation}[theorem]{Notation}
\newtheorem{example}[theorem]{Example}
\geometry{a4paper,twoside,top=3.5cm,bottom=3.5cm,left=3cm,right=3cm,headsep=1cm}

\setlength{\parskip}{0.5em}


\usepackage[nottoc]{tocbibind}
\usepackage{xpatch}


\renewcommand{\thesection}{\arabic{section}}

\makeatletter


%\AtBeginDocument{%


  \xpatchcmd{\@sect}{%
    \def\@svsechd{%
      #6{\hskip #3\relax
        \@svsec #8}}%
  }{%
    \def\@svsechd{%
      #6{\hskip #3\relax
        \begingroup\centering \@svsec #8 \endgroup}}%
  }{\typeout{Patch success}}{\typeout{first patch failed}}
  \xpatchcmd{\@sect}{%
    \begingroup
    #6{%
      \@hangfrom{\hskip #3\relax\@svsec}%
      \interlinepenalty \@M #8\@@par}%
    \endgroup%
  }{\begingroup
    #6{%
      \@hangfrom{\hskip #3\relax\@svsec}%
      \ifnum0=\pdfstrcmp{#1}{section}%
         \begingroup\centering
         \interlinepenalty \@M #8 \@@par\endgroup
         \else
         \interlinepenalty \@M #8 \@@par% Non - section types
      \fi
    }%
    \endgroup%
  }{}{\typeout{Second patch failed}}%
\makeatother

\usepackage{hyperref}

\begin{document}

%\includepdf[pages=-]{./coverthesis.pdf}

\newpage\null\thispagestyle{empty}\newpage

\begin{center}
\textbf{Abstract}
\end{center}

This is my abstract.

\tableofcontents

\clearpage



\phantomsection
\chapter*{\centering Introduction}
\addcontentsline{toc}{chapter}{Introduction}

\clearpage

\section{First part introduction} 
%\addcontentsline{toc}{section}{1. First part introduction}

Something...

\clearpage

\subsection{Subsection 1 in the first part} 
%\addcontentsline{toc}{subsection}{1.1. Subsection 1 in the first part}

Something...

\clearpage

\subsection{Subsection 2 in the first part}

Something...

\clearpage


\section{Second part introduction}

\clearpage

\subsection{Subsection 1 in the second part} 

Something...

\clearpage

\subsection{Subsection 2 in the second part} 

Something...

\clearpage

\begin{thebibliography}{a}
%\addcontentsline{toc}{section}{References for the introduction}

\bibitem{Author}
Author. \textit{Title}. Edition and year.

\end{thebibliography}

\clearpage

\chapter*{\centering Article 1}
\addcontentsline{toc}{chapter}{Article 1}

%\includepdf[pages=-]{./art1.pdf}

\clearpage

\chapter*{\centering Article 2}
\addcontentsline{toc}{chapter}{Article 2}

%\includepdf[pages=-]{./art2.pdf}

\end{document}

관련 정보