GeneralHow can we make hyperlinks for footnote?

LaTeX specific issues not fitting into one of the other forums of this category.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

How can we make hyperlinks for footnote?

Post by Juanjo »

ggyyree wrote:how to change the color of the footmark now please?
Load hyperref with suitable options. For example,

Code: Select all

\usepackage[colorlinks,linkcolor=blue]{hyperref}
ggyyree wrote: I also met a problem that two footmarks need to be referred to the same footnote. How to do that please?
This can be solved, to my knowledge, if the two footmarks come one right after another. For example, to get

Image

you could write

Code: Select all

Text\footnote{Blah blah}. More text\footnote{Blah blah blah}. And even more text\SameFootnotemark.
where \SameFootnotemark is the command given by

Code: Select all

\newcommand{\SameFootnotemark}{\addtocounter{footnote}{-1}\addtocounter{Hfootnote}{-1}\footnotemark}
Add this definition to the preamble. What I'm unable to get is something like

Image

Do you see the difference? The last footmark is not equal to the preceding one, but the first one.

This kind of matters are hard. In fact, when reading the very complex code of hyperref, one realizes that \footnote, \footnotemark and \footnotetext are redefined without optional arguments.

Finally, to get the last table you mentioned, write

Code: Select all

\begin{center}
   \begin{tabular}{cccc}
      N &aaa &bbb &ccc\Footnotemark\\
      N &111\SameFootnotemark &222\Footnotemark &333
   \end{tabular}
\end{center}
\addtocounter{footnote}{-1}\Footnotetext{Test1}
\stepcounter{footnote}\Footnotetext{Test2}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

ggyyree
Posts: 21
Joined: Mon Sep 15, 2008 6:32 pm

How can we make hyperlinks for footnote?

Post by ggyyree »

Great work! Thanks a lot!!! :ugeek:
Juanjo wrote:
ggyyree wrote:how to change the color of the footmark now please?
Load hyperref with suitable options. For example,

Code: Select all

\usepackage[colorlinks,linkcolor=blue]{hyperref}
ggyyree wrote: I also met a problem that two footmarks need to be referred to the same footnote. How to do that please?
This can be solved, to my knowledge, if the two footmarks come one right after another. For example, to get

Image

you could write

Code: Select all

Text\footnote{Blah blah}. More text\footnote{Blah blah blah}. And even more text\SameFootnotemark.
where \SameFootnotemark is the command given by

Code: Select all

\newcommand{\SameFootnotemark}{\addtocounter{footnote}{-1}\addtocounter{Hfootnote}{-1}\footnotemark}
Add this definition to the preamble. What I'm unable to get is something like

Image

Do you see the difference? The last footmark is not equal to the preceding one, but the first one.

This kind of matters are hard. In fact, when reading the very complex code of hyperref, one realizes that \footnote, \footnotemark and \footnotetext are redefined without optional arguments.

Finally, to get the last table you mentioned, write

Code: Select all

\begin{center}
   \begin{tabular}{cccc}
      N &aaa &bbb &ccc\Footnotemark\\
      N &111\SameFootnotemark &222\Footnotemark &333
   \end{tabular}
\end{center}
\addtocounter{footnote}{-1}\Footnotetext{Test1}
\stepcounter{footnote}\Footnotetext{Test2}
abdullahkhilji
Posts: 1
Joined: Tue Nov 19, 2019 4:07 pm

How can we make hyperlinks for footnote?

Post by abdullahkhilji »

All footnotes package must be declared after loading `hyperref`, for the hyperlinks to work same goes for `bigfoot`.
When using `tabularx` alongwith with `hyperref`, load `tabularx` after `hyperref`.
I would suggest loading `tabularx` alongwith `hyperref` initially to avoid conflicts as `hyperref` needs to be applied throughout.
Post Reply