我正在写论文,图片列表和表格列表有些问题。我希望它们看起来像我的目录(我从这里得到:如何使用 tocbasic 缩进没有数字的目录条目(作为索引)?)我曾经使用过 tocstyle,但它不再起作用了。
目前代码:
\documentclass[twoside,11pt,bibliography=totoc]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\newcommand\tocpageseparator{\hspace{1em}\,}
\newcommand\tocpagenumberbox[1]{\mbox{#1}}
\RedeclareSectionCommands[
tocraggedpagenumber,
toclinefill=\tocpageseparator,
tocnumwidth=3em,
tocpagenumberbox=\tocpagenumberbox
]{chapter,section,subsection,subsubsection,paragraph}
\begin{document}
\tableofcontents
\listoffigures
\chapter{Chapter one}
\section{Section one}
\begin{figure}
A Figure
\caption{Figure one - A Figure}
\end{figure}
\end{document}
希望您能帮助我解决我的问题。如果相关的话,我正在使用 KOMA-Script。
答案1
您可以使用\DeclareTOCStyleEntries[...]{tocline}{figure,table}
与 for 相同的选项chapter,section,...
,但不使用前缀toc
:
\DeclareTOCStyleEntries[
raggedpagenumber,
linefill=\tocpageseparator,
numwidth=3em,
pagenumberbox=\tocpagenumberbox
]{tocline}{figure,table}
请注意,您也可以使用此命令进行chapter,section,...
输入:
\DeclareTOCStyleEntries[
raggedpagenumber,
linefill=\tocpageseparator,
numwidth=3em,
pagenumberbox=\tocpagenumberbox
]{tocline}{chapter,section,subsection,subsubsection,paragraph,figure,table}
例子:
\documentclass[twoside,11pt,bibliography=totoc]{scrreprt}
\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}% needed with outdated TeX distributions
\usepackage[ngerman]{babel}
\newcommand\tocpageseparator{\hspace{1em}\,}
\newcommand\tocpagenumberbox[1]{\mbox{#1}}
\DeclareTOCStyleEntries[
raggedpagenumber,
linefill=\tocpageseparator,
numwidth=3em,
pagenumberbox=\tocpagenumberbox
]{tocline}{chapter,section,subsection,subsubsection,paragraph,figure,table}
\begin{document}
\tableofcontents
\listoffigures
\chapter{Chapter one}
\section{Section one}
\begin{figure}
A Figure
\caption{Figure one - A Figure}
\end{figure}
\end{document}