144

How can I modify the caption name of a figure? For example I have

\caption{This is a figure.}

and by default the caption appears as

Figure 1: This is a figure.

However I want

Fig.1 - This is a figure.

3 Answers 3

182

First, you have to redefine \figurename.

Option1: Without using the babel package:

\renewcommand{\figurename}{Fig.}

Option2: With babel (and English as language):

\addto\captionsenglish{\renewcommand{\figurename}{Fig.}}

For other babel languages you need to use the proper \captions<language> command instead of \captionsenglish in the command above.

For changing the separator between label and caption text, I recommend the caption package.

\documentclass{article}

\renewcommand{\figurename}{Fig.}

\usepackage[labelsep=endash]{caption}

\begin{document}

\begin{figure}
\centering
\rule{1cm}{1cm}
\caption{This is a figure}
\end{figure}

\end{document}

EDIT: In case anyone wonders how to change the caption name of tables: Redefine \tablename.

17
  • Ok, but the figure is numbered like Fig. 0.0.1.. how can i remove that numerotation?
    – qwerty
    Commented May 5, 2011 at 16:37
  • 4
    @qwerty: See this question for general hints about changing the numbering of figures and tables.
    – lockstep
    Commented May 5, 2011 at 16:41
  • 3
    remove all numbers: \renewcommand{\thefigure}{} Commented May 5, 2011 at 17:10
  • 2
    or you can use \caption*{} Commented May 5, 2011 at 17:11
  • 12
    Using the figurename= key for the caption package (as in \usepackage[figurename=Fig.]{caption} ) you can change the figure name and this will work whether babel is used or not. Commented May 5, 2011 at 18:17
63

This is a simple solution:

\usepackage[figurename=Fig.]{caption}

Works with and without babel. Use tablename for tables.

4
  • 2
    Note that it has to be placed after \usepackage{babel} or babel will redefine the names back to its default settings. Commented May 28, 2018 at 8:10
  • @VáclavPavlík I believe not if you write the above solution after the import.
    – niko
    Commented Sep 3, 2018 at 8:47
  • but if I subfigures it produces an error: "Package caption error: can be used only in preamble...
    – skan
    Commented Jan 8, 2019 at 17:38
  • Hello! But for rename only one and not all?
    – Luca Longo
    Commented Jan 25, 2023 at 22:11
0

You can go to the file pseudocode.sty (if you are using a pseudocode environment) and changing the word "algorithm" by "algorithme".

The file is installed C:/programfile/...Miktex...pseudocode

5
  • pardon: file "pseudocode.sty" not "pseudocode.sys"
    – Arezki Med
    Commented May 12, 2013 at 20:22
  • 15
    It is bad practice to change the files originally included in your TeX distribution.
    – lockstep
    Commented Aug 10, 2013 at 13:33
  • 3
    You better edit your answer than correcting it in a comment!
    – mafp
    Commented Aug 10, 2013 at 13:35
  • 3
    Despite the fact, that it is bad advice to change distributed files, this is rather a comment than an answer.
    – Johannes_B
    Commented May 28, 2014 at 9:15
  • This is a bad solution. You should use existing functionality or extent it with a package (such as caption). Commented Nov 9, 2018 at 16:11

You must log in to answer this question.

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