I have a file main.tex
\documentclass{article}
\usepackage{xr-hyper}
\usepackage{hyperref}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}
\begin{document}
\begin{equation}\label{sec:mytitle}
1 + 1 = 2
\end{equation}
\end{document}
and ref.tex
\documentclass{article}
\usepackage{xr-hyper}
\usepackage[colorlinks]{hyperref}
\hypersetup{
colorlinks,
linkcolor={blue},
filecolor={red}, %<----
urlcolor={blue},
citecolor={blue}
}
\externaldocument[ex:]{external}
\begin{document}
\section{My section}\label{sec:mysection}
Local ref: \ref{sec:mysection}, external ref: \ref{ex:sec:mytitle}
\end{document}
I use showonlyrefs
option in main.tex
to minimize the numbering. However, I may have some equations that I will only call in ref.tex
. These equations will not be numbered in main.tex
by showonlyrefs
. Is there any way I could overcome this?