26

My document has several \href that I would like to be shown on the footnote. How can I do it?

1
32

I usually write something like this, so the entry is hyperlinked for onscreen reading but there's also a footnote to the URL for paper output.

\documentclass{article}
\usepackage{hyperref}
\newcommand\fnurl[2]{%
  \href{#2}{#1}\footnote{\url{#2}}%
}
\begin{document}
hello \fnurl{Google}{www.google.com}
\end{document}
2
  • 2
    Very useful! ... for people like me who want to replace the \href with the suggested \fnurl: The syntax of href is inversed, i.e. \href{#1}{#2}\footnote{\url{#1}} can be used with the typical \href{www.google.com}{Google} syntax – chris-sc Sep 13 '16 at 12:50
  • That href replacement didn't quite work, but this one from the duplicate question did: \let\oldhref\href\renewcommand{\href}[2]{\oldhref{#1}{#2}\footnote{\url{#1}}} – partofthething Dec 24 '18 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.