1

I have customised my TOC using tocloft so that it looks like this: toc appearance

I managed to have everything almost perfect, but I would like to know if it's possible to remove the indentation from the text titles (basically, as depicted by the arrow, to move the title to the left).

I have tried the indentation parameter from tocloft, but it moves the whole piece together (chapter number and chapter title) keeping the indentation between the two lines present.

Below you can find a MWE with all the changes I made:

\documentclass[11pt, b5paper, openright]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{lmodern} \usepackage{fancyhdr} \usepackage[top=25mm, bottom=25mm]{geometry} \usepackage{setspace} \usepackage{tocloft} \usepackage{titlesec} \usepackage{lipsum} \usepackage{microtype} \renewcommand{\chaptermark}[1]{% \markboth{CHAPTER \MakeUppercase{\Roman{chapter}}}{}} \titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{} \renewcommand{\thesection}{\arabic{section}} \addtocontents{toc}{\protect\thispagestyle{empty}} \renewcommand{\thechapter}{\Roman{chapter}} \setcounter{secnumdepth}{4} \setstretch{1.5} \setcounter{tocdepth}{3} \setlength{\headheight}{13.6pt} \addtolength{\topmargin}{-1.6pt} \renewcommand{\cftchapfont}{\bfseries} \renewcommand{\cftchappagefont}{\bfseries} \renewcommand{\cftchappresnum}{CHAPTER } \renewcommand{\cftchapaftersnumb}{\newline} \setlength{\cftchapindent}{0pt} \begin{document} \chapter*{Test 1} \lipsum[1] \chapter*{Test 2} \lipsum[1] \clearpage \tableofcontents \chapter{Text title of CHAPTER 1: Lets make it long to simulate my real titles in the original file} \section{Section 1} \lipsum[1] \section{Section 2} \lipsum[1] \section{Section 3} \lipsum[1] \chapter{Text title of CHAPTER 2: Lets make it long to simulate my real titles in the original file} \section{Section 1} \lipsum[1] \section{Section 2} \lipsum[1] \section{Section 3} \lipsum[1] \end{document} 

Thanks for your time!

2
  • I thought once it was solved, I could write a new question and autosolve it myself with the solution for the rendering issue...If that's not OK, I'll ask a new question. Sorry Commented Jan 22 at 11:23
  • I totally understand. I will edit the question. Let's see if someone can help me anyway :) Commented Jan 22 at 12:06

1 Answer 1

0

The space you see in front of the chapter titles is reserved for the chapter number. You can change the width of the reserved space with \setlength{\cftchapnumwidth}{...}:

\documentclass[11pt, b5paper, openright]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{lmodern} \usepackage{fancyhdr} \usepackage[top=25mm, bottom=25mm]{geometry} \usepackage{setspace} \usepackage{tocloft} \usepackage{titlesec} \usepackage{lipsum} \usepackage{microtype} \renewcommand{\chaptermark}[1]{% \markboth{CHAPTER \MakeUppercase{\Roman{chapter}}}{}} \titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{} \renewcommand{\thesection}{\arabic{section}} \addtocontents{toc}{\protect\thispagestyle{empty}} \renewcommand{\thechapter}{\Roman{chapter}} \setcounter{secnumdepth}{4} \setstretch{1.25} \setcounter{tocdepth}{3} \setlength{\headheight}{13.6pt} \addtolength{\topmargin}{-1.6pt} \renewcommand{\cftchapfont}{\bfseries} \renewcommand{\cftchappagefont}{\bfseries} \renewcommand{\cftchappresnum}{CHAPTER } \renewcommand{\cftchapaftersnumb}{\newline} \setlength{\cftchapindent}{0pt} \setlength{\cftchapnumwidth}{0pt} \begin{document} \tableofcontents \chapter*{Test 1} \lipsum[1] \chapter*{Test 2} \lipsum[1] \clearpage \chapter{Text title of CHAPTER 1: Lets make it long to simulate my real titles in the original file} \section{Section 1} \lipsum[1] \section{Section 2} \lipsum[1] \section{Section 3} \lipsum[1] \chapter{Text title of CHAPTER 2: Lets make it long to simulate my real titles in the original file} \section{Section 1} \lipsum[1] \section{Section 2} \lipsum[1] \section{Section 3} \lipsum[1] \end{document} 

enter image description here

1
  • Now that I see it it makes all the sense. I guess the space was still kept before the text even though they were in separate lines. Thanks for you help! Commented Jan 23 at 8:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.