With hyperref
package only: use \hyperdef
(to label) + \hyperref
(to link):
% file_A.tex
... How can I refer to \hyperdef{categoryname}{labelname}{this text} from file\_B.pdf?
and
% file_B.tex
... Like \hyperref{file_A}{categoryname}{labelname}{this}!
This creates a hyperlink from file_B.pdf
(after pdfLaTeX
processing) to the correct location in file_A.pdf
.
But it is not possible with this technique to retrieve LaTeX
-generated numbers from labels in File A (such as eq. no, section no) in order to use them in File B as link text.
For example, if file_A.pdf
has an equation labelled with \label{myeq}
resulting in the number (1)
, it will not be possible to show this number in the text of the link (other than writing it manually...):
% file_B.tex
... Like \hyperref{file_A}{categoryname}{labelname}{Eq. ??? in file\_A.pdf}
Or course to be able to do that LaTeX
would require to compile both files jointly so file_B
knows about the counters of file_A
(It seems the xr-hyper
package can be used for that.) Above, only an independent compilation of the files is necessary.