1

I am writing a document and want to have old style numbers whenever hyperref creates a links to something inside my document that is numbered. This includes references to numbered sections, pages (references inside text and also on table of contents, figures and table), theorems (amsthm), figures, tables etc. I use the cleveref package and the command \cref for references.

MWE

\documentclass[oneside]{book}
\usepackage{amsthm}
\usepackage[hidelinks,linktocpage]{hyperref}
\usepackage{cleveref}
\newtheorem{theorem}{Theorem}

\begin{document}
\tableofcontents
\listoffigures
\listoftables

\chapter{Chapter}
\label{chapter}

\section{Section}
\label{section}

\section{Subsection}
\label{subsection}

\section{Subsubsection}
\label{subsubsection}

\begin{theorem}
\label{theorem}
A theorem.
\end{theorem}

\begin{figure}
    %\includegraphics{example-image-a}}
    \caption{An image.}
    \label{figure}
\end{figure}
\begin{table}
\centering
    \begin{tabular}{c|c}
        0 & 1 \\
        2 & 3
    \end{tabular}
    \caption{A table.}
    \label{table}
\end{table}

References to \cref{chapter}, \cref{section}, \cref{subsection} and \cref{subsubsection}. References to \cref{theorem}, \cref{figure} and \cref{table}.

\end{document}
0

1 Answer 1

0

You could use the cfr-lm package to switch to old style figures for the cross-references:

\documentclass[oneside]{article}
\usepackage{amsthm}
\usepackage[linktocpage,hidelinks]{hyperref}
\usepackage[nameinlink]{cleveref-usedon}

\usepackage[rm={oldstyle=false}]{cfr-lm}

\makeatletter
\patchcmd{\@cref}{\begingroup}{\begingroup\fontfamily{clm2j}\selectfont}{}{}
\makeatother


\newtheorem{theorem}{Theorem}
\theoremstyle{definition}
\newtheorem{definition}{Definition}

\begin{document}

\section{Section}
\label{section}

\section{Subsection}
\label{subsection}

\section{Subsubsection}
\label{subsubsection}

\begin{definition}
\label{definition}
A definition.
\end{definition}

\begin{theorem}
\label{theorem}
A theorem.
\end{theorem}

\begin{equation}
\label{equation}
0=1
\end{equation}

\begin{figure}
    %\includegraphics{example-image-a}}
    \caption{An image.}
    \label{figure}
\end{figure}
\begin{table}
\centering
    \begin{tabular}{c|c}
        0 & 1 \\
        2 & 3
    \end{tabular}
    \caption{A table.}
    \label{table}
\end{table}

References to \cref{section,subsection} and \cref{subsubsection}. References to \cref{definition}, \cref{theorem}, \cref{equation}, \cref{figure} and \cref{table}.

\end{document}

enter image description here

3
  • This does not generate old style figures on the table of contents, list of figures and list of tables. Commented Mar 14 at 18:16
  • @PedroG.Mattos The toc etc. is more like a table than a block of text. I would use lining figures there so the line spacing will look more even. Commented Mar 14 at 18:49
  • I understand. But I want the links to look different from non-links, and the links on my TOC are the numbers. Commented Mar 14 at 19:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .