I'm using xr
package for referencing to external documents. I want to add external document title to a reference.
How it could be obtained?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityConsider the following. If you set up xr so that \ref{A-mnemonic}
returns the section number, then \ref{A-name}
will return "document name". As a bonus, \pageref{A-name}
will return the last page number.
\documentclass{article}
\makeatletter
\AtEndDocument{\def\@currentlabel{document name}%
\label{name}}
\makeatother
\begin{document}
\section{Section}\label{mnemonic}
\ref{mnemonic}
\ref{name}
\pageref{name}
\end{document}