I would like to display a small title for each equation on the left and right margins of a document like this
How to do it please?
The note in the margin can be added using the command \marginnote
from marginnote
, and the box around the equation can be added with the empheq
environment from empheq
.
\documentclass{article}
\usepackage{marginnote}
\usepackage{empheq}
\usepackage{xcolor}
\newcommand*{\bluebox}[1]{\fcolorbox{blue}{white}{#1}}
\reversemarginpar
\begin{document}
This equality implies that it makes sense to introduce the notion of the \emph{electric field} at point \(\mathbf{r}\) (as an entity independent of \(q\)), characterized by the following vector:
\begin{empheq}[box=\bluebox]{equation}
\marginnote{\color{blue}Electric field: definition}[-2mm]
\mathbf{E}(\mathbf{r}) \equiv \frac{\mathbf{F}(\mathbf{r})}{q},
\end{empheq}
formally called the \emph{electric field strength} -- but much more frequently, just the ``electric field''.
\end{document}
A combination of \boxed
(a macro provided by the amsmath
package) and \marginnote
(a macro provided by the marginnote
package) gets the job done.
\documentclass{article}
\usepackage{marginnote} % for '\marginnote' macro
\reversemarginpar
\usepackage{amsmath} % for '\boxed' macro
\usepackage{xcolor} % for '\color' macro
\begin{document}
This equality implies that it makes sense to define an \emph{electric field}
at a point~\(\mathbf{r}\), as an entity that is
independent of~\(q\), as:
\begin{equation}
\boxed{\mathbf{E}(\mathbf{r}) \equiv \frac{\mathbf{F}(\mathbf{r})}{q}\,.}
\marginnote{\color{blue}Electric field: definition}
\end{equation}
\(\mathbf{E}\) is formally called the \emph{electric field
strength} or, far more frequently, just the ``electric field.''
\end{document}