# LaTeX Combined hyper reference and footnote lacks verbatim argument behaviour [duplicate]

Possible Duplicate:
Getting those %#!^& signs in the footnote!

Here's my first version of a clever command for URL-footnotes. It combines `pdftex`'s hyperlink behaviour with a `\footnote` displaying the URL.

``````\usepackage[pdftex]{hyperref}
\newcommand{\hrefn}[2]{\href{#1}{#2}\footnote{See {\tt #1}}} %HyperRef and Footnote in one
``````

However it doesn't treat the input as verbatim as `\href` does. How do I prevent my command `\hrefn` from treating characters such as `#` and `~` as special control characters? I already `\usepackage{underscore}` so `_` are not a problem.

/Nordlöw

-

## migrated from stackoverflow.comApr 12 '11 at 10:45

This question came from our site for professional and enthusiast programmers.

## marked as duplicate by Martin Scharrer♦Apr 12 '11 at 11:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Put a \ in front of the character you want to be preserved. –  alexy13 Apr 12 '11 at 10:34

## 1 Answer

The `url` package has a command `\urldef` which allows you to define robust verbatim URLs that can be used in footnotes.

Also, since you’re using LaTeX, you shouldn’t be using `\tt` – use `\ttfamily` or `\texttt` instead.

-
Great answer! Thanks! –  Nordlöw Apr 13 '11 at 6:46