201

I'd like to modify the names used to typeset some of my document elements. For example, the caption of figure floats should change from "Figure" to "Fig.", and my \tableofcontents sectioning heading shouldn't read "Contents", but "Table of Contents". How can I do that?

\documentclass{article}
% \usepackage[english]{babel}
\begin{document}
\tableofcontents
\section{foo}
\begin{figure}[h]
\centering
\rule{1cm}{1cm}% placeholder for graphic
\caption{A figure}
\end{figure}
\end{document}

6 Answers 6

254

The answer depends on whether or not you use a language package like babel or polyglossia.

Without babel or polyglossia

Names like "Figure" and "Contents" are stored in macros like \figurename and \contentsname, i.e., to change them, you have to change the definition of the respective macros. Add the following to your preamble:

\renewcommand{\figurename}{Fig.}
\renewcommand{\contentsname}{Table of Contents}

Here's a list of the "name macros" (and their default meaning) defined by the LaTeX standard classes article, book, and report:

  • \abstractname [only article, report]: Abstract
  • \appendixname: Appendix
  • \bibname [only book, report]: Bibliography
  • \chaptername [only book, report]: Chapter
  • \contentsname: Contents
  • \figurename: Figure
  • \indexname: Index
  • \listfigurename: List of Figures
  • \listtablename: List of Tables
  • \partname: Part
  • \refname [only article]: References
  • \tablename: Table

Other classes and packages may define additional "name macros"; here are some you're likely to come up against (plus their source):

  • \acronymname [glossaries]: Acronyms
  • \alsoname [makeidx]: see also
  • \ccname [letter]: cc
  • \enclname [letter]: encl
  • \glossaryname [glossaries]: Glossary
  • \headtoname [letter]: To
  • \lstlistingname [listings]: Listing (the environment)
  • \lstlistlistingname [listings]: Listings (the "List of")
  • \nomname [nomencl]: Nomenclature
  • \notesname [endnotes]: Notes
  • \pagename [letter]: Page
  • \prefacename [babel]: Preface
  • \proofname [amsthm]: Proof
  • \seename [makeidx]: see (misdefined as "see also" in the AMS classes)
  • \seeonlyname [AMS classes]: see

With babel

There is a specific macro to redefine (or define) captions, as shown:

\setlocalecaption{english}{contents}{Table of Contents}
\setlocalecaption{arabic}{abstract}{ملخص}
\setlocalecaption{ancientgreek}{also}{ὃρα ὡσαύτως}

The first argument is the language, the second argument is a shortened name of the caption, so that contents defines \contentsname, and the last is the string. You shouldn’t add any macros to switch the direction or the script, because babel takes care of that. There are other ways to modify the captions, but this is the recommended one.

With polyglossia

The same principles as sec. “Without babel or polyglossia” apply – with one crucial difference: for every language, "name macros" must be redefined in the argument of \addto\captions<language> (instead of a simple \renewcommand). That is, for the English language, you'd have to add the following to your preamble (after loading polyglossia):

\addto\captionsenglish{%
  \renewcommand{\figurename}{Fig.}%
  \renewcommand{\contentsname}{Table of Contents}%
}

Don’t forget to add a % at the end of line after each redefinition.

Changing "Bibliography" and "References" with biblatex

The biblatex package is an exception to the rule: It uses "bibliography strings" for (among other things) the headings of bibliographies, so redefining \bibname or \refname won't work (whether you use babel or not). To rename both "Bibliography" and "References" to "Works Cited" for the English language, add the following to your preamble:

\DefineBibliographyStrings{english}{%
  bibliography = {Works Cited},
  references = {Works Cited},
}

Afterword

"Name macros" should only contain the string to be printed. Don't add formatting instructions like \renewcommand{\contentsname}{\vspace{20pt}{\Huge Table of Contents}} – they may "work" in the document body, but are likely to play havoc with, e.g., headers and bookmarks. To change the formatting of the "Contents" heading, either redefine \tableofcontents as shown in this answer or, if you want your changes to apply to all sectioning headings, have a look at the titlesec package. For captions, the caption package offers a host of customization possibilities.

4
  • 4
    @lockstep -- there are some additional "names" in the ams document classes, as well as one significant conflict. the conflict: \seename was badly misdefined in the original release (to be "see also"), but since it was too late to fix it by the time someone complained, \seeonlyname ( = "see") was added to provide the correct value. is it worth adding this to the list? Commented Nov 17, 2012 at 16:23
  • For some reason, \addto\captionsbritish works for me in changing 'Bibliography' to 'References' even in the presence of the babel package. This contrasts lockstep's answer but I can't really explain why or how it happened.
    – user36546
    Commented Sep 11, 2013 at 17:02
  • 4
    Please note that as of Babel Ver. 3.15, the \addto routine is obsolete for some languages (French, Spanish, and others). The new way is \renewcommand\frenchfigurename{Figure}, where french is your language and figure is to be replaced with the float/element in question. Commented Sep 6, 2018 at 15:38
  • I'm still getting "cuadro" instead of "tabla" in Spanish with cleveref and polyglossia.
    – skan
    Commented Jun 16, 2020 at 18:52
65

In addition to the answer of lockstep:

With KOMA-Script

KOMA-Script (to be correct, package scrbase, which is called in the KOMA-Script classes scrartcl, scrreprt, scrbook and scrlttr2 and in the KOMA-Script package scrextend) defines two macros for naming or renaming LaTeX names:

\newcaptionname{language}{LaTeX name}{new content}   % new name
\renewcaptionname{language}{LaTeX name}{new content} % renew existing name

Here is a example for German language:

\renewcaptionname{ngerman}{\contentsname}{Inhalt}           %Table of contents
\renewcaptionname{ngerman}{\listfigurename}{Abbildungen}    %Figures
\renewcaptionname{ngerman}{\listtablename}{Tabellen}        %Tables
\renewcaptionname{ngerman}{\figurename}{Abb.}               %Figure
\renewcaptionname{ngerman}{\tablename}{Tab.}                %Table
\renewcaptionname{ngerman}{\bibname}{Literatur}             %Bibliography
  \newcaptionname{ngerman}{\lstlistlistingname}{Quelltexte} %Table of listings 
  \newcaptionname{ngerman}{\lstlistingname}{Quelltext}      %Listing

You can see, that \renewcaptionname renames an existing LaTeX name like \contentsname. The macro \newcaptionname defines a new LaTeX name for KOMA-Script like \lstlistingname (because \lstlistingname is not defined in KOMA-Script).

If you use package babel together with KOMA-Script it is better to use the mechanism of KOMA-Script instead of babels because KOMA-Script has a better verification.

Update:

With loading the package scrextend (see chapter 16, file scrguien.pdf, texdoc scrguien) you can use some KOMA-Script features with non KOMA-Script classes. For example scrextend loads scrbase.

The following MWE shows, that it works nice, and that loading of scrextend does not redefine the default font for titles in standard classes: it stays in serif (roman), while in KOMA-Script the default is sans-serif. Compile first with the commented line, then uncomment and compile again. Compare the titles of the table of contents.

\listfiles                  % to check if scrbase is loaded
\documentclass{article}     % original class
\usepackage{scrextend}      % allows some KOMA-Script features
\usepackage[english]{babel} % needed for "blindtext"
\usepackage{blindtext}      % to create dummy text

% \renewcaptionname{english}{\contentsname}{Contents of ``Blindtext''} % renaming in KOMA-Script

\begin{document}
\tableofcontents
\newpage
\blinddocument             % dummy text including several headings for TOC 
\end{document}

Update 2:

If you are not sure whether package scrbase is loaded or not you can test it with the command \listfiles (see first line in the MWE above). Command \listfiles prints in the log file a list with all called packages in your document. So if package scrbase is loaded you find it in this list (including used version), like this:

scrkbase.sty    2012/07/29 v3.11b KOMA-Script package (KOMA-Script-dependent basics and keyval usage)
 scrbase.sty    2012/07/29 v3.11b KOMA-Script package (KOMA-Script-independent basics and keyval usage)
1
  • I've tried to use the \renewcaptionname command, but it does not appear to work. I copied the following line from the koma-script documentation (page 352): \renewcaptionname{USenglish}{\figurename}{fig.} but I get the following error: Package scrbase Error: \figurename' not defined at language USenglish'. Any ideas what is going wrong here?
    – jkokorian
    Commented Mar 2, 2023 at 11:58
10

For documents using minted package by Konrad Rudolph, one can change the name of document elements as follows:

\renewcommand\listingscaption{Code-Snippet}
\renewcommand\listoflistingscaption{List of program codes}

I added this answer as response to the comment of OP in Reference Code snippet in latex using minted

3

Latex defaults References for article classes and Bibliographies for Reports. To change the default, add a title when you place your bibliography:

\printbibliography[heading=bibintoc, title={References}]
2
  • 3
    This is only valid for bibliographies done with biblatex. It does not answer the general question.
    – Johannes_B
    Commented Apr 12, 2018 at 4:58
  • 1
    A (in my eyes at least) conceptually nicer solution for biblatex was already shown in the accepted answer by lockstep tex.stackexchange.com/a/82994/35864
    – moewe
    Commented Apr 12, 2019 at 8:34
2

If you are using the article documentclass this line will rename the name Title from your bib part from Bibliography to References.

\addto\captionsenglish{\renewcommand{\bibname}{References}}
1
  • 2
    Please note, this would only work, if package babel were loaded, and if article would use bibname. It does not, it uses refname which defaults to References.
    – Johannes_B
    Commented Jul 22, 2015 at 15:11
0

2024.1.12 updated

With polyglossia:

\setmainlanguage[variant=us]{english}
\gappto\captionsenglish{
        \def\contentsname{Table of Contents}
        \def\listfigurename{List of Figures}
        \def\listtablename{List of Tables}
        }
% Note that this needs to be done after the respective language has been loaded with \setmainlanguage or \setotherlanguage.
4
  • How to do it with polyglossia was already explained before (in the main answer), and in fact your code is buggy (missing %’s) and relies on a TeX primitive, which is discouraged. (At least, your answer has made me discover that the explanation for babel was outdated.) Commented Jan 14 at 7:46
  • @Javier Bezos. I'm not using babel, babel is still updating. I just updated the latest command of polyglossia because I found that the command of polyglossia above is no longer working.
    – chanzz
    Commented Jan 15 at 4:46
  • Of course babel is updating. Like LaTeX itself, Word, InDesign, Python, Chrome, MacOS, Windows or any other program actively maintained. Even polyglossia gets updates from time to time. That’s usually considered positive, not negative. BTW, I’ve just tested the code above and it works as expected, so I wonder if you are doing something wrong. Commented Jan 15 at 16:15
  • @Javier Bezos. I just tried your code again and it worked this time. But I remember that I didn't succeed at the time, and I don't know why, and then I looked at Page49 of the polyglossia manual to find the answer (which is my answer). So in order to avoid the mistake that I made in the future, I wrote this answer under this question. Just like the purpose of this community, we need to try to avoid going down the wrong path of repetition, just like standing on the shoulders of those who came before you, so that you can go further.
    – chanzz
    Commented Jan 17 at 6:57

You must log in to answer this question.

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