% !TEX TS-program = XeLaTeXmk \documentclass[11pt]{article} \usepackage{refmacros} \usepackage{amssymb, amsmath} \RequirePackage[sectiontheorem,indexdefs]{formatmacros} \usepackage[colorlinks, backref]{hyperref} \title{Test of hyperref} \author{ZN} \begin{document} \maketitle \tableofcontents \section{first section}\label{sec:first} Some Words added by HS. \subsection{a subsection}\label{subsec:first} Maybe some text \begin{theorem}\label{thm:first} A stupid but superficially profound statement, involving \begin{equation}\label{eqn:first} \mathfrak{a}+\mathfrak{b}=\mathfrak{c}+\mathfrak{d}-\mathfrak{A} \end{equation} \end{theorem} \subsection{More nonsense}\label{subsec:second} Some more text \begin{prop}\label{prop:first} The correct equation is \begin{equation}\label{eqn:second} Y=X \end{equation} \end{prop} % space before and after \newpage added by HS \newpage \section{Conclusions}\label{sec:second} Compare \refer{eqn}{first} in \refer{thm}{first} (\refer{subsec}{first} (in \refer{sec}{first}) with \refer{eqn}{second} in \refer{prop}{first} (\refer{subsec}{second}). Who cares? \end{document}