tocloft基于答案

tocloft基于答案

参考图

嗨!目录页、图表页和表格页上的点密度很少。您可以在添加的图像中看到我的稀有点和所需的密集点。我该如何解决这个问题?

谢谢。

\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[turkish,english,shorthands=:!]{babel}
\usepackage[a4paper,left=30mm,top=30mm,right=25mm,bottom=25mm]{geometry}
% Font and line spacing settings
\usepackage[scaled=1.00375]{newtxtext}
\usepackage[scaled=1.00375]{newtxmath}
\usepackage[nodisplayskipstretch]{setspace}
\setstretch{1.432818}% <-- 1.00375*1.427465
% Customize headings
\usepackage{titlesec}
\newcommand*{\myonevspace}{13.850574pt}% <-- Define a macro \myonehalfvspace
\newcommand*{\myonehalfvspace}{20.775861pt}% <-- Define a macro \myonehalfvspace
\newcommand*{\mytwovspace}{27.701147pt}% <-- Define a macro \mytwovspace
% For dummy texts, you can remove it.
\usepackage{lipsum} 
\usepackage{tocloft}
\usepackage{titlesec}
\usepackage{apacite}
\usepackage{graphicx}

\selectlanguage{turkish}





%****************************************
% CHAPTERS
%%% Chapter titles

% Chapter heading \titlespacing*{command}{left}{before-sep}{after-sep}[right-sep]
\titleformat{\chapter}
  {\normalfont\normalsize\bfseries}{\thechapter.}{.5em}{}
\titlespacing{\chapter}{1cm}{0cm plus 4pt minus 2pt}{\myonehalfvspace plus 2pt minus 2pt}
% Section heading
\titleformat{\section}
  {\normalfont\normalsize\bfseries}{\thesection.}{.5em}{}
\titlespacing{\section}{1cm}{\myonehalfvspace plus 4pt minus 2pt}{\myonehalfvspace plus 2pt minus 2pt}
% Subsection heading
\titleformat{\subsection}
  {\normalfont\normalsize\bfseries}{\thesubsection.}{.5em}{}
\titlespacing{\subsection}{1cm}{\mytwovspace plus 4pt minus 2pt}{\myonehalfvspace plus 2pt minus 2pt}
% Subsubsection heading
\titleformat{\subsubsection}
  {\normalfont\normalsize\bfseries}{\thesubsubsection.}{.5em}{}
\titlespacing{\subsubsection}{1cm}{\mytwovspace plus 4pt minus 2pt}{\myonehalfvspace plus 2pt minus 2pt}



\usepackage[unicode]{hyperref} %son yükle

% BEGIN
\begin{document}
\pagenumbering{gobble}

\pagenumbering{Roman}
\addtocontents{toc}{\hfill \underline{\textbf{Sayfa No}}\par} 

% Page ÖNSÖZ--------------
\addcontentsline{toc}{chapter}{ÖNSÖZ} 
\begin{center}
    \vspace*{0cm} % Top: 40mm olmalı
    {\fontsize{12pt}{12pt}\selectfont \textbf{ÖNSÖZ}}\\
\end{center}
\par \lipsum[1-1]
\clearpage
%-------------------------

% Page Etik--------------
\addcontentsline{toc}{chapter}{ETİK} 
\begin{center}
    \vspace*{0cm} % Top: 40mm olmalı
    {\fontsize{12pt}{12pt}\selectfont \textbf{ETİK}}\\
\end{center}
\par \lipsum[1-1]
\clearpage
%-------------------------

% Page TOC İçindekiler ---
\renewcommand*\contentsname{İÇİNDEKİLER}
\addcontentsline{toc}{chapter}{İÇİNDEKİLER} %içindekiler tablosunu içindekilerde gösterir.
\setcounter{secnumdepth}{3} %Kaç alt başlığın numarasını verecek belirler
\setcounter{tocdepth}{3}

\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % dots for chapters
\renewcommand{\cfttoctitlefont}{\MakeUppercase\hfil\bfseries\fontsize{12pt}{12pt}\selectfont}
    \vspace*{-1.8cm} 
\renewcommand\cftchapfont{\mdseries}
\renewcommand\cftchappagefont{\mdseries}
%\renewcommand{\cftchappresnum}{CHAPTER\space}
\renewcommand{\cftchapaftersnum}{.} 
\renewcommand{\cftsecaftersnum}{.} 
\renewcommand{\cftsubsecaftersnum}{.} 
\renewcommand{\cftsubsubsecaftersnum}{.} 

%\setlength{\cftbeforetoctitleskip}{10mm} 
\setlength{\cftaftertoctitleskip}{1\baselineskip}
\setlength{\cftchapnumwidth}{4em}
\setlength{\cftsecnumwidth}{4em}
\setlength{\cftsubsecnumwidth}{4em}

\setlength{\cftchapindent}{0em}
\setlength{\cftsecindent}{0em}
\setlength{\cftsubsecindent}{0em}
\setlength{\cftsubsubsecindent}{0em}

% Spacing between items
\setlength{\cftbeforechapskip}{7pt}
\setlength{\cftbeforesecskip}{\cftbeforechapskip}
\setlength{\cftbeforesubsecskip}{\cftbeforechapskip}
\setlength{\cftbeforesubsubsecskip}{\cftbeforechapskip}

\begin{singlespace}
\tableofcontents
\end{singlespace}
\clearpage
%-------------------------

% Page Figures Şekiller ---
\renewcommand*\listfigurename{ŞEKİLLER DİZİNİ}
\addtocontents{lof}{\par\nobreak\textbf{{\scshape } \hfill} \underline{\textbf{Sayfa No}}\par\nobreak} %{\scshape Şekil} kısmı eklenebilir.
\renewcommand{\cftloftitlefont}{\MakeUppercase\hfil\bfseries\fontsize{12pt}{12pt}\selectfont}
\renewcommand{\cftfigaftersnum}{.}
\renewcommand*\cftfigpresnum{Şekil~}
\settowidth{\cftfignumwidth}{\cftfigpresnum}
\renewcommand{\cftfigaftersnumb}{\quad~~}
\setlength{\cftbeforeloftitleskip}{10mm}
\setlength{\cftafterloftitleskip}{1\baselineskip}
\setlength{\cftbeforefigskip}{\cftbeforechapskip}

\begin{singlespace}
\listoffigures
\end{singlespace}
\clearpage
%-------------------------

% Page Tables Tablolar ---
\renewcommand*\listtablename{TABLOLAR DİZİNİ}
\addtocontents{lot}{\par\nobreak\textbf{{\scshape } \hfill} \underline{Sayfa No}\par\nobreak}
\renewcommand{\cftlottitlefont}{\MakeUppercase\hfil\bfseries\fontsize{12pt}{12pt}\selectfont}
\renewcommand{\cfttabaftersnum}{.}
\renewcommand*\cfttabpresnum{Tablo~}
\settowidth{\cfttabnumwidth}{\cfttabpresnum}
\renewcommand{\cfttabaftersnumb}{\quad~~}
\setlength{\cftbeforelottitleskip}{10mm}
\setlength{\cftafterlottitleskip}{1\baselineskip}
\setlength{\cftbeforetabskip}{\cftbeforechapskip}

\begin{singlespace}
\listoftables
\end{singlespace}
\clearpage
%-------------------------

\pagenumbering{arabic}


