目次のセクションエントリをドットで埋める (scrartcl を使用)

目次のセクションエントリをドットで埋める (scrartcl を使用)

私は使用しておりscrartcl、…したいと思っています。

  1. 目次に図表リストと表リストが記載されている
  2. 目次のセクションとページ番号の間のスペースをドットで埋める
  3. 目次の残りの部分は変更しないでください。

tocstyleしたがって、これは(以下のコードを使用して)生成された目的の出力です。

\documentclass[listof=totoc]{scrartcl}

% Problem: alpha version and warning.
\usepackage{tocstyle}
\newtocstyle[KOMAlike][leaders]{alldotted}{}
\usetocstyle{alldotted}

\begin{document}
\tableofcontents
\vfill\hrule
\listoffigures
\listoftables

\section{Test section}
\subsection{Test subsection}
\end{document}

質問: を使用せずに同じ出力を得るにはどうすればよいですか?パッケージはアルファ バージョンであり、将来変更される可能性があるという警告が常に生成されるため、tocstyleは避けたいと思います。tocstyle

追加のパッケージを避け、LOF と LOT を TOC に手動で追加するなど、可能な限り最小限のソリューションを希望します。

代わりに使用しようとしましたtocloftが、他のものが壊れます: <code>tocloft</code> の結果

\documentclass[listof=totoc]{scrartcl}

% Problem: LOF and LOT not in TOC; different font style for sections.
\usepackage{tocloft}
\renewcommand{\cftsecdotsep}{\cftdotsep}
\renewcommand{\cftsecleader}{\cftdotfill{\cftsecdotsep}}

\begin{document}
\tableofcontents
\vfill\hrule
\listoffigures
\listoftables

\section{Test section}
\subsection{Test subsection}
\end{document}

答え1

オプションを使用しますtoc=sectionentrywithdots。マニュアルにはベータ機能であると記載されていますが、警告は生成されません。

\documentclass[listof=totoc,toc=sectionentrywithdots]{scrartcl}  


\begin{document}
\tableofcontents
\vfill\hrule
\listoffigures
\listoftables

\section{Test section}
\subsection{Test subsection}
\end{document}

ここに画像の説明を入力してください

関連情報