I would like to know how to \ref from other documents.
thankx
Yeong
> Hi all,
>
> I would like to know how to \ref from other documents.
xr.sty could be what you're looking for.
hih
--
Le TeXnicien de surface
I want to crossreference from about document, let's say, i want to
crossreference a.tex to b.tex, but they are in different directory.
Yeong
xr.sty is part of the latex required tools. if your system does not
contain it, you have a defective system. a properly configured system
will provide both the package and its documentation.
>I want to crossreference from about document, let's say, i want to
>crossreference a.tex to b.tex, but they are in different directory.
so make the .aux file accessible; for example, have a tex inputs
variable looking something like
TEXINPUTS=.:/dir/that/contains/aux/file:
(that example assumes you're working on a un*x system).
--
Robin (http://www.tex.ac.uk/faq) Fairbairns, Cambridge
I search about TEXINPUTS in google, but still can't figure out how to use
it. I think TEXINPUTS can just put this line into b.tex so that i can
called a.aux, but i don't know how to use it.
Thankx
Yeong
Use the xr package as pointed out in the other threads, or use
xr-hyper for hyperlinked refs with hyperref.
A small example:
(a) write the following two tex file, docA.tex and docB.tex
(b) put both files in the same directory, otherwise the path
must be specified as part of the xr header.
(c) run pdfLaTeX twice on both filles. First on docA and then on docB.
docB reads docA.aux to get label info.
%%%%% docA.tex %%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{hyperref}
\begin{document}
This is a test for math.
\begin{equation}
E=mc^2 \label{eq:1}
\end{equation}
\clearpage
This is a second test for math.
\setcounter{equation}{5}
\begin{equation}
r = \sqrt{x^2 + y^2} \label{eq:2}
\end{equation}
\end{document}
%%%%% docB.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument[A-]{docA}[docA.pdf]% <- full or relative path
\begin{document}
As was shown in Eq.~\ref{A-eq:1} is it ...
\clearpage
... or in Eq.~\ref{A-eq:2} is ...
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I hope it helps
Danie Els: (dnjels at sun dot ac dot za)
> Yeong Wai LEE <iy...@students.cs.mu.OZ.AU> wrote in message news:<Pine.GSO.4.56.04...@murree.cs.mu.OZ.AU>...
> > Hi all,
> >
> > I would like to know how to \ref from other documents.
> >
>
> Use the xr package as pointed out in the other threads, or use
> xr-hyper for hyperlinked refs with hyperref.
>
> A small example:
>
> (a) write the following two tex file, docA.tex and docB.tex
> (b) put both files in the same directory, otherwise the path
> must be specified as part of the xr header.
It is working, but my problem is i don't put docA.tex and docB.tex into
the same directory, how do i modify xr.sty? Or do i need to use TEXINPUTS?
which i don't know how to use either. Thankx for your help
Yeong
------------ And now a word from our sponsor ------------------
Do your users want the best web-email gateway? Don't let your
customers drift off to free webmail services install your own
web gateway!
-- See http://netwinsite.com/sponsor/sponsor_webmail.htm ----
You mentioned that \externaldocument[A-]{docA}[docA.pdf]% <- full or
relative path,
I do this, \externaldocument[A-]{docA}[../docA.pdf]
it is not working.
Thankx alot.
Yeong
On Fri, 15 Apr 2004, Danie Els wrote:
According to your explanation, from docB, docA is at ../docA/docA.pdf.
This may explain why \externaldocument[A-]{docA}[../docA.pdf] isn't
working.
(Also, please don't top-post; that is, please put your reply below the
text that you're quoting, and quote only the relevant bits, as I've done
here.)
- Brooks
--
The "bmoses-nospam" address is valid; no unmunging needed.
The format for \externaldocument is
\externaldocument[<refprefix>]{<aux-file>}[<pdf-file>]
Note that you must use the same relative directory structure for your
document development and you final distribution setup!
For a directory structure
./docAdir/docA.tex
./docBdir/docB.tex
you will use inside docB for references to docA:
\externaldocument[A-]{../docAdir/docA}[../docAdir/docA.pdf]
Hope it helps
Danie Els: dnjels at sun dot ac dot za
It is working now if i use \usepackage{xr-hyper}, but it is not working
when i use \usepackage{xr}, which i downloaded xr.sty from google. Because
in my document, i am not using hyperref, i just need to cross-reference
from different documents in different directory.
The errors it gave me was :
IMPORTING LABELS FROM ../docA/docA.aux
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.4 \externaldocument[A-]{../docA/docA}[
../docA/docA.pdf]% <- full or
rela...
Thankx for your help
Yeong
>
> > \externaldocument[A-]{../docAdir/docA}[../docAdir/docA.pdf]
>
> It is working now if i use \usepackage{xr-hyper}, but it is not working
> when i use \usepackage{xr}, which i downloaded xr.sty from google. Because
xr and xr-hyper is part of the base LaTeX distro?
> in my document, i am not using hyperref, i just need to cross-reference
> from different documents in different directory.
>
> The errors it gave me was :
>
> IMPORTING LABELS FROM ../docA/docA.aux
>
> ! LaTeX Error: Missing \begin{document}.
>
> See the LaTeX manual or LaTeX Companion for explanation.
> Type H <return> for immediate help.
> ...
>
> l.4 \externaldocument[A-]{../docA/docA}[
> ../docA/docA.pdf]% <- full or
> rela...
Please read the documentation in the file xr.sty. It is in the begining of
the file and in plain English! The documentation states the format for xr
is:
\extenaldocument[<refprefix>]{<./path/to/aux-file>}
It do not have the [<url>] part at the end.
Danie Els