自定义图表列表时的间距和标点问题

自定义图表列表时的间距和标点问题

我需要修改图表列表的外观,以便索引元素以以下形式出现: 图二十:图表标题......页面(与表格相同)。

我正在使用KOMA Script,因此使用tocbasic。但是,我在标签和冒号之间发现了一个丑陋的虚假空格,我不知道如何删除它才能使其看起来正确。

当前人物名单的丑陋。

这是我的 MWE 尝试,我知道它无法构建因为我正在使用该mwe包并且我不明白为什么图像无法加载,该draft模式可能会有一点帮助,但这不是一个解决方案。

\documentclass{scrbook}
\KOMAoptions{%
  fontsize=12pt,% 
  captions=tableheading,% 
  headings=standardclasses,%
  chapterprefix=false,%
  headings=small,% 
  headings=openany,%
  headings=onelinechapter,%
  headsepline=off,% 
  headinclude=off,
  footinclude=off,% 
  titlepage=off,% 
  twoside=off,% 
  parskip=false,% 
  bibliography=totoc,% 
  draft=on% 
}
\usepackage{geometry}
 \geometry{%
   a4paper,%
   left=1.5in,%
   right=1in,%
   top=1in,%
   bottom=1in,%
   head=21.75pt,%
   width=5.768in,%
   height=9.693in,%
 }

 \usepackage{tocbasic} 
\renewcommand{\contentsname}{Table of Contents}
  \DeclareTOCStyleEntry[
    linefill=\hfill,
    pagenumberbox=\mbox{},
    % indent=0pt,
    % numwidth=2.3em,
    entrynumberformat=\entrynumberwithprefix{\chaptername},
    dynnumwidth
  ]{tocline}{chapter}

  \DeclareTOCStyleEntry[
    indent=0pt,
    numwidth=2.3em,
    entrynumberformat=\entrynumberwithprefix{\figurename},
    dynnumwidth
  ]{tocline}{figure}

  \DeclareTOCStyleEntry[
    indent=0pt,
    numwidth=2.3em,
    entrynumberformat=\entrynumberwithprefix{\tablename},
    dynnumwidth
  ]{tocline}{table}

  \newcommand{\entrynumberwithprefix}[2]{\textbf{#1~#2:\enskip}}

\setcounter{secnumdepth}{4} % Numeration depth
\setcounter{tocdepth}{4} % TOC numeration depth

\usepackage{mwe}

\begin{document}

\listoffigures

\clearpage

\chapter{Images}

\blindtext

\begin{figure}
  \includegraphics[width=.48\linewidth]{example−image.pdf}\hfill
  \includegraphics[width=.48\linewidth]{example−image.pdf}
  \caption{Example to illustrate the problems with lof.}
\end{figure}

\begin{figure}
  \includegraphics[width=.33\linewidth]{example−image−a.pdf}\hfill
  \includegraphics[width=.33\linewidth]{example−image−b.pdf}\hfill
  \includegraphics[width=.33\linewidth]{example−image−c.pdf}
  \caption{Yet another example to illustrate the problems with lof.}
\end{figure}

\Blindtext

\begin{figure}
    \includegraphics[width=\linewidth]{example-image-16x10.pdf}
    \caption{One more example to illustrate the problems with lof.}
\end{figure}

\begin{figure}
    \includegraphics[width=\linewidth]{example-image-16x9.pdf}
    \caption{A final example to illustrate the problems with lof.}
\end{figure}

\end{document}

答案1

numsep在我看来,这是与一起使用的最小距离( ) dynnumwidth。我会以不同的方式做整件事:

\documentclass[
  fontsize=12pt,% 
  captions=tableheading,% 
  headings=standardclasses,%
  chapterprefix=false,%
  headings=small,% 
  headings=openany,%
  headings=onelinechapter,%
  headsepline=off,% default and therefore not needed
  headinclude=off,% default and therefore not needed
  footinclude=off,%  default and therefore not needed
  titlepage=off,% ??? book with in-page title???
  twoside=off,% 
  parskip=false,% default and therefore not needed
  bibliography=totoc,%
  listof=entryprefix,% added
  listof=flat,% added
  ]{scrbook}
\KOMAoptions{draft=on}% alternatively use option overfullrule when loading scrbook
\usepackage{geometry}
 \geometry{%
   a4paper,%
   left=1.5in,%
   right=1in,%
   top=1in,%
   bottom=1in,%
   head=21.75pt,%
   width=5.768in,%
   height=9.693in,%
 }

\renewcommand{\contentsname}{Table of Contents}

\DeclareTOCStyleEntry[
  linefill=\hfill,
  pagenumberbox=\mbox{},
  % indent=0pt,
  % numwidth=2.3em,
  entrynumberformat=\entrynumberwithprefix{\chaptername},
  dynnumwidth
]{tocline}{chapter}

\BeforeStartingTOC{\def\autodot{:}}
\DeclareTOCStyleEntries[entrynumberformat=\textbf]{default}{figure,table}
\newcommand{\entrynumberwithprefix}[2]{#1~#2}

\setcounter{secnumdepth}{4} % Numeration depth
\setcounter{tocdepth}{4} % TOC numeration depth

\usepackage{mwe}
\usepackage{graphicx}

\begin{document}

\tableofcontents
\listoffigures

\clearpage

\chapter{Images}

\blindtext

\begin{figure}
  \includegraphics[width=.48\linewidth]{example-image}\hfill
  \includegraphics[width=.48\linewidth]{example-image}
  \caption{Example to illustrate the problems with lof.}
\end{figure}

\begin{figure}
  \includegraphics[width=.33\linewidth]{example-image-a}\hfill
  \includegraphics[width=.33\linewidth]{example-image-b}\hfill
  \includegraphics[width=.33\linewidth]{example-image-c}
  \caption{Yet another example to illustrate the problems with lof.}
\end{figure}

\Blindtext

\begin{figure}
    \includegraphics[width=\linewidth]{example-image-16x10}
    \caption{One more example to illustrate the problems with lof.}
\end{figure}

\begin{figure}
    \includegraphics[width=\linewidth]{example-image-16x9}
    \caption{A final example to illustrate the problems with lof.}
\end{figure}

\end{document}

带有“图 XX:”的胖图列表

顺便说一句:问题在于而example−image.pdf不是。-

顺便说一句:使用

  headings=standardclasses,%
  chapterprefix=false,%
  headings=small,% 
  headings=onelinechapter,%

在我看来,这在某种程度上是从后面穿过胸部进入膝盖。首先,选项chapterprefix=falseheadings=onelinechapter是相同的,并且以headings=small某种方式与相反的选项结合在一起headings=standardclasses。也许你只是想要\setkomafont{sectioning}{\bfseries}或选项sfdefault=false(并且仍然是headings=small)。

相关内容