1

I have a document in which there is an 'Abstract' section before my ToC. The Abstract part is added to test if it would work, but when I click on it on my ToC, it goes to the front page, my title page, and not the Abstract page. Please help.

\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
  • you specify inputenc twice, both times with the non standard utf8x option, it's probaly better to use the standard utf8 (or with recent latex releases, you do not need inputenc at all) May 19, 2018 at 18:57

1 Answer 1

2

Add an anchor (\phantomsection) before the abstract:

\phantomsection
\section*{Abstract}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .