10

This question seems to be asked a lot. I tried some different solutions and any of them did not work.

My figure caption is displayed as

Figure 1: Caption Here

But I want to display:

Fig. 1: Caption Here

I tried the instructions from several questions in the stackExchange website.

Currently my code looks like

\documentclass[12pt, a4paper]{article}

\pagestyle{headings}

\usepackage{tikz}
%\addto\captionsenglish{\renewcommand{\figurename}{Fig.}}

\usepackage[font=small,labelfont=bf, figurename=Fig.]{caption} 
\renewcommand{\figurename}{Fig.}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{latexsym}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{verbatim}
\usepackage{stmaryrd}

\begin{document}
\begin{figure}
Drawing here
\caption{Caption here} \label{fig:label}
\end{figure}

\end{document}

If I uncomment the line \addto... the code does not compile.

I found these references in the following questions:

Change caption name of figures

Figure to Fig in both Caption and Autoref

How to change figure caption to Fig. 1. in stead of Fig. 1:

none of them worked.

I also tried the solution the solution in this other link: http://www.latex-community.org/forum/viewtopic.php?f=45&t=3639 but no success.

I imagine that some of my packages might be in conflict with the caption one. But which one?

Any advice?

3
  • This is the classical case where really reducing the code to a minimal working example (MWE) should help. Just remove packages (there are some that are not needed for your example) until it works. Nov 12 '14 at 8:16
  • @zeh: you simply have to put the line \addto\captionsenglish{\renewcommand{\figurename}{Fig.}} after \usepackage[english]{babel}.
    – Bernard
    Nov 12 '14 at 10:13
  • This isn't a duplicate of the linked post.
    – Clément
    Apr 28 '21 at 6:23
16

Forget about caption:

\documentclass{article}

\makeatletter
\renewcommand{\fnum@figure}{Fig. \thefigure}
\makeatother

\begin{document}

\begin{figure}

Drawing here
\caption{Caption here}

\end{figure}

\end{document}

Here I just modified LaTeX command that shows in your captions. Now it displays as you want.

4
  • 2
    Sweet, work just great. I added \usepackage[font=small,labelfont=bf,labelsep=space]{caption} to have it in bold. However, what \makealetter and \makeatother do?
    – zeh
    Nov 12 '14 at 8:21
  • 1
    they switch on and off allowance for @ in command sequences. Without those you cannot write commands with @ inside. They are used only in cases like this one, where you want to modify something already written in class or package or LaTeX.
    – RicoRally
    Nov 12 '14 at 8:34
  • The question about what \makeatletter and \makeatother do is almost 7 years old, but there is a great answer to that question here Jun 29 '21 at 0:31
  • I think a nice improvement to this answer would explain what \fnum@figure is (where it is normally defined, how it is used, etc.) Jun 29 '21 at 0:33

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.