Adjust Default Table of Contents Styling

The default TOC template (using LaTeX) can be modified by adjusting values in the template. Below are instructions for applying commonly requested modifications.

Sections

Add vertical space before and after each section

Add preferred width of space (e.g., \\[10pt]) as new lines before and/or after the \\tocitem{#1}{#2}{#3}{\textbf{#4}}{\textbf{#5}}{\textbf{#6}}{\textbf{#7}} line:

\newcommand{\bolditem}[7]{%

          \\[10pt] - before section

          \tocitem{#1}{#2}{#3}{\textbf{#4}}{\textbf{#5}}{\textbf{#6}}{\textbf{#7}}

          \\[5pt]after section

2020-09-16_7-58-28.jpg

Remove bolding from section names

Remove \\tocitem{#1}{#2}{#3}{\textbf{#4}}{\textbf{#5}}{\textbf{#6}}{\textbf{#7}} and replace with the following:

\tocitem{#1}{#2}{#3}{#4}{#5}{#6}{#7}

2020-09-16_7-59-19.jpg

Font size

Set overall font size

Replace the highlighted number with preferred font size in the following line:

<__math equation="11" assign="font_size"__>

2020-09-16_8-03-25.jpg

Decrease font size for each subsequent level

Remove <__math equation="11" assign="font_size"__> and replace with the following:

<__math equation="11-x" x=$Documents[ind].LevelNum assign="font_size"__>

2020-09-16_8-04-17.jpg

Indenting

Set space reserved for numbering

Replace the highlighted number with the preferred width of space in the following line:

\noindent\begin{tabularx}{\textwidth}{b{#1}p{40pt}@{}X b{40pt}}

2020-09-16_8-09-47.jpg

Ensure that the indent is large enough to contain all numbers in all levels of depth. 

If there is not enough space for the entire number, the layout will become distorted.


2020-09-16_8-04-53.jpg

Set indent for each subsequent level

Replace the highlighted number with the preferred width of indent in the following line:

{<__math equation="l*level" l=40 level=$Documents[ind].LevelNum__>pt}%

2020-09-16_8-14-17.jpg

Match the indent to the previous header

To set the same indent width as the previous header, the indent values simply need to match. 

See the above instructions for setting indent width:

Can't find the settings?

If you can't find the options mentioned above, or are looking to make additional adjustments, reach out to the DocBoss team for support.