\chapter{CHAPTER}
\section{Section}
\lipsum[1]
\begin{figure}[h!]
  \centering
  %\includegraphics[height=6cm]{http://www.knittedhome.com/communities/5/004/012/872/235/images/4628207884.jpg}
  \caption{Sample Image}
  \label{fig:Sample}
\end{figure}
\subsection{Subsection}
\lipsum[2-3]
\begin{table}[]
\centering
\begin{tabular}{lllll}
DF & DF &    & S  & S  \\
   & S  & DF &    &    \\
   & S  &    & DF &    \\
   & SD &    &    & DF
\end{tabular}
\caption{Deneme Tablosu Bir}
\label{my-label}
\end{table}
\subsubsection{Subsubsection}
\lipsum[3-5]
%.........................

\end{document}

答案1

tocloft基于答案

您可以重新定义\cftdotsep为更小的东西以获得更窄的点(我用标记了相应的线% <------- THIS LINE CHANGED):

\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[turkish,english,shorthands=:!]{babel}
\usepackage[a4paper,left=30mm,top=30mm,right=25mm,bottom=25mm]{geometry}
% Font and line spacing settings
\usepackage[scaled=1.00375]{newtxtext}
\usepackage[scaled=1.00375]{newtxmath}
\usepackage[nodisplayskipstretch]{setspace}
\setstretch{1.432818}% <-- 1.00375*1.427465
% Customize headings
\usepackage{titlesec}
\newcommand*{\myonevspace}{13.850574pt}% <-- Define a macro \myonehalfvspace
\newcommand*{\myonehalfvspace}{20.775861pt}% <-- Define a macro \myonehalfvspace
\newcommand*{\mytwovspace}{27.701147pt}% <-- Define a macro \mytwovspace
% For dummy texts, you can remove it.
\usepackage{lipsum} 
\usepackage{tocloft}
\usepackage{titlesec}
\usepackage{apacite}
\usepackage{graphicx}

\selectlanguage{turkish}





%****************************************
% CHAPTERS
%%% Chapter titles

% Chapter heading \titlespacing*{command}{left}{before-sep}{after-sep}[right-sep]
\titleformat{\chapter}
  {\normalfont\normalsize\bfseries}{\thechapter.}{.5em}{}
\titlespacing{\chapter}{1cm}{0cm plus 4pt minus 2pt}{\myonehalfvspace plus 2pt minus 2pt}
% Section heading
\titleformat{\section}
  {\normalfont\normalsize\bfseries}{\thesection.}{.5em}{}
\titlespacing{\section}{1cm}{\myonehalfvspace plus 4pt minus 2pt}{\myonehalfvspace plus 2pt minus 2pt}
% Subsection heading
\titleformat{\subsection}
  {\normalfont\normalsize\bfseries}{\thesubsection.}{.5em}{}
\titlespacing{\subsection}{1cm}{\mytwovspace plus 4pt minus 2pt}{\myonehalfvspace plus 2pt minus 2pt}
% Subsubsection heading
\titleformat{\subsubsection}
  {\normalfont\normalsize\bfseries}{\thesubsubsection.}{.5em}{}
\titlespacing{\subsubsection}{1cm}{\mytwovspace plus 4pt minus 2pt}{\myonehalfvspace plus 2pt minus 2pt}



\usepackage[unicode]{hyperref} %son yükle

% BEGIN
\begin{document}
\pagenumbering{gobble}

\pagenumbering{Roman}
\addtocontents{toc}{\hfill \underline{\textbf{Sayfa No}}\par} 

% Page ÖNSÖZ--------------
\addcontentsline{toc}{chapter}{ÖNSÖZ} 
\begin{center}
    \vspace*{0cm} % Top: 40mm olmalı
    {\fontsize{12pt}{12pt}\selectfont \textbf{ÖNSÖZ}}\\
\end{center}
\par \lipsum[1-1]
\clearpage
%-------------------------

% Page Etik--------------
\addcontentsline{toc}{chapter}{ETİK} 
\begin{center}
    \vspace*{0cm} % Top: 40mm olmalı
    {\fontsize{12pt}{12pt}\selectfont \textbf{ETİK}}\\
\end{center}
\par \lipsum[1-1]
\clearpage
%-------------------------

% Page TOC İçindekiler ---
\renewcommand*\contentsname{İÇİNDEKİLER}
\addcontentsline{toc}{chapter}{İÇİNDEKİLER} %içindekiler tablosunu içindekilerde gösterir.
\setcounter{secnumdepth}{3} %Kaç alt başlığın numarasını verecek belirler
\setcounter{tocdepth}{3}

\renewcommand*\cftdotsep{.072}% <------- THIS LINE CHANGED

\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % dots for chapters
\renewcommand{\cfttoctitlefont}{\MakeUppercase\hfil\bfseries\fontsize{12pt}{12pt}\selectfont}
    \vspace*{-1.8cm} 
\renewcommand\cftchapfont{\mdseries}
\renewcommand\cftchappagefont{\mdseries}
%\renewcommand{\cftchappresnum}{CHAPTER\space}
\renewcommand{\cftchapaftersnum}{.} 
\renewcommand{\cftsecaftersnum}{.} 
\renewcommand{\cftsubsecaftersnum}{.} 
\renewcommand{\cftsubsubsecaftersnum}{.} 

%\setlength{\cftbeforetoctitleskip}{10mm} 
\setlength{\cftaftertoctitleskip}{1\baselineskip}
\setlength{\cftchapnumwidth}{4em}
\setlength{\cftsecnumwidth}{4em}
\setlength{\cftsubsecnumwidth}{4em}

\setlength{\cftchapindent}{0em}
\setlength{\cftsecindent}{0em}
\setlength{\cftsubsecindent}{0em}
\setlength{\cftsubsubsecindent}{0em}

% Spacing between items
\setlength{\cftbeforechapskip}{7pt}
\setlength{\cftbeforesecskip}{\cftbeforechapskip}
\setlength{\cftbeforesubsecskip}{\cftbeforechapskip}
\setlength{\cftbeforesubsubsecskip}{\cftbeforechapskip}

\begin{singlespace}
\tableofcontents
\end{singlespace}
\clearpage
%-------------------------

% Page Figures Şekiller ---
\renewcommand*\listfigurename{ŞEKİLLER DİZİNİ}
\addtocontents{lof}{\par\nobreak\textbf{{\scshape } \hfill} \underline{\textbf{Sayfa No}}\par\nobreak} %{\scshape Şekil} kısmı eklenebilir.
\renewcommand{\cftloftitlefont}{\MakeUppercase\hfil\bfseries\fontsize{12pt}{12pt}\selectfont}
\renewcommand{\cftfigaftersnum}{.}
\renewcommand*\cftfigpresnum{Şekil~}
\settowidth{\cftfignumwidth}{\cftfigpresnum}
\renewcommand{\cftfigaftersnumb}{\quad~~}
\setlength{\cftbeforeloftitleskip}{10mm}
\setlength{\cftafterloftitleskip}{1\baselineskip}
\setlength{\cftbeforefigskip}{\cftbeforechapskip}

\begin{singlespace}
\listoffigures
\end{singlespace}
\clearpage
%-------------------------

% Page Tables Tablolar ---
\renewcommand*\listtablename{TABLOLAR DİZİNİ}
\addtocontents{lot}{\par\nobreak\textbf{{\scshape } \hfill} \underline{Sayfa No}\par\nobreak}
\renewcommand{\cftlottitlefont}{\MakeUppercase\hfil\bfseries\fontsize{12pt}{12pt}\selectfont}
\renewcommand{\cfttabaftersnum}{.}
\renewcommand*\cfttabpresnum{Tablo~}
\settowidth{\cfttabnumwidth}{\cfttabpresnum}
\renewcommand{\cfttabaftersnumb}{\quad~~}
\setlength{\cftbeforelottitleskip}{10mm}
\setlength{\cftafterlottitleskip}{1\baselineskip}
\setlength{\cftbeforetabskip}{\cftbeforechapskip}

\begin{singlespace}
\listoftables
\end{singlespace}
\clearpage
%-------------------------

\pagenumbering{arabic}


\chapter{CHAPTER}
\section{Section}
\lipsum[1]
\begin{figure}[h!]
  \centering
  %\includegraphics[height=6cm]{http://www.knittedhome.com/communities/5/004/012/872/235/images/4628207884.jpg}
  \caption{Sample Image}
  \label{fig:Sample}
\end{figure}
\subsection{Subsection}
\lipsum[2-3]
\begin{table}[]
\centering
\begin{tabular}{lllll}
DF & DF &    & S  & S  \\
   & S  & DF &    &    \\
   & S  &    & DF &    \\
   & SD &    &    & DF
\end{tabular}
\caption{Deneme Tablosu Bir}
\label{my-label}
\end{table}
\subsubsection{Subsubsection}
\lipsum[3-5]
%.........................

\end{document}

在此处输入图片描述


基于 KOMA 脚本的课程

这个答案适用于 KOMA 脚本类,不适tocloft用于未来的访问者(不是 OP,对此感到抱歉)。

\documentclass[]{scrreprt}

\usepackage[toc]{duckuments}% dummy content including ToC

\makeatletter
\DeclareTOCStyleEntry
  [linefill=\def\@dotsep{.072}\TOCLineLeaderFill]
  {tocline}{section}
\DeclareTOCStyleEntry
  [linefill=\def\@dotsep{.072}\TOCLineLeaderFill]
  {tocline}{subsection}
\makeatother

\begin{document}
\duckument
\end{document}

在此处输入图片描述

正如@esdd在评论中提到的那样,上述答案还会影响 LoF 和 LoT 的条目,以及可能由其控制的所有其他使用或tocbasic样式的列表(至少默认情况下表格或图形不是这种情况)。要仅为整个目录设置(但对于目录中使用它的所有条目类型),您可以使用sectionsubsectionscrreprt\@dotsep

\makeatletter
\BeforeStartingTOC[toc]{\def\@dotsep{.072}}
\makeatother

相关内容