27

I need to have tables with their numbers, just as when I use \caption.

My problem is that when I use the \caption it shows me like this:

Cuadro x.x: this is some table.

The word Cuadro is because I'm using a document class as spanish. I want to change that word "Cuadro". Is it possible to do that?

  • Do you have \usepackage[spanish]{babel} in your document? – egreg Nov 5 '12 at 0:05
37

Since you are using babel with the spanish option, the default behaviour is to use "Cuadro" as \tablename (following a recommendation from the RAE); however, it is also usual, and many people prefer this regardless of what the RAE says) to use "Tabla" instead. You can use the es-tabla option for babel to change the name to "Tabla":

\usepackage[spanish,es-tabla]{babel}

Another option to get "Tabla" is to use the mexico package option

\usepackage[spanish,mexico]{babel}

but this option also changes the behaviour of the quotation marks and of the decimal separator (for details, texdoc spanish on a terminal).

If you want to change the name to some other string, you can redefine \spanishtablename:

\usepackage[spanish]{babel}
\renewcommand\spanishtablename{Otro nombre}
  • 2
    Better is \renewcommand\spanishtablename{Otro nombre} (no \addto trickery). – Javier Bezos Nov 5 '12 at 17:47
  • @JavierBezos ah, yes, I forgot about \spanishtablename; I updated my answer. Thank you! – Gonzalo Medina Nov 5 '12 at 17:49
  • It helped me, but in my case i nedeed it for portuguese so i used \usepackage[portuguese,brazil]{babel} – Nëi Mar 23 '18 at 1:11
23

You can use the caption package like in the following

\documentclass[12pt, letterpaper]{article}
\usepackage{caption}
\captionsetup[table]{name=New Table Name}

\begin{document}

\begin{table}\centering
\begin{tabular}{|c|c|}
test & test\\
\end{tabular}
\caption{test caption}
\end{table}

\end{document}

enter image description here

  • 1
    As you have it now, the change will only affect the single table environment to which it is applied; to have the effect global, one can say \captionsetup[table]{name=Cuadro} in the preamble. Besides, "Cuadro" is the current name and the OP wants to change it. – Gonzalo Medina Nov 5 '12 at 0:25
  • @GonzaloMedina Edited my answer! – azetina Nov 5 '12 at 0:37
  • I would be very happy if somebody might tell me how I could get rid of the 1 in New Table Name 1 as I do not understand where this default option comes from. Thank you! – Julia Oct 5 '18 at 22:40
2

With KOMA-Script

If you use package babel together with 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) it is better to use the mechanism of KOMA-Script instead of babels because KOMA-Script has a better verification.

KOMA-Script 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

For your case it is enough to add:

\renewcaptionname{spanish}{\listtablename}{Índice de tablas}
\renewcaptionname{spanish}{\tablename}{Tabla}

Please note that 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.

1

This is a simple solution:

\usepackage[tablename=Cuadro]{caption}

Works with and without babel. Use figurename for figures.

0

With Polyglossia

According to the Polyglossia package manual (see Modifying or extending captions and date formats),

To redefine internal macros, you can use the command \gappto from the package etoolbox. For compatibility with babel the command \addto is also available with the same effect. For instance, to change the \chaptername for language lingua, you can do this:

\gappto\captionslingua{\renewcommand{\chaptername}{Caput}}

So for the tables in Spanish you would need

\gappto\captionsspanish{\renewcommand{\tablename}{Tabla}}
\gappto\captionsspanish{\renewcommand{\listtablename}{Índice de tablas}}

Bad part is that you need to include the etoolbox package in your preamble. So you would use

\usepackage[]{polyglossia}
\setdefaultlanguage[]{spanish}
\usepackage{etoolbox}
\gappto\captionsspanish{\renewcommand{\tablename}{Tabla}}
\gappto\captionsspanish{\renewcommand{\listtablename}{Índice de tablas}}

%...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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