4

Hello I want to add a prefix to list of figures. Is there any way how to do it ? I am using \documentclass[12pt]{article} and \usepackage[czech]{babel}.

Result which I need.

I have found this solution which helped but not as I wanted to. It showed full name Obrázek instead of Obr. (Figure x Fig.)

{%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\figurename~\oldnumberline}%
\listoffigures%
}
  • Welcome to TeX.SX! It would be great if you could show us what you have tried. Posting a minimal working example that indicates what you are trying to do makes it easier for people to understand what you want. It also makes it easier for people to help you, since they have some code to start from, and hence much more likely that some one will try to help you. – Andrew Jan 26 at 21:50
  • I've tried this : – user205597 Jan 26 at 21:56
  • Please use edit to add your code to the original post. – Teepeemm Jan 26 at 22:10
  • \figurename expands to Obr\'azek (using Babel one presumes), so just replace it with Obr. – John Kormylo Jan 27 at 14:53
4

You can do this also using the tocloft package. If you're independently using titlesec for something, then Vincent's answer is probably to be preferred. Adjust the spacing for the label and number as needed.

\documentclass{article}
\usepackage[czech]{babel}
\usepackage{tocloft}
\renewcommand{\cftfigpresnum}{Obr.~}
\setlength{\cftfignumwidth}{5em}
\begin{document}
\listoffigures
\begin{figure}
A figure
\caption{A caption}
\end{figure}
\begin{figure}
A figure
\caption{A caption}
\end{figure}
\begin{figure}
A figure
\caption{A caption}
\end{figure}
\end{document}

output of code

3

It can be done with the \titlecontents command from the titletoc package (see the documentation for more details). For example, with

\documentclass{article}
\usepackage[czech]{babel}
\usepackage{titletoc}
\titlecontents{figure}[0mm]%
    {\makebox{Obr.~}}%
    {\makebox{\thecontentslabel\quad}}%
    {}%
    {\enspace\dotfill\enspace\thecontentspage}
\begin{document}
\listoffigures
\begin{figure}
\caption{A first figure}
\end{figure}
\begin{figure}
\caption{A second figure}
\end{figure}
\begin{figure}
\caption{Again another figure}
\end{figure}
\end{document}

we get the following list of figures.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.