EDIT: The mentioned solution on the bottom of this page works perfectly for the label output. But now I am struggling with the distance of the \crefname and the counter. Instead of a space I would like to have a smaller distance between fig. and the number. Instead of fig.~1 I'd like to have fig\,1 but it appears that I am losing myself in the code of the cref manual.
I am using a combination of varioref
, cleveref
and hyperref
to use a - I would say - more "sophisticated" referencing behaviour. It enables me to simply use \vref{labelname}
to get the output
Table 1 on page 1
My MWE looks like this:
\documentclass{scrreprt}
\usepackage[T1]{fontenc}%Kodierung
\usepackage[utf8]{inputenc}%%Kodierung
\usepackage[english,ngerman]{babel}%language
\usepackage[format=plain,indention=1em,labelfont=bf,font=footnotesize,justification=justified,position=bottom]{caption} %schönere Captions durch den \caption-Befehl
%%%%%%%%%%
%REFERENCES
%%%%%%%%%%
\usepackage[ngerman]{varioref}
\usepackage[linktocpage=true,bookmarksopen,hidelinks,ngerman,hyperfootnotes=false]{hyperref}%Hyperrefpaket
\usepackage[ngerman,nameinlink,sort]{cleveref}
\renewcommand*babel\reftextfaraway[1]{auf S.\,\pageref{#1}}%
\addto\extrasngerman{\renewcommand{\reftextfaraway}[1]{auf S.\,\pageref{#1}}} %Short page labels
\begin{document}
\chapter{Chapter 1}
\begin{table}
\caption{Text}
\label{text}
\end{table}
\newpage
\vref{text}
\end{document}
Now, what I want is: I would like to change the way the Table or Figure or whatever is named in the text, when I use a 'ref' command. Instead of
Figure 1 on page 1
I would like to get (preferably in German but I guess this is reached by a general trigger or babel)
Fig. 1 on p. 1
Through research I already figured out how to modify the label in the float itself by adding this code (since I am using the babel package this is needed):
\addto\captionsngerman{\renewcommand{\figurename}{Abb.}}
\addto\captionsngerman{\renewcommand{\tablename}{Tab.}}
Also, in a forum I found a way to modify the pagelabel output but I failed at changing the text output of my referencing command. I tried
\addto\captionsngerman{\renewcommand{\crefname}{Abb.}}
But, this simply gives me an error of a missing control sequence.