# How to define new equation counter in footnote?

I want to have two equation counter format for normal equations in text and in footnote as follows:

I think best way is to redefine footnote equations, but I don't know how do it. Any help would be greatly appreciated.

Thanks.

• Please give a use case for wanting to assign a number to a displayed equation in a footnote.
– Mico
Feb 15 '17 at 13:51
• \footnote is no environment and is this really useful, to hide 'important' equations in footnotes?
– user31729
Feb 15 '17 at 13:52
• for example F.thesection
– user108724
Feb 15 '17 at 13:54

## 1 Answer

I doubt the usefulness of a specific counter for equations in a footnote (or numbered equations in a footnote at all), but here's a quick hack, by hijacking the \footnote code and temporarily setting the \c@equation and \theequation macros to \c@footequation and \thefootequation, in a group.

\documentclass{article}

\usepackage{amsmath}

\usepackage{letltxmacro}

\usepackage{xparse}

\newcounter{footequation}[section]

\renewcommand{\thefootequation}{F.\arabic{footequation}}
\makeatletter
\LetLtxMacro\latex@@footnote\footnote
\RenewDocumentCommand{\footnote}{om}{%
\begingroup
\let\c@equation\c@footequation
\let\theequation\thefootequation
\IfValueTF{#1}{%
\latex@@footnote[#1]{#2}%
}{%
\latex@@footnote{#2}%
}%
\endgroup
}
\makeatother

\begin{document}
$$E=mc^{2} \label{foo}$$

See \eqref{footeq}

Some text\footnote{$$E=mc^{2}\label{footeq}$$}

$$c^{2}=a^{2} + b^{2} \label{pythagoras}$$

Some text\footnote{$$c^{2}=a^{2} + b^{2}\label{footpythagoras}$$}

\end{document}