0

I wish to create a box within an equation environment, which I can then label. The idea is to emphasize certain portions of the equation and interpret what these parts are doing for me. Ideally, I'll be able to label underneath the boxed region.

Here's an example of where I'm at right now. I can create boxes via a number of methods, but I can't figure out a way to label them:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation}
A = \boxed{B} + \boxed{C + D} + E + F
\end{equation}

label for B: asdf

label for C+D: fdsa

\end{document}

In this example, I'd like asdf to show up underneath the box around B, and fdsa underneath the box around C+D.

Is this something that is possible to do, and if so how? Thanks!

Note: If it matters, I plan to use this in a beamer presentation, although my example above is in an article doc type - I imagine the method for solving my problem is independent of doc type.

  • Welcome to TeX.SX! Have you seen the tcolorbox package? It provides ways to highlight equations and parts. – TeXnician Nov 30 '17 at 18:38
1

For example, \underset is your friend:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation}
A = \underset{\text{asdf}}{\boxed{B}}
  + \underset{\text{fdsa}}{\boxed{C + D}}
  + E + F
\end{equation}

\end{document}

Result

  • I also found that using the \substack environment allows me to split text into multiple lines for the labels. – amquack Nov 30 '17 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.