GeneralTOC subsection not indenting

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
isupport
Posts: 3
Joined: Fri Jun 22, 2018 7:18 am

TOC subsection not indenting

Post by isupport »

Pardon me, I am new to this blog.
I got a lot of help with Latex community related to my project, for
which I am grateful.

I looked around various websites related to my question i.e. how
do I increase the indentation for subsection? Am I missing something in my code?

Note : The entire project is working correctly except subsection indentation
Have enclosed a screenshot

Thank you.
Attachments
Screen Shot .png
Screen Shot .png (57.25 KiB) Viewed 4535 times
contents.tex
(1.47 KiB) Downloaded 156 times
Main.tex
(1.99 KiB) Downloaded 153 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

TOC subsection not indenting

Post by Stefan Kottwitz »

Welcome to the forum!

There are many errors in this document. Perhaps take a closer look at the error messages you get.

But to the point of your question. The subsection number width (indent) can be set this way:

\renewcommand*{\cftsubsecnumwidth}{4em}

But it only shows effect if you remove this redefinition in your file, that changes that number width:

\renewcommand*{\numberline}[1]{\hb@xt@3em{#1\hfil}}

Stefan
LaTeX.org admin
isupport
Posts: 3
Joined: Fri Jun 22, 2018 7:18 am

TOC subsection not indenting

Post by isupport »

Thank you for a prompt response.

Per your instruction, I remarked
\renewcommand*{\numberline}[1]{\hb@xt@3em{#1\hfil}}
and inserted
\renewcommand*{\cftsubsecnumwidth}{4em}

After recompiling, the Chapter and Section Level got overlapped
however the Subsection indented correctly in TOC.
I reinstated the old entry and remarked the new. Then I changed
{\hb@xt@3em{#1\hfil} ---> @3em to @4em and it worked correctly
without affecting Chapter and Section.

Thank you for pointing out the {\hb@xt@3em{#1\hfil} parameter.
I will search for what each variable in the parameters stand for.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

TOC subsection not indenting

Post by Stefan Kottwitz »

This code makes a horizontal box (\hb@xt@) of 3em width, put's the number flushed to the left (\hfil fills until the right of the box). Don't worry about that code snippet, it's typical internal stuff. The more @ in a macro name, the more internal. :-)

Stefan
LaTeX.org admin
isupport
Posts: 3
Joined: Fri Jun 22, 2018 7:18 am

TOC subsection not indenting

Post by isupport »

Is there a website to learn Latex commands to start a project from scratch ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

TOC subsection not indenting

Post by Stefan Kottwitz »

You could choose one from the web sites here: LaTeX Material and Resources for Beginners.

I wrote a LaTeX Beginner's Guide, that may help with the usual start topics. And a LaTeX Cookbook with full recipes for this and that (samples and all source codes: http://latex-cookbook.net/). Just if you are interested in books too, and they are available as ebook as well (starting $10).

Stefan
LaTeX.org admin
Post Reply