Text FormattingDot distance in TOC, LOT and LOF inconsistent

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
koba8791
Posts: 8
Joined: Thu Apr 15, 2021 10:39 pm

Dot distance in TOC, LOT and LOF inconsistent

Post by koba8791 »

For some reason that I have been unable to figure out, my TOC has the dotted lines set to 2 and the LOF and LOT are set at 4.5.

I want them all to be at 4.5.

Help please! Code below.

Code: Select all

\documentclass[a4paper,12pt]{article}

\usepackage{graphicx}
\usepackage{graphicx,subfigure}
\usepackage{hyperref}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{placeins}
%\usepackage{tocloft}
\usepackage{subfigure}
\usepackage[subfigure]{tocloft}
\usepackage{fancyhdr}
\fancypagestyle{plain}{% Redefining plain page style
  \fancyhf{}
  \fancyhead{}%clear all header and footer fields
  \fancyfoot[R]{\thepage}
}%

\usepackage{mathptmx}
\usepackage{sectsty}
\sectionfont{\fontsize{12}{14}\selectfont}
\subsectionfont{\fontsize{12}{14}\selectfont}
\subsubsectionfont{\fontsize{12}{14}\selectfont}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{courier}
\usepackage{setspace}
\usepackage[table,svgnames]{xcolor}
\usepackage{fancyvrb} 
\usepackage{listings}

\usepackage[labelsep=period]{caption}
\usepackage[justification=centering]{caption}
\usepackage[labelfont=bf]{caption}
\addto\captionsenglish{\renewcommand{\figurename}{Fig.}}
\DeclareCaptionFont{mysize}{\fontsize{11}{13}\selectfont}
\captionsetup{font=mysize, singlelinecheck=off}

\addto\captionsenglish{
\renewcommand*{\cftfigfont}{Fig. }
\renewcommand*{\cfttabfont}{Table }
\renewcommand*{\cftfigaftersnum}{.}
\renewcommand*{\cfttabaftersnum}{.} }
\setlength{\cfttabindent}{0pt}
\setlength{\cftfigindent}{0pt}
\renewcommand{\cfttabaftersnumb}{\hspace{-1em}}
\addto\captionsenglish{
\renewcommand*\contentsname{List of Contents}
\renewcommand*\cftloftitlefont{\fontsize{12}{13}\bfseries\selectfont}
\renewcommand*\cftlottitlefont{\fontsize{12}{13}\bfseries\selectfont}
\renewcommand*\cfttoctitlefont{\fontsize{12}{13}\bfseries\selectfont}
\renewcommand{\cftsecleader}{\cftdotfill{\cftsecdotsep}}
\renewcommand\cftsecdotsep{\cftdot}
\renewcommand\cftsubsecdotsep{\cftdot}
\renewcommand\cftsubsubsecdotsep{\cftdot}
\renewcommand\cftbeforesecskip{2pt}
}
Last edited by Stefan Kottwitz on Thu Apr 22, 2021 11:52 pm, edited 1 time in total.
Reason: code marked

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Bartman
Posts: 367
Joined: Fri Jan 03, 2020 2:39 pm

Dot distance in TOC, LOT and LOF inconsistent

Post by Bartman »

Replace \cftdot by \cftdotsep in the definition of the \cftsecdotsep command.

Remove the changes to the dotted lines for the last two levels of outline (\cftsubsecdotsep, \cftsubsubsecdotsep) to keep the initial state.
koba8791
Posts: 8
Joined: Thu Apr 15, 2021 10:39 pm

Dot distance in TOC, LOT and LOF inconsistent

Post by koba8791 »

Thanks!
Post Reply