6

This question already has an answer here:

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?

marked as duplicate by Svend Tveskæg, jub0bs, LaRiFaRi, Guido, Werner Nov 12 '14 at 19:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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. – Benedikt Bauer 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
8

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.

  • 1
    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
  • 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

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