Change the color of footnote marker in LaTeX
It all depends on exactly what do you want to colorize since there are three possible elements involved: 1) the mark used in the text to signal the footnote, 2) the mark used at the bottom of the page where the actual footnote text appears, and (possibly) 3) the mark used when cross-referencing the footnote. In the following examples I used the color red
just to highlight the different results:
A redefinition of \thefootnote
(like some other answers suggest) will affect all these three elements:
\documentclass{article}
\usepackage[paperheight=3cm]{geometry}% just for the example
\usepackage{xcolor}
\renewcommand\thefootnote{\textcolor{red}{\arabic{footnote}}}
\begin{document}
PHP, Java, C\footnote{\label{a}It has been many years since I've used this in a project}, Python
As was mentioned in~\ref{a}
\end{document}
If one only wants to change color to elements 1) and 2) (the marks in the body and in the actual footnote text) but not to 3) (the number used in cross-references), then a redefinition of \@makefnmark
will be needed:
\documentclass{article}
\usepackage[paperheight=3cm]{geometry}% just for the example
\usepackage{xcolor}
\makeatletter
\renewcommand\@makefnmark{\hbox{\@textsuperscript{\normalfont\color{red}\@thefnmark}}}
\makeatother
\begin{document}
PHP, Java, C\footnote{\label{a}It has been many years since I've used this in a project}, Python
As was mentioned in~\ref{a}
\end{document}
Finally, if the change of color must affect only the mark used in the body of the document without affecting the mark used in the footnote text or the number used in cross-references, then redefinitions of \@makefnmark
, and \@makefntext
will be needed:
\documentclass{article}
\usepackage[paperheight=3cm]{geometry}% just for the example
\usepackage{xcolor}
\makeatletter
\renewcommand\@makefnmark{\hbox{\@textsuperscript{\normalfont\color{red}\@thefnmark}}}
\renewcommand\@makefntext[1]{%
\parindent 1em\noindent
\hb@[email protected]{%
\hss\@textsuperscript{\normalfont\@thefnmark}}#1}
\makeatother
\begin{document}
PHP, Java, C\footnote{\label{a}It has been many years since I've used this in a project}, Python
As was mentioned in~\ref{a}
\end{document}
Another possibility is:
C{\color{Gray}\footnote{TextOfTheFootnote}}
In preamble:
\usepackage[usenames,dvipsnames]{color}
\renewcommand{\thefootnote}{\textcolor{Gray}{\arabic{footnote}}}