1

Here is my mwe:

\documentclass[%
english,
cdfont=false,
cdtitle=color,
cdfont=nodin
]{tudscrreprt}
\usepackage{blindtext}
\usepackage[toc,page]{appendix}
\usepackage{listings}
\usepackage{tocloft}
\begin{document}
  \pagenumbering{roman}

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

\listoftables
\addcontentsline{toc}{chapter}{List of Tables}
\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}
\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}

It outputs List of Figures and List of Tables in the same page but List of Listings in a new page. If I comment the \usepackage{tocloft} then, I get the List of Listings in the same page. But I need this package for some other purpose. Is there a clean work-around to bring the heading in the same page?

tt_pre
  • 47

1 Answers1

2

tudscrreprt bases on the KOMA-Script class scrreprt. So it loads package tocbasic to format the lists like LOF, LOT etc. and therefore it is not recommended to use package tocloft with this class. You will get warnings.

Additionally your \addcontentsline commands for the lists could result in a wrong page number for the TOC entry.

If the lists should not start a new page, then the lists should not use chapter level. So I would suggest something like:

\documentclass[%
  english,
  cdfont=false,
  cdtitle=color,
  cdfont=nodin,
  listof=totoc,% TOC entry for lists
  listof=leveldown% use section for the list headings
]{tudscrreprt}
\usepackage{babel}
\usepackage{blindtext}
\usepackage{listings}
\usepackage{scrhack}% <- added
\begin{document}
  \pagenumbering{roman}
  \tableofcontents
  \addchap{Lists}
  \listoffigures
  \listoftables
  \lstlistoflistings
  \cleardoubleoddpage
  \pagenumbering{arabic}
  \chapter{Requirement/Limitation}
  \section{Layout Dependancy}
  \section{corner Dependancy}
  \chapter{Performance on a Large Design}
  \section{Design}
  \section{Results}
  \chapter{Future Works}
\end{document}

Maybe you can ask how to replace tocloft by the possibilies of tocbasic for the other purpose.


If you really want to load tocloft with tudscrreprt (not recommended!!), then you can use this answer of @egreg:

\documentclass[%
  english,
  cdfont=false,
  cdtitle=color,
  cdfont=nodin
]{tudscrreprt}
\usepackage{}
\usepackage{blindtext}
\usepackage{listings}
\usepackage{tocloft}
\usepackage[nottoc]{tocbibind}% adds LOF and LOT to TOC

\makeatletter
\begingroup\let\newcounter\@gobble\let\setcounter\@gobbletwo
  \globaldefs\@ne \let\c@loldepth\@ne
  \newlistof{listings}{lol}{\lstlistlistingname}
\endgroup
\let\l@lstlisting\l@listings
\AtBeginDocument{\addtocontents{lol}{\protect\addvspace{10\p@}}}
\makeatother
\renewcommand{\lstlistoflistings}{\listoflistings}
\renewcommand\cftafterloltitle{\addchaptertocentry{}{\lstlistlistingname}}

\begin{document}
\pagenumbering{roman}
\tableofcontents
\newpage
\listoffigures
\listoftables
\lstlistoflistings
\cleardoubleoddpage
\pagenumbering{arabic}
\chapter{Requirement/Limitation}
\section{Layout Dependancy}
\section{corner Dependancy}
\chapter{Performance on a Large Design}
\section{Design}
\section{Results}
\chapter{Future Works}
\end{document}
esdd
  • 85,675