2

I am required to modify the appearance of the list of figures and tables so that the indexed elements appear in the form: Figure X.X: Figure caption...... page (and the same with the tables).

I'm working with KOMA Script, and hence with tocbasic. However, I'm getting an ugly spurious space between the label and the colon that I don't know how to remove to make it look right.

The current ugliness of the list of figures.

This is my MWE attempt, I know it doesn't build because I'm using the mwe package and I don't understand why the images don't load, the draft mode may help a bit, but it's not a solution.

\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
  • 1
    Seems to be a sporadic space somewhere, if you use X#2X you can see it comes from that arg.
    – daleif
    Commented Feb 21 at 18:11

1 Answer 1

1

IMHO this is the minimum distance (numsep) used together with dynnumwidth. I would do the whole thing differently:

\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}

List of Figures with fat "Figure X.X:"

BTW: The problem with example−image.pdf was the instead of -.

BTW: Using

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

IMHO is somehow from behind through the chest into the knee. First of all option chapterprefix=false and headings=onelinechapter are the same and together with headings=small somehow the opposite of headings=standardclasses. Maybe you just want \setkomafont{sectioning}{\bfseries} or option sfdefault=false (and still headings=small).

1
  • Thank you very much for your time and comments, they have been a great help to me. It's not that I usually work this dirty, but this project has required me to make a series of strange adjustments to comply with the guidelines required by the university. The university's standards are based on Word's capabilities and a lack of formatting consistency. As for your last comment, I'm curious to know how to improve the class options to maintain the look I'm being asked to do without doing such outlandish things.
    – Aradnix
    Commented Feb 22 at 7:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .