1

As an apposite situation of this question, I would like to use cleveref, but it constantly prints unabbreviated text (Chapter, Section, etc.). Is there a way to force the abbreviated form (Chap., Sec., etc.)?

If it makes a difference, I use a KOMA-Script class:

\documentclass[english]{scrreprt}

and the full list of packages:

%%% PAGE DIMENSIONS
\usepackage{geometry} 
\geometry{verbose,a4paper,tmargin=3.5cm,bmargin=2.5cm,lmargin=2.6cm,rmargin=2.6cm,headheight=1.3cm,headsep=1cm}
\pagestyle{headings}

%%% PACKAGES
\usepackage{array} 
\usepackage{paralist} 
\usepackage{verbatim} 
\usepackage{subfig} 
\usepackage{amsmath, amsthm, amssymb, url}
\usepackage{enumitem}
\usepackage{mathrsfs}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{tabu,longtable,booktabs,caption}
\usepackage[pdftex]{graphicx,color}
\usepackage{scrpage2,datetime,tikz}
\usepackage[unicode=true]{hyperref}
\usepackage[numbered]{bookmark}
\usepackage{float}
\usepackage{lscape}
\usepackage{listings}
\usepackage{multirow}
\usepackage[nameinlink]{cleveref}
  • And where is the \cref stuff? No document body! – user31729 Aug 4 '15 at 15:32
  • @ChristianHupfer and neither the referenced question has it. You don't always need a document body to explain the problem. – Federico Aug 4 '15 at 17:19
  • The point is, that you've left it to users willing to help you, to write labels and \cref statements. That's what I meant about missing \cref stuff. – user31729 Aug 4 '15 at 17:57
4

I don't know whether this is a good practise in English or not. In any case, you can use \crefname to provide the desired abbreviated form (by default just equations, and figures are abbreviated); I also provided non-abbreviated forms for \Cref since abbreviations should not be used at the beginning of a sentence:

\documentclass[english]{scrreprt}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[nameinlink]{cleveref}

\crefname{chapter}{chap.}{chap.}
\crefname{section}{sect.}{sect.}
\Crefname{chapter}{Chapter}{Chapters}
\Crefname{section}{Section}{Sections}

\begin{document}
\chapter{Test chapter}
\label{cha:test}
\section{Test section}
\label{sec:test}
As we see in \cref{sec:test} of \cref{cha:test}

\Cref{sec:test}

\Cref{cha:test}

\end{document}

enter image description here

If, for some reason, you need a different variant in some part of the document, you can use something like

 ...{\Crefname{chapter}{Chap.}{Chap.}\Cref{cha:test}}...

the extra pair of braces keeps the change local.

| improve this answer | |
  • Perhaps you should add that only few label types are abbreviated by default, such as equation, figure and table... – user31729 Aug 4 '15 at 15:45
  • @ChristianHupfer Yes, I added a note; thanks. By default, table is not abbreviated, however. – Gonzalo Medina Aug 4 '15 at 15:53
  • Really? I thought it would. Thanks for correcting me! And I agree with you that constantly using abbreviations is no good style, perhaps in no language... – user31729 Aug 4 '15 at 15:54
  • correct me if I got it wrong, but I cannot have duplicates of the same \Crefname, right? (I need it abbreviated with the capital letter in certain tables) – Federico Aug 4 '15 at 17:19
  • 1
    @Federico You're right. However, you can use \Crefname as many times as you want in your document, so you can say {\Crefname{chapter}{Chap.}{Chap.} \Cref{cha:test}} (notice the extra anclosing braces to keep the change local) whereever you want to make a change. – Gonzalo Medina Aug 4 '15 at 17:22

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.