5

I am pretty new to the wonderful world of LaTeX and I need your help.

I want to add the prefix "Abb." to each entry of the list of figures, and the prefix "Tab." to each entry of the list of tables. In addition I want to add a ": " after each number in the lists. I tried the following with KOMA-script but it will not work. It displays just the number and the caption of the figure.

Please check my sample:

\documentclass[11pt,a4,bibliography=totoc,liststotoc]{scrartcl}
\usepackage[german]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{tocstyle}
\usepackage{tocloft}

\newtocstyle[KOMAlike][leaders]{KOMAlikewithdot}{}
\usetocstyle{KOMAlikewithdot}
\settocfeature[lof]{entryhook}{\noindent Abb.\nobreakspace}% 
\settocfeature[lot]{entryhook}{\noindent Tab.\nobreakspace}% 


\renewcommand{\cftfigpresnum}{Abb. }
\renewcommand{\cfttabpresnum}{Tab. }

\renewcommand{\cftfigaftersnum}{:}
\renewcommand{\cfttabaftersnum}{:}


\begin{document}
\renewcommand{\figurename}{Abb.}
\renewcommand{\tablename}{Tab.}

\listoffigures
\pagebreak

\begin{figure}
    \centering
    \includegraphics[width=0.7\linewidth]{Bilder/GMH_Fertigungsprozess_mit_Logo}
    \caption{Fertigungsprozess der GMH}
    \label{fig:GMH_Fertigungsprozess_mit_Logo}
\end{figure}

\end{document}

Kind regards and thanks in advance

3

1 Answer 1

8

Do not use two different packages to change the TOC or the lists. With a KOMA-Script class I would prefer package tocstyle because it is part of the KOMA-Script bundle. But it seems to me that there is no additional package needed.

You can use option

listof=totoc,

to get TOC entries for the lists,

listof=entryprefix,

to get prefixes for the list entries,

toc=sectionentrywithdots,

to get dots between the section entries in TOC and their page numbers.

To rename \figurename and \tablename use

\renewcaptionname{german}{\figurename}{Abb.}
\renewcaptionname{german}{\tablename}{Tab.}

and for the : after the figure or the table number in the lists

\BeforeStartingTOC[lof]{\def\autodot{:}}
\BeforeStartingTOC[lot]{\def\autodot{:}}

enter image description here

Code:

\documentclass[
    bibliography=totoc,
    listof=totoc,
    listof=entryprefix,
    toc=sectionentrywithdots
]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

\usepackage[german]{babel}
\renewcaptionname{german}{\figurename}{Abb.}
\renewcaptionname{german}{\tablename}{Tab.}

\BeforeStartingTOC[lof]{\def\autodot{:}}
\BeforeStartingTOC[lot]{\def\autodot{:}}

\begin{document}

\tableofcontents
\listoffigures
\clearpage
\section{Test}
\begin{figure}
    \centering
    \includegraphics[width=0.7\linewidth]{example-image}
    \caption{Fertigungsprozess der GMH}
    \label{fig:GMH_Fertigungsprozess_mit_Logo}
\end{figure}

\end{document}

BTW do you really want to use german instead of ngerman?

3
  • Thank your vey much! This works well! I will search for ne ngerman package and will look up the difference. Thank you for tips. I really appreciate it. Commented Mar 9, 2016 at 8:58
  • This method appears not to be working as of 2023. I sincerely recommend Arthur Schiwon's article on this topic: arthur-schiwon.de/…
    – user290966
    Commented Mar 30, 2023 at 15:15
  • 1
    @nerdyllama The MWE in my answer still works. Note, that the KOMA-Script class scrartcl loads and uses package tocbasic. Therefore it is not recommended to load package tocloft with a KOMA-Script class. If you want to load tocloft use a standard class.
    – esdd
    Commented May 13, 2023 at 14:33

You must log in to answer this question.

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