Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem using xr-hyper and hyperref

1,155 views
Skip to first unread message

Thomas Arildsen

unread,
Mar 10, 2009, 1:11:38 PM3/10/09
to
I am attempting to use xr together with hyperref. Reading the FAQ (http://
www.tex.ac.uk/cgi-bin/texfaq2html?label=extref) I figured out that I need
to use xr-hyper. Following the above example, I attempted the following:

I have a document testxrhypersource.tex containing:

\documentclass{minimal}

\begin{document}

Test equation:
\begin{equation}
\label{eq:1}
A=B
\end{equation}

\end{document}

I have another document testxrhyper.tex containing:

\documentclass{minimal}

\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument{testxrhypersource}

\begin{document}

Test refererence~\ref{eq:1}.

\end{document}

I first compile testxrhypersource.tex a couple of times until everything
has fallen into place. Then, when I try to compile testxrhyper.tex
(pdfLaTeX), I get the following error:

ERROR: Paragraph ended before \Hy@setref@link was complete.

--- TeX said ---
<to be read again>
\par
l.10

--- HELP ---
A blank line occurred in a command argument that shouldn't contain
one. You probably forgot the right brace at the end of an argument.

I cannot figure out what is wrong. Could someone please take a look at it?
Thanks,

Thomas Arildsen
--
All email to sender address is lost.
My real adress is at es dot aau dot dk for user tha.

Ulrich D i e z

unread,
Mar 10, 2009, 7:24:58 PM3/10/09
to
Thomas Arildsen wrote:

> I am attempting to use xr together with hyperref. Reading the FAQ (http://
> www.tex.ac.uk/cgi-bin/texfaq2html?label=extref) I figured out that I need
> to use xr-hyper. Following the above example, I attempted the following:
>
> I have a document testxrhypersource.tex

... which does not load the hyperref-package.

> I have another document testxrhyper.tex containing:

... which does load the hyperref-package.

> Then, when I try to compile testxrhyper.tex
> (pdfLaTeX), I get the following error:

[...]


> I cannot figure out what is wrong. Could someone please take a look at it?

The format in which \label stores referencing-information
in these \newlabel-entries in the aux-file is not identical
for documents which load the hyperref-package and
documents which don't load the hyperref-package.

Thus you cannot import labels from a document which did
not load the hyperref-package to a document which does
load the hyperref-package and vice versa.

The following works:

testxrhypersource.tex:

\documentclass{minimal}

\usepackage{hyperref} %!!!!!!!!!!!!!!!

\begin{document}

Test equation:
\begin{equation}
\label{eq:1}
A=B
\end{equation}

\end{document}


testxrhyper.tex:

\documentclass{minimal}

\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument{testxrhypersource}

\begin{document}

Test refererence~\ref{eq:1}.

\end{document}


Ulrich

Heiko Oberdiek

unread,
Mar 10, 2009, 8:32:52 PM3/10/09
to
Ulrich D i e z <eu_an...@web.de.invalid> wrote:

> Thus you cannot import labels from a document which did
> not load the hyperref-package to a document which does
> load the hyperref-package and vice versa.

In package zref/module xr I have written a parser for .aux
files that tries to import as much data as possible.

Yours sincerely
Heiko <ober...@uni-freiburg.de>

Thomas Arildsen

unread,
Mar 11, 2009, 3:52:13 AM3/11/09
to

Oh, I see. I was not aware of this.
Thanks a lot,

Thomas Arildsen

unread,
Mar 11, 2009, 4:07:25 AM3/11/09
to

This sounds useful as well, but it seems that both your approach and
xr-hyper require me to modify the referred document as well. This is a
document I am not willing to make any modifications in, at least for now,
so I think I will do without hyperref for now and just use xr.

Ulrich D i e z

unread,
Mar 11, 2009, 7:24:42 AM3/11/09
to
Thomas Arildsen wrote:

> This sounds useful as well, but it seems that both your approach and
> xr-hyper require me to modify the referred document as well. This is a
> document I am not willing to make any modifications in, at least for now,
> so I think I will do without hyperref for now and just use xr.

At first glimpse I thought you could probably load the hyperref-
package with the "draft"-option which would (usually) not change
the look of the resulting document/pdf-file in comparison to not
having loaded hyperref at all.

But this does not work: If hyperref was loaded with draft-option
for testxrhypersource.tex, but loaded without draft-option for
testxrhyper.tex, then you won't get error-messages during
compilation of any of the files, but all references from
testxrhyper.pdf to testxrhypersoure.pdf will end up on the first
page of testxrhypersoure.pdf as therein no anchors were created.

I wonder if implementing some sort of "anchorsonly"-option
or -switch for the hyperref-package makes sense or if - once
more - I overlook something important which renders such
an undertaking into something obsolete.

Ulrich

0 new messages