2015-02-04 3 views
2

저는 간단한 tex 파일을 가지고 있습니다. $ pdflatex test.tex으로 컴파일하면 pdf가 생성됩니다. 목차에는 클릭 가능한 링크가 있지만 작동하지 않습니다! 페이지 번호 매기기는 정확하지만 한 줄을 클릭하면 나를 잘못된 페이지로 안내합니다.toc 링크가 잘못된 페이지를 가리키고 있습니다.

나는 그것을 고칠 수있는 사람이 누구인가?

여기 내 코드입니다 :

\documentclass[12pt,titlepage]{scrartcl} 

\usepackage[nottoc,numbib]{tocbibind} 
\usepackage{graphicx} 
\usepackage[section]{placeins} 
\usepackage{float} 
\usepackage{amsmath} 
\usepackage[autostyle=false,german=quotes]{csquotes} %% for \enquote{} 
\usepackage[ngerman]{babel} 
\usepackage[utf8]{inputenc} 
\usepackage{listings} 
\usepackage[]{hyperref} 
\title{test} 
\author{me} 
\date{\today} 

\begin{document} 
\pagenumbering{roman} 
\begin{titlepage} 
\maketitle 
\end{titlepage} 
\setcounter{section}{-1} 
\section[]{Abstract} 
blabla bla 
\newpage 
\tableofcontents 
\newpage 
\pagenumbering{arabic} 
\part{part1} 
\setcounter{section}{-1} 
\section[]{Abstract} 
\section{sec a 1} 
bla bla 
\subsection{sec a 1.1} 
bla blub 
\section{sec a 2} 
\newpage 
\part{part2} 
\setcounter{section}{-1} 
\section[]{Abstract} 
\section{sec b 1} % the toc entry for this section points to page 1 but it is on page 2 
blub blub 
\section{sec b 2} % the toc entry for this section points to page 1 but it is on page 2 
blub blub 
\subsection{sec b 2.1} % the subsection in the toc points to the right 2nd page! 

\end{document} 

여기 당신은 목차를 참조하십시오. 당신이 볼 수 있듯이, 힌트 위에 마우스는 페이지 1에 해당 링크 점을 알 수 있지만, 오른쪽의 숫자는

wrong link

미리 감사 2 페이지 말한다.

답변

2

링크로 연결될 수있는 hyperref 카운터를 다시 사용할 때마다 중복 된 하이퍼 링크가 발생합니다. 시각적으로는 괜찮지 만 문서의 내부에서는 점프가 모호합니다. 따라서 hyperref 몇 가지 도움을 제공해야합니다.

이 문제를 회피하고 hyperref 일부 지원을 제공하는 쉬운 방법은 hyperref를로드 한 후 프리앰블

\renewcommand{\theHsection}{\thepart.section.\thesection} 

에 추가하는 것입니다. 위의 예는 hyperref- 관련 \section 링크 앞에 \thepart.을 붙입니다. \section 카운터를 다시 사용하면 \part을 사용하므로이 링크를 추가하면 고유 링크가 만들어져 모호한 대상이 제거됩니다.

+0

감사합니다. 나는 오늘 집에 돌아가서 그것이 나를 위해 일하면 답을 받아 들일 때 오늘 저녁에 시험해 볼 것입니다. – linluk

+0

다시 한 번 감사드립니다. 그것은 완벽하게 작동합니다! – linluk

관련 문제