1

The example below may not be exactly "minimal" because I am not sure of any package interdependencies, and I want you to be able to see exactly what I'm doing. Ideally, I would like all of "Definition 1.0.1" to be linked with a non-colored, non-underlined link that is mainly detectable when you put the mouse over it while viewing the PDF. If only the number gets linked, that is good enough, but not as good. I want the same thing when I refer to "Theorem 2.0.1." When I use \ref there are no links, and switching to \cref only makes the unlinked question marks appear (indicated with green arrows). Thank you for looking at this.

enter image description here

\documentclass[letterpaper,twoside,notitlepage]{article}
\usepackage{graphicx}
\usepackage{bm}    
\usepackage{amssymb,amsmath}
\usepackage{mathrsfs}
\usepackage{titling}
\usepackage{bigints}
\usepackage{cite}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{longtable}
\usepackage{tabularray}
\usepackage{mathtools}
\usepackage{setspace}
\usepackage{centernot}
\usepackage{longtable}
\usepackage{textcomp}
\usepackage[hidelinks]{hyperref}
\usepackage{cleveref}
\newif\iffirst\firsttrue %
\allowdisplaybreaks
\usepackage[left=1.5in,right=1.5in,top=0.75in,bottom=.75in,centering,includeheadfoot]{geometry}


 
%%%%%%%%%%%%%%%%%  THEOREM ENV's %%%%%%%%%%%%%%%%%%%
\usepackage[amsmath, thmmarks, thref]{ntheorem}
\newtheorem{thm}{Theorem}[subsection]
\newtheorem{defin}[thm]{Definition}
\theoremheaderfont{\itshape}
\theoremsymbol{\textleaf}
\newtheorem*{proof}{\textsf{\underline{Proof.}}}[subsection]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{document}
\large{
\setcounter{page}{1}
\section{First Fake Section}
\begin{defin}\label{def:DEF1}
    A definition is supposed to tell you what something means.  In this case, a definition is something I will want to link as a cross-referenced item later via the label.
\end{defin}

\section{Second Fake Section}
\begin{thm}\label{thm:THM1}
Even if I cite this with CREF later, there won't be the link I want.
\end{thm}

\begin{proof}
As in Definition \cref{def:DEF1}, this doesn't get linked.
\end{proof}


\section{Third Fake Section}
You can see that links are not happening for either Definition \cref{def:DEF1} or Theorem \cref{thm:THM1}.  For some reason, switching from REF to CREF just makes these question marks appear.
 
}
\end{document}

1 Answer 1

2

You must load ntheorem before cleveref. And to remove the thref option.

I made a few changes to your code, for instance commenting out textcomp that's no longer necessary; I commented hidelinks just for the picture below.

\documentclass[letterpaper,twoside,notitlepage]{article}
\usepackage[
  left=1.5in,
  right=1.5in,
  top=0.75in,
  bottom=0.75in,
  centering,
  includeheadfoot
]{geometry}
\usepackage{graphicx}
\usepackage{bm}    
\usepackage{amssymb,amsmath}
\usepackage[amsmath, thmmarks]{ntheorem}
\usepackage{mathrsfs}
\usepackage{titling}
\usepackage{bigints}
\usepackage{cite}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{longtable}
\usepackage{tabularray}
\usepackage{mathtools}
\usepackage{setspace}
\usepackage{centernot}
\usepackage{longtable}
%\usepackage{textcomp}
\usepackage[
  %hidelinks
]{hyperref}
\usepackage{cleveref}

\newif\iffirst\firsttrue %
\allowdisplaybreaks


 
%%%%%%%%%%%%%%%%%  THEOREM ENV's %%%%%%%%%%%%%%%%%%%
\newtheorem{thm}{Theorem}[section]
\newtheorem{defin}[thm]{Definition}
\theoremheaderfont{\itshape}
\theoremsymbol{\textleaf}
\newtheorem*{proof}{\textsf{\underline{Proof.}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{document}

\section{First Fake Section}

\begin{defin}\label{def:DEF1}
A definition is supposed to tell you what something means.  
In this case, a definition is something I will want to link 
as a cross-referenced item later via the label.
\end{defin}

\section{Second Fake Section}

\begin{thm}\label{thm:THM1}
Even if I cite this with CREF later, there won't be the link I want.
\end{thm}

\begin{proof}
As in \Cref{def:DEF1}, this doesn't get linked.
\end{proof}


\section{Third Fake Section}
You can see that links are not happening for either 
\Cref{def:DEF1} or \Cref{thm:THM1}.  
 
\end{document}

enter image description here

1
  • Thanks! I think I did not need \usepackage{cleveref} at all. Moving \usepackage{ntheorem} above \usepackage{hyperref} and deleting thref did exactly what I wanted. Commented Jul 13, 2023 at 13:44

You must log in to answer this question.

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