0

I have already tried following links, those didn't help:

Why is the page number for Contents wrong?

Wrong page number in contents

Wrong page numbering for list of figures and list of tables in Table of Contents!

Below is my mwe:

\documentclass[%
english,
cdfont=false,
cdtitle=color,
cdfont=nodin
]{tudscrreprt}
\usepackage[T1]{fontenc}
\usepackage{selinput}\SelectInputMappings{adieresis={ä},germandbls={ß}}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,bookmarksopenlevel=0,bookmarksnumbered=true,
        hypertexnames=false,colorlinks,linkcolor={blue},citecolor={blue},urlcolor={black},]{hyperref}
\usepackage[backend=biber,style=numeric,sorting=none]{biblatex}
\usepackage{isodate}
\usepackage{blindtext}
\usepackage{tudscrsupervisor}
\usepackage{enumitem}\setlist{noitemsep}
\usepackage[parfill]{parskip}% for no indentation in paragraphs
\usepackage{graphicx}
\usepackage{placeins}% for floatbarrier
\usepackage{caption}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{tabularx}
% \newcolumntype{C}{>{\flushleft\arraybackslash}}
\usepackage{subcaption}
\usepackage{makecell}% for multi-line cells in table
\usepackage{multirow}
\usepackage{arydshln}% for \hdashline    -----------------
% \usepackage{titlesec}
\usepackage[toc,page]{appendix}% for appendix
% \usepackage{subfig}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TO MARKUP
% \usepackage[color=blue!30]{pdfcomment}%to disable add option [final]
%usage: \pdfmarkupcomment[color=yellow]{New text}{Comment or old text or whatever}
\usepackage[disable]{todonotes}% USAGE : \todo{Don't forget to put a real introduction here.}
\newcounter{todocounter}%   TO ENUMERATE TODO LIST
\newcommand{\todonum}[2][]
{\stepcounter{todocounter}\todo[inline,size=\small,#1]{\thetodocounter: #2}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NEW COMMANDS FOR THE DESIGN
\newcommand{\vco}{\emph{vco\_S3 }}
\newcommand{\vtoi}{\emph{vco\_v2i }}
\newcommand{\ro}{\emph{vco\_ro\_top }}
\newcommand{\clkbuf}{\emph{clkbuf }}
\newcommand{\rocap}{\emph{vco\_ro\_cap }}
\newcommand{\ampcap}{\emph{vco\_amp\_cap }}
\newcommand{\vcoamp}{\emph{vco\_amp\_S3 }}
\newcommand{\itoi}{\emph{vco\_i2i }}
\newcommand{\rostg}{\emph{vco\_ro\_4stage }}
\newcommand{\rols}{\emph{vco\_ro\_ls\_pin }}
\newcommand{\vdd}{\emph{VDD }}
\newcommand{\vsss}{\emph{VSS }}
\newcommand{\avdd}{\emph{AVDD }}
\newcommand{\avss}{\emph{AVSS }}
\newcommand{\fqdiv}{\emph{fqdiv\_top }}
\newcommand{\myro}{\emph{ro\_15\_stg }}
\newcommand{\mydiv}{\emph{div1X2 }}
\newcommand{\pll}{\emph{pll\_main }}
\newcommand{\lock}{\emph{lock }}
\newcommand{\lpf}{\emph{lpf }}
\newcommand{\pfdcp}{\emph{pfdcp }}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
\usepackage{tocloft}    %% it's needed to make my own something, i dont remember
\setcounter{secnumdepth}{\subparagraphnumdepth}
\setcounter{tocdepth}{\subparagraphnumdepth}
\cftsetindents{subsection}{3.8em}{2.5em}
\cftsetindents{subsubsection}{7em}{1em}% in em {indent}{numwidth}
\cftsetindents{paragraph}{7.5em}{5em}
\cftsetindents{subparagraph}{8em}{6em}
\usepackage{hyperref}
\begin{document}

\pagenumbering{roman}
\TUDoption{abstract}{section,multiple}
\begin{abstract}[pagestyle=empty.tudheadings]
\blindtext
\end{abstract}
\cleardoublepage
\addcontentsline{toc}{chapter}{Contents}

\tableofcontents
\cleardoublepage
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

\cleardoublepage
\addcontentsline{toc}{chapter}{List of Tables}
\listoftables
\vspace*{-10cm}
\lstlistoflistings
\addcontentsline{toc}{chapter}{List of Listings}
\clearpage
\pagenumbering{arabic}  %%%%%%% RESETTING PAGE NUMBERING TO 1.
\chapter{Requirement/Limitation}
\section{Layout Dependancy}
\section{corner Dependancy}
\chapter{Performance on a Large Design}
\section{Design}
\begin{table}[ht!]
\centering
% \vspace*{-1.5em}
\renewcommand*{\arraystretch}{1.5}
\caption{Input output parameters of post layout simulation of \fqdiv}
\begin{small}
\begin{tabular}{l:l|l:l:l:l}
 \hline
\multicolumn{2}{c:}{\textbf{Simulation Environment}}  & \multicolumn{4}{c}{\textbf{Output}}\\\hdashline
\textbf{Parameter} & \textbf{Value} & \multicolumn{2}{c:}{\textbf{Layout-1}} & \multicolumn{2}{c}{\textbf{Layout-2}}\\\cdashline{3-6}
 &  & \textbf{FINT} & \textbf{FOUT} & \textbf{FINT} & \textbf{FOUT} \\\hline\hline

Solver method & \makecell[l]{\emph{\normalsize direct}\\provides highest accuracy} &&&&\\\cdashline{1-2}
IR & \makecell[l]{\emph{\normalsize max}\\IR-drop is maximum voltage of\\all subnodes at every time point} &&&&\\\cdashline{1-2}
EM & \makecell[l]{\emph{\normalsize iavg}\\calculates average current for\\EM analysis} &&&&\\\cdashline{1-2}
Lifetime & \makecell[l]{\emph{\normalsize 200000 hours}\\Aging time for EM analysis} &&&&\\\cdashline{1-2}
Box mode & \makecell[l]{\emph{Gray box}} &&&&\\\hline
\end{tabular}
\end{small}
\label{tab:chp-9-sec-1-tab-1}
\end{table}

\section{Results}
\chapter{Future Works}


\begin{appendices}
\clearpage
\pagenumbering{arabic}\renewcommand{\thepage}{\thechapter-\arabic{page}}
\chapter{Parasitic Extraction}
\chapter{Development of Box Methodology}
\blindtext
\end{appendices}
\newpage

\clearpage
\pagenumbering{Roman}

\end{document}

Problem:

Contents, List of Figures and List of Tables links to page i. How do I solve it?

Update:

\usepackage{tocloft}

this package is responsible for this behavior. It is also not recommended to use this with koma-script. but i need this package for the following lines:

\cftsetindents{subsection}{3.8em}{2.5em}
\cftsetindents{subsubsection}{7em}{1em}% in em {indent}{numwidth}
\cftsetindents{paragraph}{7.5em}{5em}
\cftsetindents{subparagraph}{8em}{6em}

Is there workaround for these to work with tocbasic by koma-script?

tt_pre
  • 47
  • The code you provided is far from a MWE (minimal working example). Also I could not recreate your issue with the code you provided. The page numbers in ToC are correct. – Skillmon Sep 13 '17 at 11:28
  • the page numbers appearing on the toc are correct, but if you click on it, then they are going to page i. – tt_pre Sep 13 '17 at 11:34
  • Ah, so you mean the hyperref targets are wrong. – Skillmon Sep 13 '17 at 11:36
  • For the tocbasic usage to setup those indents take a look at \DeclareTOCStyleEntry and the options indent and numwidth. A description of the command and the options should be in the official documentation (section 15.3 in the german version). – Skillmon Sep 13 '17 at 11:51

2 Answers2

1

You should add \phantomsection prior to the \addcontentsline macros:

\documentclass[%
english,
cdfont=false,
cdtitle=color,
cdfont=nodin
]{tudscrreprt}
\usepackage[T1]{fontenc}
\usepackage{selinput}\SelectInputMappings{adieresis={ä},germandbls={ß}}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,bookmarksopenlevel=0,bookmarksnumbered=true,
        hypertexnames=false,colorlinks,linkcolor={blue},citecolor={blue},urlcolor={black},]{hyperref}
\usepackage[backend=biber,style=numeric,sorting=none]{biblatex}
\usepackage{isodate}
\usepackage{blindtext}
\usepackage{tudscrsupervisor}
\usepackage{enumitem}\setlist{noitemsep}
\usepackage[parfill]{parskip}% for no indentation in paragraphs
\usepackage{graphicx}
\usepackage{placeins}% for floatbarrier
\usepackage{caption}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{tabularx}
% \newcolumntype{C}{>{\flushleft\arraybackslash}}
\usepackage{subcaption}
\usepackage{makecell}% for multi-line cells in table
\usepackage{multirow}
\usepackage{arydshln}% for \hdashline    -----------------
% \usepackage{titlesec}
\usepackage[toc,page]{appendix}% for appendix
% \usepackage{subfig}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TO MARKUP
% \usepackage[color=blue!30]{pdfcomment}%to disable add option [final]
%usage: \pdfmarkupcomment[color=yellow]{New text}{Comment or old text or whatever}
\usepackage[disable]{todonotes}% USAGE : \todo{Don't forget to put a real introduction here.}
\newcounter{todocounter}%   TO ENUMERATE TODO LIST
\newcommand{\todonum}[2][]
{\stepcounter{todocounter}\todo[inline,size=\small,#1]{\thetodocounter: #2}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NEW COMMANDS FOR THE DESIGN
\newcommand{\vco}{\emph{vco\_S3 }}
\newcommand{\vtoi}{\emph{vco\_v2i }}
\newcommand{\ro}{\emph{vco\_ro\_top }}
\newcommand{\clkbuf}{\emph{clkbuf }}
\newcommand{\rocap}{\emph{vco\_ro\_cap }}
\newcommand{\ampcap}{\emph{vco\_amp\_cap }}
\newcommand{\vcoamp}{\emph{vco\_amp\_S3 }}
\newcommand{\itoi}{\emph{vco\_i2i }}
\newcommand{\rostg}{\emph{vco\_ro\_4stage }}
\newcommand{\rols}{\emph{vco\_ro\_ls\_pin }}
\newcommand{\vdd}{\emph{VDD }}
\newcommand{\vsss}{\emph{VSS }}
\newcommand{\avdd}{\emph{AVDD }}
\newcommand{\avss}{\emph{AVSS }}
\newcommand{\fqdiv}{\emph{fqdiv\_top }}
\newcommand{\myro}{\emph{ro\_15\_stg }}
\newcommand{\mydiv}{\emph{div1X2 }}
\newcommand{\pll}{\emph{pll\_main }}
\newcommand{\lock}{\emph{lock }}
\newcommand{\lpf}{\emph{lpf }}
\newcommand{\pfdcp}{\emph{pfdcp }}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
\usepackage{tocloft}    %% it's needed to make my own something, i dont remember
\setcounter{secnumdepth}{\subparagraphnumdepth}
\setcounter{tocdepth}{\subparagraphnumdepth}
\cftsetindents{subsection}{3.8em}{2.5em}
\cftsetindents{subsubsection}{7em}{1em}% in em {indent}{numwidth}
\cftsetindents{paragraph}{7.5em}{5em}
\cftsetindents{subparagraph}{8em}{6em}
\usepackage{hyperref}
\begin{document}

\pagenumbering{roman}
\TUDoption{abstract}{section,multiple}
\begin{abstract}[pagestyle=empty.tudheadings]
\blindtext
\end{abstract}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Contents}

\tableofcontents
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{List of Tables}
\listoftables
\vspace*{-10cm}
\lstlistoflistings
\phantomsection
\addcontentsline{toc}{chapter}{List of Listings}
\clearpage
\pagenumbering{arabic}  %%%%%%% RESETTING PAGE NUMBERING TO 1.
\chapter{Requirement/Limitation}
\section{Layout Dependancy}
\section{corner Dependancy}
\chapter{Performance on a Large Design}
\section{Design}
\begin{table}[ht!]
\centering
% \vspace*{-1.5em}
\renewcommand*{\arraystretch}{1.5}
\caption{Input output parameters of post layout simulation of \fqdiv}
\begin{small}
\begin{tabular}{l:l|l:l:l:l}
 \hline
\multicolumn{2}{c:}{\textbf{Simulation Environment}}  & \multicolumn{4}{c}{\textbf{Output}}\\\hdashline
\textbf{Parameter} & \textbf{Value} & \multicolumn{2}{c:}{\textbf{Layout-1}} & \multicolumn{2}{c}{\textbf{Layout-2}}\\\cdashline{3-6}
 &  & \textbf{FINT} & \textbf{FOUT} & \textbf{FINT} & \textbf{FOUT} \\\hline\hline

Solver method & \makecell[l]{\emph{\normalsize direct}\\provides highest accuracy} &&&&\\\cdashline{1-2}
IR & \makecell[l]{\emph{\normalsize max}\\IR-drop is maximum voltage of\\all subnodes at every time point} &&&&\\\cdashline{1-2}
EM & \makecell[l]{\emph{\normalsize iavg}\\calculates average current for\\EM analysis} &&&&\\\cdashline{1-2}
Lifetime & \makecell[l]{\emph{\normalsize 200000 hours}\\Aging time for EM analysis} &&&&\\\cdashline{1-2}
Box mode & \makecell[l]{\emph{Gray box}} &&&&\\\hline
\end{tabular}
\end{small}
\label{tab:chp-9-sec-1-tab-1}
\end{table}

\section{Results}
\chapter{Future Works}


\begin{appendices}
\clearpage
\pagenumbering{arabic}\renewcommand{\thepage}{\thechapter-\arabic{page}}
\chapter{Parasitic Extraction}
\chapter{Development of Box Methodology}
\blindtext
\end{appendices}
\newpage

\clearpage
\pagenumbering{Roman}

\end{document}
Skillmon
  • 60,462
0

If you really want to use tocbasic instead of tocloft you should use \DeclareTOCStyleEntry:

\DeclareTOCStyleEntry[indent=3.8em,numwidth=2.5em]{default}{subsection}
\DeclareTOCStyleEntry[indent=7em,numwidth=3.5em]{default}{subsubsection}
\DeclareTOCStyleEntry[indent=7.5em,numwidth=5em]{default}{paragraph}
\DeclareTOCStyleEntry[indent=8em,numwidth=6em]{default}{subparagraph}

Embedded into your complete MWE:

\documentclass[%
english,
cdfont=false,
cdtitle=color,
cdfont=nodin
]{tudscrreprt}
\usepackage[T1]{fontenc}
\usepackage{selinput}\SelectInputMappings{adieresis={ä},germandbls={ß}}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,bookmarksopenlevel=0,bookmarksnumbered=true,
        hypertexnames=false,colorlinks,linkcolor={blue},citecolor={blue},urlcolor={black},]{hyperref}
\usepackage[backend=biber,style=numeric,sorting=none]{biblatex}
\usepackage{isodate}
\usepackage{blindtext}
\usepackage{tudscrsupervisor}
\usepackage{enumitem}\setlist{noitemsep}
\usepackage[parfill]{parskip}% for no indentation in paragraphs
\usepackage{graphicx}
\usepackage{placeins}% for floatbarrier
\usepackage{caption}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{tabularx}
% \newcolumntype{C}{>{\flushleft\arraybackslash}}
\usepackage{subcaption}
\usepackage{makecell}% for multi-line cells in table
\usepackage{multirow}
\usepackage{arydshln}% for \hdashline    -----------------
% \usepackage{titlesec}
\usepackage[toc,page]{appendix}% for appendix
% \usepackage{subfig}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TO MARKUP
% \usepackage[color=blue!30]{pdfcomment}%to disable add option [final]
%usage: \pdfmarkupcomment[color=yellow]{New text}{Comment or old text or whatever}
\usepackage[disable]{todonotes}% USAGE : \todo{Don't forget to put a real introduction here.}
\newcounter{todocounter}%   TO ENUMERATE TODO LIST
\newcommand{\todonum}[2][]
{\stepcounter{todocounter}\todo[inline,size=\small,#1]{\thetodocounter: #2}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NEW COMMANDS FOR THE DESIGN
\newcommand{\vco}{\emph{vco\_S3 }}
\newcommand{\vtoi}{\emph{vco\_v2i }}
\newcommand{\ro}{\emph{vco\_ro\_top }}
\newcommand{\clkbuf}{\emph{clkbuf }}
\newcommand{\rocap}{\emph{vco\_ro\_cap }}
\newcommand{\ampcap}{\emph{vco\_amp\_cap }}
\newcommand{\vcoamp}{\emph{vco\_amp\_S3 }}
\newcommand{\itoi}{\emph{vco\_i2i }}
\newcommand{\rostg}{\emph{vco\_ro\_4stage }}
\newcommand{\rols}{\emph{vco\_ro\_ls\_pin }}
\newcommand{\vdd}{\emph{VDD }}
\newcommand{\vsss}{\emph{VSS }}
\newcommand{\avdd}{\emph{AVDD }}
\newcommand{\avss}{\emph{AVSS }}
\newcommand{\fqdiv}{\emph{fqdiv\_top }}
\newcommand{\myro}{\emph{ro\_15\_stg }}
\newcommand{\mydiv}{\emph{div1X2 }}
\newcommand{\pll}{\emph{pll\_main }}
\newcommand{\lock}{\emph{lock }}
\newcommand{\lpf}{\emph{lpf }}
\newcommand{\pfdcp}{\emph{pfdcp }}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%\usepackage{tocloft}    %% it's needed to make my own something, i dont remember
\setcounter{secnumdepth}{\subparagraphnumdepth}
\setcounter{tocdepth}{\subparagraphnumdepth}
%\cftsetindents{subsection}{3.8em}{2.5em}
%\cftsetindents{subsubsection}{7em}{1em}% in em {indent}{numwidth}
%\cftsetindents{paragraph}{7.5em}{5em}
%\cftsetindents{subparagraph}{8em}{6em}
\DeclareTOCStyleEntry[indent=3.8em,numwidth=2.5em]{default}{subsection}
\DeclareTOCStyleEntry[indent=7em,numwidth=3.5em]{default}{subsubsection}
\DeclareTOCStyleEntry[indent=7.5em,numwidth=5em]{default}{paragraph}
\DeclareTOCStyleEntry[indent=8em,numwidth=6em]{default}{subparagraph}
\usepackage{hyperref}
\begin{document}

\pagenumbering{roman}
\TUDoption{abstract}{section,multiple}
\begin{abstract}[pagestyle=empty.tudheadings]
\blindtext
\end{abstract}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Contents}

\tableofcontents
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{List of Tables}
\listoftables
\vspace*{-10cm}
\lstlistoflistings
\phantomsection
\addcontentsline{toc}{chapter}{List of Listings}
\clearpage
\pagenumbering{arabic}  %%%%%%% RESETTING PAGE NUMBERING TO 1.
\chapter{Requirement/Limitation}
\section{Layout Dependancy}
\subsection{Foo}
\subsubsection{Bar}
\paragraph{Baz}
\subparagraph{foobar}
\section{corner Dependancy}
\chapter{Performance on a Large Design}
\section{Design}
\begin{table}[ht!]
\centering
% \vspace*{-1.5em}
\renewcommand*{\arraystretch}{1.5}
\caption{Input output parameters of post layout simulation of \fqdiv}
\begin{small}
\begin{tabular}{l:l|l:l:l:l}
 \hline
\multicolumn{2}{c:}{\textbf{Simulation Environment}}  & \multicolumn{4}{c}{\textbf{Output}}\\\hdashline
\textbf{Parameter} & \textbf{Value} & \multicolumn{2}{c:}{\textbf{Layout-1}} & \multicolumn{2}{c}{\textbf{Layout-2}}\\\cdashline{3-6}
 &  & \textbf{FINT} & \textbf{FOUT} & \textbf{FINT} & \textbf{FOUT} \\\hline\hline

Solver method & \makecell[l]{\emph{\normalsize direct}\\provides highest accuracy} &&&&\\\cdashline{1-2}
IR & \makecell[l]{\emph{\normalsize max}\\IR-drop is maximum voltage of\\all subnodes at every time point} &&&&\\\cdashline{1-2}
EM & \makecell[l]{\emph{\normalsize iavg}\\calculates average current for\\EM analysis} &&&&\\\cdashline{1-2}
Lifetime & \makecell[l]{\emph{\normalsize 200000 hours}\\Aging time for EM analysis} &&&&\\\cdashline{1-2}
Box mode & \makecell[l]{\emph{Gray box}} &&&&\\\hline
\end{tabular}
\end{small}
\label{tab:chp-9-sec-1-tab-1}
\end{table}

\section{Results}
\chapter{Future Works}


\begin{appendices}
\clearpage
\pagenumbering{arabic}\renewcommand{\thepage}{\thechapter-\arabic{page}}
\chapter{Parasitic Extraction}
\chapter{Development of Box Methodology}
\blindtext
\end{appendices}
\newpage

\clearpage
\pagenumbering{Roman}

\end{document}

Note that with this you might use the toc class option:

\documentclass[toc=listof% list of figures and tables in toc
  ,toc=bib% bibliography in toc
]{tudscrreprt}
Skillmon
  • 60,462