# How to change \ref output?

I am writing my Greek PhD thesis in latex (using babel). FYI, by default Τable in Greece is called: Πίνακας. So, for example, when I make a table using the table environment, babel automatically translates the word Table as Πίνακας 1. blabla.

Hence when I use \ref{tab:label} to crossreference to this table, the output of this command is "Πίνακας 1. blabla", as you would expect.

However, because of the Greek language's particularity which has many ways to call nouns, I would therefore like to change the output of the \ref{tab:label} to "Πίνακα 1. blabla" (please note that the difference is the missing ς at the end of the tablename).

How could I do this?

Please have in mind that I want to change only the way the tablename is referenced in the text after calling the \ref command and not the name that appears in the caption (which is correctly transformed by babel as Πίνακας)

-
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. – egreg Nov 28 '11 at 0:12
LaTeX usually doesn't add the name of the referenced object, so you're probably using an additional package. Please, show a minimal example of the code you're using. – egreg Nov 28 '11 at 0:15

To add the name of the thing you are referencing to (table, figure, etc.) you can use the cleveref package. As I see from babel when using greek, it automatically changes the table name to Πίνακας 1. So you only need to change the way of referencing it. You achieve this by redefining the table format with \crefformat{element}{new format}.

\documentclass{article}
\usepackage[greek]{babel}
% Clever references
\usepackage{cleveref}

% Change the name of the reference
\crefformat{table}{P'inaka. #1}

\begin{document}
\cref{tab:dummy} bla bla bla.

\begin{table}[ht]
\centering
\rule{8cm}{4.5cm}
\caption{A dummy table}\label{tab:dummy}
\end{table}

\end{document}


I'm not sure if this is what you are doing. I would need to see a MWE to help you better.

-