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.
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.
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.
This is a simple solution:
\usepackage[figurename=Fig.]{caption}
Works with and without babel. Use tablename for tables.
\usepackage{babel} or babel will redefine the names back to its default settings.
– Václav Pavlík
May 28 '18 at 08:10
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
caption).
– Roman Luštrik
Nov 09 '18 at 16:11
figureenvironment. – lockstep May 05 '11 at 16:51\caption{My caption}with\par\smallskip My caption. – lockstep May 05 '11 at 16:55\renewcommand{\thefigure}{}– Marco Daniel May 05 '11 at 17:10\caption*{}– Marco Daniel May 05 '11 at 17:11figurename=key for thecaptionpackage (as in\usepackage[figurename=Fig.]{caption}) you can change the figure name and this will work whetherbabelis used or not. – Gonzalo Medina May 05 '11 at 18:17\captionsspanish:) – MattAllegro Mar 28 '20 at 00:08\algorithmnamefor algorithms? – upupming May 28 '20 at 14:14