开发者

Inconsistent styling in latex table of contents?

开发者 https://www.devze.com 2023-01-16 23:19 出处:网络
I\'m wondering why in my toc shown below, I have different dots style in the most detailed subsections ?

I'm wondering why in my toc shown below, I have different dots style in the most detailed subsections ?

Inconsistent styling in latex table of contents?

All I've used is:

\setcounter{secnumdepth}{5}
开发者_运维问答\setcounter{tocdepth}{5}
....
\tableofcontents

How can I create a consistent style at all levels of depth: section, subsection, etc?


It really depends on the document class you are using; book, article etc have a preset layout for the TOC.

Since you said you are writing your Thesis, is it possible that you are using a style given by the college/university?

There is still a way to change it. You can use the package tocloft,

\usepackage{tocloft}

which has a method called \@dotsep to change the amount of space between the dots. Although I do not know if it will work in this case as you only define it once for the whole TOC and if it is relative to what you have it may just increase your dots relative to the way it is already placed.

But here is the code anyways,

\makeatletter \renewcommand{\@dotsep}{4.5} \makeatother
\tableofcontents

It must be placed before your toc command and 4.5 represents the distance.

But like I said this depends on your document class and its style class. Here is the link to the package documentation tocloft.pdf. There are more customizations available which may work for you better.


At least in the article class, they already have a standard style, but to also get dot leaders for sections like the ones in subsections, just use this:

\usepackage{tocloft}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号