7

I´m starting using cleveref package. I like it.

But now I´m typing in spanish and when \cref is pointing to a table I want that use the word "tabla" instead "cuadro", in the text.

When I type "is \cref{tab:a1}" I want obtain "is tabla 2" and NOT "is cuadro 2"

I tried with this lines

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

but this only changes the word below the table, as you can see.

Here is a MWE:

\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{mathtools,amsmath,amssymb}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish]{cleveref}
\usepackage[spanish]{babel}


\begin{document}
\renewcommand{\listtablename}{Índice de tablas}
\renewcommand{\tablename}{Tabla} 

La \cref{tab:1a} es bonita(beautifull)\\

\begin{table}[h!]
\centering
\begin{tabular}[h!]{ccc}
\ $a$ & $b$ & $c$ \\
\hline 0 & 0 & 0 \\
\ 1 & 1 & label label-tab:1a \\
\end{tabular}
\caption{A subtable}\label{tab:1a}
\end{table}


\end{document} 
6

First of all I think it's worth to read answer to question "¿Por qué spanish para babel dice cuadro en lugar de tabla?" (Why spanish babel says "cuadro" instead of "tabla"?) in FAQ-CervanTeX (FAQ from spanish users group).

And in case you still insist in changing this word, adding es-tabla option to babel will do it. With cleveref some more customization is needed as lockstep suggested but I think something like

\crefname{table}{\spanishtablename}{\spanishtablename}

could be better than a hardcoded solution.

Last comment if spanish is passed as option to documentclass, it will be automatically passed to babel and cleveref.

\documentclass[spanish]{article}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{mathtools,amsmath,amssymb}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[es-tabla]{babel}
\usepackage{cleveref}

\crefname{table}{\spanishtablename}{\spanishtablename}

\begin{document}

La \cref{tab:1a} es bonita (\emph{beautifull})\\

\begin{table}[h!]
\centering
\begin{tabular}[h!]{ccc}
\ $a$ & $b$ & $c$ \\
\hline 0 & 0 & 0 \\
\ 1 & 1 & label label-tab:1a \\
\end{tabular}
\caption{A subtable}\label{tab:1a}
\end{table}

\end{document}
  • What if we are using polyglossia instead? – skan Jul 22 at 18:57
4

Add

\crefname{table}{tabla}{tablas}

to your example. See section 8.1.2 of the cleveref manual for details. Note that it is also good practice to load cleveref at the very end of the preamble.

  • is important type it after \begin{document} Thank you @lockstep – Mika Ike Jun 12 '14 at 13:31
  • 2
    @MikaIke General formatting changes should be done in the preamble. Note that, instead of redefining \tablename and \listtablename in the document body, you should do it in the preamble using \addto\captionsspanish; see tex.stackexchange.com/questions/82993/… – lockstep Jun 12 '14 at 13:34

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.