I'm making use of cross-references between some hyperref'd documents. I'm trying to construct a URL using \ref*{mylabel}, but \href really doesn't like this in the URL part.
This is a.tex:
Code: Select all
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\section{Foo}\label{mylabel}
\end{document}
Code: Select all
\documentclass{article}
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument[A]{a}
\begin{document}
Amylabel, using \verb|\ref*|, is \ref*{Amylabel}.
Amylabel, using \verb|\ref|, is \ref{Amylabel}.
\href{http://www.example.com/}{Really want this to be a URL to
\texttt{http://www.example.com/\ref*{Amylabel}}}.
\def\DM{2}
\href{http://www.example.com/\DM}{I can use a def'd macro in href.}
\href{http://www.example.com/\ref*{Amylabel}}{But this line fails.}.
\end{document}
Code: Select all
! TeX capacity exceeded, sorry [input stack size=5000].
\@makeother #1->\catcode `#1
12\relax
l.16 \href{http://www.example.com/\ref*{Amylabel}}
{But this line fails.}.
! ==> Fatal error occurred, no output PDF file produced!
Thanks.