TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}
share|improve this question
up vote 135 down vote accepted

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

Without babel

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 (or polyglossia)

The same principles as above 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 babel (or polyglossia)):

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

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.

share|improve this answer
1  
Great answer! I refined the wording in one spot a bit, hope that's ok (and correct). Is the comma after references = {Works Cited} necessary/good practice? Also, I think it might be helpful to sort the name macros into categories, depending or where they're coming from or what they're about (parts of the document, letter, bibliography, ...). – doncherry Nov 16 '12 at 21:20
3  
@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? – barbara beeton Nov 17 '12 at 16:23
    
@barbarabeeton I'll try to distinguish between "standard" name macros and those provided by packages/alternative classes. The list for the latter won't be comprehensive, though. – lockstep Nov 17 '12 at 16:26
2  
NB. If you use \usepackage[english, american]{babel} then you'll need \addto\captionsamerican{...}. – Joe Corneli Jun 1 '13 at 22:37
    
Good answer,lockstep, I looked for information about changing the title of the final chapter notes and have found it here. Thanks. – José Monllor Jul 21 '13 at 9:14

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)
share|improve this answer
    
Could this be extended on how to modify the font-size/weight in KOMA? – Its me Julian Apr 13 at 14:03
    
@ItsmeJulian The original question does not mention fonts in KOMA. I suggest you ask a new question please. Best would be to add an mwe and explain exactly, what your problem is. – Kurt Apr 13 at 14:12

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

share|improve this answer

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}}
share|improve this answer
1  
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 Jul 22 '15 at 15:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
http://tex.stackexchange.com/questions/82993/how-to-change-the-name-of-document-elements-like-figure-contents-bibliogr/82994
tex.stackexchange.com
crawl=CC-MAIN-2016-26
107079
application/http; msgtype=response
sha1:EMX37WSFRB4KPS5S2TL232VMWIJVLV22
<urn:uuid:22bd562e-c1b9-4b8b-bf8a-c8a59fc15fef>
2016-06-26T13:42:43Z
151.101.193.69
sha1:OFKJX5LRTO3WEOKWFISIRC6HF5UA7BPS
<urn:uuid:888dbd19-b6f7-4d6c-a5a4-09e706243bb5>
http://tex.stackexchange.com/questions/82993/how-to-change-the-name-of-document-elements-like-figure-contents-bibliogr/82994
response
<urn:uuid:bba5ab16-e0b4-4957-9494-e6cf295af5d4>
robots: classic
hostname: ip-10-164-35-72.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2016-26
operator: CommonCrawl Admin
description: Wide crawl of the web for June 2016
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf