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

hyperref problems: \url and \footnote

1,525 views
Skip to first unread message

Gabriel Zachmann

unread,
Oct 5, 2000, 3:00:00 AM10/5/00
to

I'm having two problems with hyperref vers 6.70f:
(teTexX=1.0 with new hyperref)


1.
\href{url}{text} inside a \footnote{} doesn't work.
The problem is caused by a # in url.
See below for an example.
The error message I get is
! Illegal parameter number in definition of \Hy@tempa.
<to be read again>
b
l.13 }
And this is the same with pdflatex and latex.


2.
If the URL inside a \url contains a #,
then this # gets rendered pretty funnily.
Again see below for an example.


Problem 1 is a real problem, problem 2 is just a bit annoying.


Any ideas what I could do?

Gab.

--
/---------------------------------------------------------------------\
| Paradigm is a word too often used by those |
| who would like to have a new idea |
| but cannot think of one. |
| (Mervyn King, Deputy Governor, Bank of England) |
| |
| za...@igd.fhg.de g...@gab.cx Gabriel....@gmx.net |
| www.igd.fhg.de/~zach/ www.gab.cx __@/' |
\---------------------------------------------------------------------/

Gabriel Zachmann

unread,
Oct 5, 2000, 3:00:00 AM10/5/00
to
I forgot to post my little sample file - here goes:

\documentclass{article}
\ifx\pdfoutput\undefined
\usepackage[dvips]{hyperref}
\else
\usepackage[pdftex]{hyperref}
\fi
\begin{document}
More plots can be found at
\url{http://www.igd.fhg.de/~zach/coldet/index.html#bbox-pipeline}
\footnote{
\href{http://www.igd.fhg.de/~zach/coldet/index.html#bbox-pipeline}{http://www.igd.fhg.de/~zach/coldet/index.html\#bbox-pipeline}
\\
}
\end{document}

Heiko Oberdiek

unread,
Oct 5, 2000, 3:00:00 AM10/5/00
to
za...@igd.fhg.de (Gabriel Zachmann) wrote:

>\href{url}{text} inside a \footnote{} doesn't work.
>The problem is caused by a # in url.

You have to protect # by \#, if you use \href
inside the argument of another command.

>If the URL inside a \url contains a #,
>then this # gets rendered pretty funnily.
>Again see below for an example.

I cannot see neither a problem with # nor an example.

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

Gabriel Zachmann

unread,
Oct 6, 2000, 3:00:00 AM10/6/00
to
On Thu, 05 Oct 2000 13:01:00 +0200, Heiko Oberdiek <ober...@ruf.uni-freiburg.de> wrote:
] za...@igd.fhg.de (Gabriel Zachmann) wrote:
]
] >\href{url}{text} inside a \footnote{} doesn't work.
] >The problem is caused by a # in url.
]
] You have to protect # by \#, if you use \href
] inside the argument of another command.

Thanks a lot.
(That's not in the doc, is it?
IIRC, it says in the doc specifically, that you don't need to escape
# in the URL-part of href ...)

]
] >If the URL inside a \url contains a #,


] >then this # gets rendered pretty funnily.
] >Again see below for an example.
]
] I cannot see neither a problem with # nor an example.

well, same trick applies here: one has to escape the #.

As for the example, see my second post; I'm sorry, I forgot to include it
with my first post. For your convenience, I'll include it (really) with
this post - see below.

Now I wish \href would automatically insert line breaks in href's like

\href{http://www.igd.fhg.de/~zach/coldet/index.html\#bbox-pipeline}{http://www.igd.fhg.de/~zach/coldet/index.html\#bbox-pipeline}

just like \url as of Donald Arseneau's url.sty did.

Do I really have to insert them manually?

Cheers,
Gab.


PS:
The example:
---- snip


\documentclass{article}
\ifx\pdfoutput\undefined
\usepackage[dvips]{hyperref}
\else
\usepackage[pdftex]{hyperref}
\fi
\begin{document}
More plots can be found at
More plots can be found at

\url{http://www.igd.fhg.de/~zach/coldet/index.html\#bbox-pipeline}
\footnote{
\href{http://www.igd.fhg.de/~zach/coldet/index.html\#bbox-pipeline}{http://www.igd.fhg.de/~zach/coldet/index.html\#bbox-pipeline}
}
\end{document}
---- snip

Heiko Oberdiek

unread,
Oct 6, 2000, 3:00:00 AM10/6/00
to
za...@igd.fhg.de (Gabriel Zachmann) wrote:

>On Thu, 05 Oct 2000 13:01:00 +0200, Heiko Oberdiek <ober...@ruf.uni-freiburg.de> wrote:
>] za...@igd.fhg.de (Gabriel Zachmann) wrote:
>]
>] >\href{url}{text} inside a \footnote{} doesn't work.
>] >The problem is caused by a # in url.
>]
>] You have to protect # by \#, if you use \href
>] inside the argument of another command.

Please use the normal quote character '>', not a funny
one ']'. It takes more time for reading. Because I do not
have to much time, I will ignore such postings.

>(That's not in the doc, is it?
>IIRC, it says in the doc specifically, that you don't need to escape
># in the URL-part of href ...)

#, %, ... are special characters in TeX. \footnote does not
know about the special treatment of these characters, if
a \href is used inside. For example each LaTeX documentation
will about the use of \verb inside arguments of other
commands.

\href{...}{\nolinkurl{...}}

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

Gabriel Zachmann

unread,
Oct 6, 2000, 3:00:00 AM10/6/00
to
On Fri, 06 Oct 2000 13:43:20 +0200, Heiko Oberdiek <ober...@ruf.uni-freiburg.de> wrote:
] za...@igd.fhg.de (Gabriel Zachmann) wrote:
]
] >On Thu, 05 Oct 2000 13:01:00 +0200, Heiko Oberdiek <ober...@ruf.uni-freiburg.de> wrote:
] >] za...@igd.fhg.de (Gabriel Zachmann) wrote:
] >]
] >] >\href{url}{text} inside a \footnote{} doesn't work.
] >] >The problem is caused by a # in url.
] >]
] >] You have to protect # by \#, if you use \href
] >] inside the argument of another command.
]
] Please use the normal quote character '>', not a funny
] one ']'. It takes more time for reading. Because I do not

ok, just for you; ;-)
although I don't have much time either, and I spent already way too much
time on getting this latex file typeset into pdf ...

]
] >Now I wish \href would automatically insert line breaks in href's like

cool.
wouldn't it make sense to put that in hyperref.sty?
like

\def\url@#1{\hyper@linkurl{\Hurl{#1}}{\nolinkurl{#1}}}

Gab.

0 new messages