我在文档的前言中使用了图表和表格列表,在相应的图表/表格编号前打印“图表”和“表格”。现在我想对齐打印在这些列表中的标题文本,以便第二行/第三行/等等(如果需要)从与第一行相同的位置开始。
这是我的 MWE:
\documentclass[a4paper,11pt,oneside,fleqn]{scrbook}
\usepackage[ngerman,english]{babel} % language listed last is default setting
\usepackage[utf8x]{inputenc}
\usepackage[demo]{graphicx}
\begin{document}
{%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\tablename~\oldnumberline}%
\listoftables%
} % will print the word 'Table' before the table number
\addcontentsline{toc}{chapter}{List of Tables}
{%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\figurename~\oldnumberline}%
\listoffigures%
} % will print the word 'Figure' before the figure number
\addcontentsline{toc}{chapter}{List of Figures}
\begin{figure}
\includegraphics[width=0.5\linewidth]{demo}
\caption{This is a really loooooooooooooooooooooooooong figure caption that will take up two lines.}
\end{figure}
\end{document}
答案1
用于\KOMAoption{listof}{totoc,entryprefix}
获取目录中列表的条目并打印列表中的前缀:
\documentclass[oneside,fleqn]{scrbook}
\KOMAoption{listof}{totoc,entryprefix}
\usepackage[ngerman,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[demo]{graphicx}
\begin{document}
\tableofcontents
\listoftables
\listoffigures
\begin{figure}
\includegraphics[width=0.5\linewidth]{demo}
\caption{This is a really loooooooooooooooooooooooooong figure caption
that will take up two lines.}
\end{figure}
\end{document}