Suppose you have a tex file (lets call it B) with some labels, and another one file (call it A) , xr package will allow us to make hyperref from A->B , but I previously found couple cases (I don't know if that done by LaTeX) in which clicking on the link that in file A , will automatically open the file B (if they was in the same directory) and jump to the particular label in that file B, is that possible to be done somehow in LaTeX ?
P.S-1
Currently if we do that external ref. clicking on the link will only jump to the begening of the current file (I mean file A) and will not open anything (unless I'm doing something wrong)
P.S-2
In other question I get this answer:
There is a recent post on the LyX users mailing list about this. It has no answer yet, but you could watch it and see if anything pops up. mail-archive.com/lyx-users@lists.lyx.org/msg93271.html – Torbjørn T.
But that corespondance is very old (back to 2010) , are there is any difference?
Best Answer
Yes, this is certainly possible using the
hypertarget
andhref
mechanism provided by thehyperref
package.Let's say that
fileA.tex
hasThen you can write
fileB.tex
asNote that not all
pdf
viewers support this- for exampleevince
didn't give the correct behaviour, butacroread
did.Update following the comments
The
lipsum
package is used to generate sample text- you don't need it for most of your documents, but you'll see it used a lot here on tex exchange just to demonstrate MWEs.You can automate the
hypertarget
mechanism for each section in lots of ways- here's one way using thetitlesec
package to help; note that I've commented out theshowlabels
package, but you might like to use it during debugging, it's really helpful!fileA.tex
fileB.tex