13

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?

zeh
  • 395
  • 1
  • 2
  • 10

1 Answers1

22

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.

RicoRally
  • 1,252
  • 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 08: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 08:34
  • The question about what \makeatletter and \makeatother do is almost 7 years old, but there is a great answer to that question here – Randy Cragun Jun 29 '21 at 00: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.) – Randy Cragun Jun 29 '21 at 00:33