Frontmatter 和 hyperref 无法一起工作!

Frontmatter 和 hyperref 无法一起工作!

我有一份文档,其中目录前有一个“摘要”部分。添加了摘要部分以测试它是否可行,但当我在目录中单击它时,它会转到首页、标题页,而不是摘要页。请帮忙。

\documentclass[a4paper, 12pt]{extarticle}

\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[danish]{babel}
\usepackage{fancyhdr}
\usepackage[dvipsnames]{xcolor}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{titlesec}
\usepackage[left=0.5in, right=0.5in, top=0.8in, bottom=0.8in]{geometry}
\usepackage{lipsum}
\usepackage[breaklinks, colorlinks,linkcolor=NavyBlue, citecolor=Blue, urlcolor=Blue, linktoc=all]{hyperref}
\usepackage[utf8x]{inputenc}
\usepackage{titlesec}
\usepackage{fix-cm}
\usepackage{titletoc}
\usepackage{tocloft}
\usepackage{setspace}
\usepackage[all]{hypcap}
\usepackage{tikz, pgfplots}
\usepackage{mhchem}
\pagestyle{fancy}


\fancyhf{}
\fancyfoot[R]{\textbf \thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{2pt}
\renewcommand{\footrule}{\hbox to\headwidth{\color{Blue}\leaders\hrule height \footrulewidth\hfill}}

\newcommand{\dl}[1]{\underline{\underline{#1}}}

\renewcommand\cftsecafterpnum{\vskip15pt}
\renewcommand{\cftdot}{\textbf{.}}
\renewcommand{\cfttoctitlefont}{\bfseries \fontsize{30}{0}\selectfont \fontfamily{put}\selectfont}
\renewcommand{\cftsecfont}{\bfseries \fontsize{14}{0}\selectfont \fontfamily{put}\selectfont}
\renewcommand{\cftsubsecfont}{ \fontsize{11}{0}\selectfont \fontfamily{put}\selectfont}
\renewcommand{\cftsubsecafterpnum}{\vskip1ex}
\renewcommand{\cftsubsubsecfont}{ \fontsize{11}{0}\selectfont \fontfamily{put}\selectfont}
\renewcommand{\cftsubsubsecafterpnum}{\vskip1ex}




\setcounter{secnumdepth}{0}

\begin{document}
\begin{titlepage}
\begin{center}
\vspace*{25ex}
\rule{6.5in}{2pt}\\
[-2ex]
\rule{6.5in}{1pt}\\
[4.5mm]
{\fontsize{38}{0}\selectfont \bfseries \scshape  \color{Blue}Git\color{blue}ter\color{Blue}lig\color{blue}ning} \\
\rule{6.5in}{1pt}\\
[-1.8ex]
\rule{6.5in}{2pt}\\
[14ex]
{ \fontsize{15}{0}\selectfont Ali, Casper, Jannick \& San}\\
[3ex]
{\large \scshape 1.z} \\
\vspace{\fill}
\includegraphics[scale=0.45]{C:/LaTeX/Next.png} \\
[4mm]
\small{\bfseries Albertslund Gymnasium \& HF} \\
\end{center}
\end{titlepage}
\clearpage

\renewcommand\contentsname{Indhold \vspace{3ex}}
\setcounter{page}{1}
\pagenumbering{roman}
\section*{Abstract}
\addcontentsline{toc}{section}{Abstract}
Bla. bla. bla.
\newpage

\tableofcontents
\thispagestyle{empty}
\newpage
\setcounter{page}{1}
\titleformat{\section}{\bfseries}{\fontsize{50}{0}\selectfont \color{Blue} \thesection}
{1ex}
{\Huge}
\titlespacing*{\section}{10pt}{6ex}{4ex}
\pagenumbering{arabic}
\section{Regneopgaver}
\subsection{Opg. 1}

答案1

\phantomsection在摘要前添加锚点( ):

\phantomsection
\section*{Abstract}

相关内容