0

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?

1
  • See the mathtools manual, there is a macro similar to nocite for that
    – daleif
    Oct 9, 2019 at 9:33

2 Answers 2

1

Have a look at this post by Overleaf: Cross referencing with the xr package in Overleaf & xr package

0
0

Simply add \noeqref{sec:my_title} in main.tex.

Indeed, as the comment by @daleif points out, the documentation for the mathtools package discusses the \noeqref, which is similar to \nocite for bibliography items.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.