I am using TL 2023 (Ubuntu 24.04)
It seems that xr-hyper does work for the beamer class (using or not using subfiles)
I have a longer (500 page) beamer document, that I split using subfiles. I deal with the links between sub documents, using xr-hyper. main.tex:
\documentclass[presentation]{beamer}
\usepackage{xr-hyper}
\usepackage{hyperref}
\hypersetup{%
colorlinks=true,% hyperlinks will be coloured
% linkcolor=blue,% hyperlink text will be blue
urlcolor=blue,% hyperlink text will be blue
% linkbordercolor=red,% hyperlink border will be red
urlbordercolor=red,% hyperlink border will be red
}
\externaldocument[M-]{main}[]
\usepackage{subfiles}
\begin{document}
\subfile{part1}
\subfile{part2}
\end{document}
and part1.tex
\documentclass[main.tex]{subfiles}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument[M-]{main}
\begin{document}
\begin{frame}
\frametitle{Summary}
This is a \textbf{xr-hyper} ref: \eqref{M-eq:part2-ceros:1}.
This is regular reference: \eqref{eq:part2-ceros:1}
\begin{equation}
\label{eq:part1-ceros:1}
\int f dx =0
\end{equation}
\end{frame}
\end{document}
and part2.tex
\documentclass[main.tex]{subfiles}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument[M-]{main}
\begin{document}
\begin{frame}
\frametitle{Main equations}
\textbf{xr-hyper} ref: \eqref{M-eq:part1-ceros:1}
Usual ref: \eqref{eq:part1-ceros:1}
\begin{equation}
\label{eq:part2-ceros:1}
\sum\limits_{}^{} f dx =0
\end{equation}
\end{frame}
\end{document}
When I compile main tex the no xr-hyper links work, the xr-hyper don't
I also tried \externaldocument[M-]{main}[] but it does not change
I also tried just two beamer files, without using subfiles but the result was the same, the xr-hyper links do not work.
Any idea?
Thanks
Uwe Brauer
\inputso you shouldn't use xr at all, as that is for referencing documents that are not input\inputfiles independently, but I can do this withsubfilesfor example using the article class, I compile the sub-documents independently (frommain.tex). So when I compile them I want to check the references links, without being forced to run main.tex. That IMHO is the whole point of subfiles.\externaldocument[M-]{main}[]in main.tex is referencing the current document as external so it's conceptually wrong and (as the person who wrote xr) I can confirm that whatever it does is accidental unplanned behaviour.\externaldocument[M-]{main}and still does not work, moreover if I consider two beamer files, (not usingsubfiles) thexr-hyperlinks do not work in beamer, (I know that beamer rewrites a lot of basic commands)\externaldocument[M-]{main}that is still conceptually wrong, the main document is not external to main