TransWikia.com

Creating new cleveref types

TeX - LaTeX Asked by Luiz Martins on December 26, 2020

The package cleveref has two types of references, cref for lowercase and Cref for uppercase. Does the package provide a way to define more types? If not, how may you define one yourself?

As an example, one may want to define abbreviated versions of the references, such that the code:

documentclass{article}

usepackage{fontspec, amsthm, hyperref}
usepackage[nameinlink]{cleveref}

newtheorem{theorem}{Theorem}

% Defining abbrcref
% Defining abbrCref
% Defining abbrcrefformat
% Defining abbrCrefformat

crefformat{theorem}{#2theorem #1#3}
Crefformat{theorem}{#2Theorem #1#3}
abbrcrefformat{theorem}{#2th.#1#3}
abbrCrefformat{theorem}{#2Th.#1#3}

begin{document}
    begin{theorem}
        label{sometheorem}
    end{theorem}

    cref{sometheorem}, Cref{sometheorem}, abbrcref{sometheorem}, abbrCref{sometheorem}
end{document}

Would produce:

enter image description here

How would one go about doing that?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP