I would like to define a command that puts a red box around an equation with yellow highlighting. I have the basics working pretty well. What I am unable to figure out is:
- How to keep the alignment of the equations on the equal sign.
Be able to have the alignment character within the call to highlight box. That is, I would really prefer to be able to say something like:
\highlightbox{g &= f}
instead of what I resorted to doing below.
Here is what I have so far:
\documentclass[11pt]{article}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\newcommand{\highlightbox}[1]{%
\setlength{\fboxrule}{6pt}\fcolorbox{red}{yellow}{#1}\quad%
}
\begin{document}
\begin{align*}
\highlightbox{a} &\highlightbox{= b} \\
c & = d \\
e & = f \\
\highlightbox{g} &\highlightbox{= f} \\
\end{align*}
\end{document}