1

I want to redefine the \figureformat to customize the output of figure captions:

\renewcommand*{\figureformat}{\thefigure.\figurename}

However, it gives an error when I compile:

\figureformat undefined. \renewcommand*{\figureformat}

Here is the test tex:

\documentclass[10pt,letterpaper]{article}

\renewcommand*{\figureformat}{\thefigure. \figurename}

\begin{document}

\begin{figure}[h]
\caption{{test}
\label{fig1}
\end{figure}

\end{document}

I am using TeX Live 2013/W32TeX and TexStudio

4
  • Out of curiosity, where did you find this command?
    – Johannes_B
    Feb 17, 2015 at 15:02
  • @Johannes_B Here: tex.stackexchange.com/questions/27250/… Feb 17, 2015 at 15:09
  • There is your answer, figureformat is only defined with KOMA-classes. With the standard classes, you can use package caption to do it with a nice interface.
    – Johannes_B
    Feb 17, 2015 at 15:13
  • @Johannes_B The problem is I want to change the format only for figures. I want the format of tables to remain unchanged. If I use caption interface, I will change both. Feb 17, 2015 at 15:22

1 Answer 1

3

The command you cannot redefine is only provided by KOMA-classes. For the standard classes, package captioncomes in handy. You can define the labelformat for just figures, if you want to. Tables will stay the same.

leoCaptionFormat

\documentclass[10pt,letterpaper]{article}

\usepackage{caption}
\DeclareCaptionLabelFormat{figure}{\thefigure.\nobreakspace\figurename}
\captionsetup[figure]{labelformat=figure}
\begin{document}

\begin{figure}[h]
    \caption{figure caption}
    \label{fig1}
\end{figure}
\begin{table}[h]
    \caption{table caption}
\end{table}

\end{document}
1

You must log in to answer this question.

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