Thref from ntheorem not working with hyperref

hyperrefntheorem

I want to use the extended reference features from ntheorem, but they seem to be not working with hyperref, even with the parameter hyperref for ntheorem.

\documentclass[11pt,a4paper]{article}
\usepackage[thref,hyperref]{ntheorem}
\usepackage{hyperref}

\begin{document}

\section{Section}\label{sec}[Testsection]

Cite with thref: \thref{sec}

\end{document}

Here the optional parameter [Testsection] ist not recognised as a parameter but instead printed out.
If I remove hyperref everything is working as intended.

Best Answer

I'm afraid that the option thref to ntheorem does a long series of hacks that are difficult to cope with when hyperref is used.

You can use cleveref that's much more robust.

\documentclass[11pt,a4paper]{article}

\usepackage{amsthm}
\usepackage{hyperref}
\usepackage{cleveref}

\newtheorem{theorem}{Theorem}

\crefformat{Testsection}{#2Test section~#1#3}{}
\crefformat{Specialtheorem}{#2Special theorem~#1#3}{}

\begin{document}

\section{Section}\label[Testsection]{sec}

\begin{theorem}\label[Specialtheorem]{thm}
Theorem statement
\end{theorem}

Cite with cref: \cref{sec} and \cref{thm}

\end{document}

enter image description here

Related Question