I'm using cleveref
to cross-reference my theorems throughout my document. However, since certain theorems are so popular, I much prefer to refer to them by names as opposed to their theorem numbers; but I would still like them to be clickable, so that clicking on a theorem's name, wherever it's mentioned, will take you straight to it.
To create custom string, I implemented the solution provided by this answer, which can be shown in the MWE below.
\documentclass{article}
\usepackage{amsthm, parskip, hyperref, cleveref}
% Theorems
\theoremstyle{definition}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{example}[theorem]{Example}
% Solution from https://tex.stackexchange.com/a/109864/78913
\makeatletter
\newcommand{\myref}[1]{\cref{#1}\mynameref{#1}{\csname r@#1\endcsname}}
\newcommand{\Myref}[1]{\Cref{#1}\mynameref{#1}{\csname r@#1\endcsname}}
\def\mynameref#1#2{%
\begingroup
\edef\@mytxt{#2}%
\edef\@mytst{\expandafter\@thirdoffive\@mytxt}%
\ifx\@mytst\empty\else
\space(\nameref{#1})\fi
\endgroup
}
\makeatother
\begin{document}
\section{Group Actions}
\begin{theorem}[Orbit-Stabiliser Theorem]
\label{thm:ost}
Let $G$ be a finite group acting on a finite set $X$. Then
\[|G| = \mathop{\mathrm{Orb}}(x) \times \mathop{\mathrm{Stab}}(x).\]
\end{theorem}
\begin{example}
Let $G$ act on $X$, where $|G| = 55$ and $|X| = 18$. Show that the action has at least two fixed points.
By the \nameref{thm:ost}, ...
\end{example}
\end{document}
This code provides the following output:
Is there a way I can change the label so that the text is in lower-case? I tried using \MakeLowercase{}
, but this didn't work. And is there a way I can modify the label in general? If I have something like "Cauchy's Theorem" for example, I'd like to have it appear as "Cauchy's theorem" in text, with a lower-case t
.
I appreciate any assistance.
\DeclareMathOperator{\Orb}{Orb}
and\DeclareMathOperator{\Stab}{Stab}
, with\lvert G\rvert=\lvert\Orb(x)\rvert\times\lvert\Stab(x)\rvert
rather than the awkward\mathop
construction (requiresamsmath
, of course). – egreg Dec 28 '17 at 22:30\mathop
for the MWE. Thanks though. – Luke Collins Dec 28 '17 at 22:40