I'm using xr
to reference equations in supplemental material to a paper. I'd like equations from the supplement referenced in the paper to automatically be prefixed with "S", so that Eq.~\ref{eqn:first}
appears in the text as Eq. S1
. Ideally this would be true in the supplemental document as well. How do I do this?
[Tex/LaTex] Automatically add prefix to references from another document
cross-referencingxr
Best Answer
Here is a solution combining the
xr
andprettyref
packages. The downside is that it forces you to use\prettyref
instead of\ref
, but you might benefit from the kind of automation provided by theprettyref
package anyway :)Contents of
myotherfile.tex
:Output of the main file: