0

this is my very first time posting here, so hopefully I supply all necessary information needed to solve my problem.

I am writing my thesis in Latex and need a specific format for my table of contents (see picture1) and I have already tried quite a bit of options found in different threats, but was not able to stitch it together in a way working for me.

CorrectTOC

My current code creates the following: ProblemTOC

My questions would therefore include:

  1. After "Chapter X" no page number.
  2. Have the Chapter Name in normal and smaller font while Chapter stays bold& bigger (!but only in the TOC, because both need to stay bold in the actual Chapters.!)
  3. Reduce the spacing between Chapter and Chapter Name, but still have an increased one between chapters.

I hope you can help me, as I've been not able to solve this on my own for months.

\documentclass[11pt, twoside]{report}
\linespread{1.5}        %line spacing 1.5
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}
\setlength{\headheight}{15pt}% ...at least 14.49998pt
%Font and Language
\usepackage[T1]{fontenc} 
\renewcommand{\rmdefault}{phv} % Arial
\renewcommand{\sfdefault}{phv} % Arial
\usepackage[english]{babel}

%Header & Footer
\usepackage{fancyhdr}   %for header and footer
\usepackage{titlesec}   %center heading and title

%Chapters
\titleformat{\chapter}[display]
{\normalfont\Large\bfseries}{\centering\chaptertitlename\ \thechapter}{10pt}{\centering\LARGE}
\titlespacing{\chapter}{0pt}{-15pt}{25.5pt}

%Table of Content
\usepackage{tocloft}
\renewcommand\numberline[1]{} 

\usepackage{subfiles}   % For subfiling; best loaded last in the preamble

\newcommand*{\myfont}{\fontfamily{pzc}\selectfont}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{tocdepth}{0}
\tableofcontents{}      %Table of Contents
\pagenumbering{gobble}
\newpage

%%%%%%%%%%%%%%
\chapter[Chapter 1]{\centering General Introduction}
\addcontentsline{toc}{chapter}{General Introduction}
subfile{Chapters/Chapter1_Introduction}

%%%%%%%%%%%%%%
\chapter[Chapter 2]{\centering Chapter 2}
\addcontentsline{toc}{chapter}{Chapter 2 Name}
%subfile{Chapters/Chapter2)

%%%%%%%%%%%%%%
etc...
%%%%%%%%%%%%%%
\end{document}
2
  • as an initial comment don't use formatting like \chapter[Chapter 1]{\centering General Introduction} it is bad style and makes your job a lot harder. Remove the \centering from the argument, the formatting should be specified elsewhere, as it is you are specifying \centering everywhere the text is used, table of contents, pdf bookmarks, page running head, as well as the actual chapter heading (some of which you avoid with [Cha.. optional argument, but that should not be needed May 20, 2021 at 11:43
  • Thank you for your comment. I am aware, that it might not be the best style and that it is definitely more a work-around. I will definitely look into this after fixing the current problems, so thank you for pointing it out again.
    – JustusHg
    May 20, 2021 at 12:57

1 Answer 1

0

Try this modification of your MWE, for which thank you. It essentailly uses tocloft capabilities.

% thesistocprob.tex  SE 597856

\documentclass[11pt, twoside]{report}
\usepackage{lipsum}

\linespread{1.5}        %line spacing 1.5
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}
\setlength{\headheight}{15pt}% ...at least 14.49998pt
%Font and Language
\usepackage[T1]{fontenc} 
\renewcommand{\rmdefault}{phv} % Arial
\renewcommand{\sfdefault}{phv} % Arial
\usepackage[english]{babel}

%Header & Footer
\usepackage{fancyhdr}   %for header and footer
\usepackage{titlesec}   %center heading and title

%Chapters
\titleformat{\chapter}[display]
{\normalfont\Large\bfseries}{\centering\chaptertitlename\ \thechapter}{10pt}{\centering\LARGE}
\titlespacing{\chapter}{0pt}{-15pt}{25.5pt}

%Table of Content
\usepackage{tocloft}
\renewcommand\numberline[1]{} 
\renewcommand{\cftchappagefont}{\phantom} % hides the page number

\newcommand*{\myfont}{\fontfamily{pzc}\selectfont}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setcounter{tocdepth}{0}
\tableofcontents{}      % Table of Contents
%\pagenumbering{gobble} % this stops ALL page numbering
\newpage

%%%%%%%%%%%%%%
\chapter[Chapter 1]{\centering General Introduction} \label{intro}
\addtocontents{toc}{General Introduction \hfill \pageref{intro}\par}
\lipsum[1]

This chapter starts on page \pageref{intro}.

\chapter[Chapter 2]{\centering Chapter 2} \label{name}
\addtocontents{toc}{Name \hfill \pageref{name}\par}
\lipsum[2]

This chapter starts on page \pageref{name}.

%%%%%%%%%%%%%%
etc...
%%%%%%%%%%%%%%
\end{document}

As you did it puts the optional \chapter argument into the ToC and blanks out the page number. The addtocontents macros just put their text into the ToC, which is basically the chapter name plus the page where the chapter starts; this is obtained via the standard \label and \pageref mechanisms.

enter image description here

You might want to change the code to suit your specific fonts, style of working, and other requirements (see @DavidCarlisle's comment).

2
  • Thank you!! It seems to do the trick. But I do have a problem: When using subfiles it changes back, meaning it looks fine for the Chapter 1 - General Introduction but already with Chapter 2 it is not working anymore. I tested it and without the subfiles, it works nicely, with subfiles the page number shows up again after the chapter 2 and the Chapter Name...
    – JustusHg
    Jun 3, 2021 at 9:06
  • @JustusHg I have no idea what you might have in your subfiles and I'm not prepared to try and create any. Please try and show your actual problem code in your question. No guarantee that I will look at it. Jun 4, 2021 at 18:32

You must log in to answer this question.

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