For complex drawings (circles, etc), you might need to go the tikz
road.
But for simple shading of elements, a regular \colorbox
should do, i.e.
\documentclass{article}
\usepackage{xcolor}
\newcommand{\highlight}[1]{%
\colorbox{red!50}{$\displaystyle#1$}}
\begin{document}
\begin{equation}
\mathbf{Y_{ij}} = \highlight{\beta_{0}} +\mathbf{ b_i} + \beta_1x_1 + \ldots + \beta_nx_n + \mathbf{\epsilon_{ij}}
\end{equation}
\end{document}
which yields
![highlight result](https://i.stack.imgur.com/3RT0w.png)
In case you want to do more than just highlight terms but are looking to explain the terms, I once wrote the following code for my master's thesis presentation:
\documentclass{article}
\usepackage{xcolor}
\newlength{\overwritelength}
\newlength{\minimumoverwritelength}
\setlength{\minimumoverwritelength}{1cm}
\newcommand{\overwrite}[3][red]{%
\settowidth{\overwritelength}{$#2$}%
\ifdim\overwritelength<\minimumoverwritelength%
\setlength{\overwritelength}{\minimumoverwritelength}\fi%
\stackrel
{%
\begin{minipage}{\overwritelength}%
\color{#1}\centering\small #3\\%
\rule{1pt}{9pt}%
\end{minipage}}
{\colorbox{#1!50}{\color{black}$\displaystyle#2$}}}
\begin{document}
\begin{equation}
\mathbf{Y_{ij}} = \overwrite{\beta_{0}}{very important!} +\mathbf{b_i} + \beta_1x_1 + \ldots + \beta_nx_n + \mathbf{\epsilon_{ij}}
\end{equation}
\end{document}
which this time yields:
![overwrite result](https://i.stack.imgur.com/yllqI.png)
You can even easily extend that code to fade the color from slide to slide and highlight one term at a time if you're using beamer
(just add a \temporal<+>
before the \stackrel
, duplicate the \stackrel
code three times and change the colors in each variant).
Here is a solution, with the \newtagform
, usetagform
commands from mathtools
. However, you can't use \eqref
nor \cref
for equations with footnotes.
\documentclass{article}
\usepackage{mathtools}
\newtagform{fn}{(}{)\footnotemark}
\begin{document}
\usetagform{fn}
\begin{equation}\label{eq1}
a=b
\end{equation}
\footnotetext{Some text. }
Equation (\ref{eq1}) is a good equation.
\usetagform{default}
\begin{equation}\label{eq2}
c = d
\end{equation}
\end{document}
![enter image description here](https://i.stack.imgur.com/ftN3z.png)
Best Answer
Something like this?
Addendum: If the text to the right of the
=
symbols can be quite lengthy, you may get line overflows. If that's the case, you could use\parbox[t]{5cm}{...}
instead of\text{...}
instructions, where5cm
is a stand-in of the width of the text boxes you want. I recommend setting the material in narrow-width text boxes\RaggedRight
rather than fully justified (which is the default); the latter can generate large interword gaps if the text box is narrow.