3

I want to represent a math formula as an figure instead of an equation.

My code:

\documentclass{article}
\usepackage{mathtools}% Loads amsmath
\begin{document}
\begin{equation}
    \underbrace{x\ .\ y}_\text{$S_{v}$}.
    \underbrace{z}_\text{(e)}
\end{equation}
\end{document}

enter image description here


wanted output:

enter image description here

alper
  • 1,389
  • 2
    Put $\underbrace{x\cdot y}_{S_{v}} \cdot \underbrace{z}_\text{(e)}$ inside a figure environment with a centering and a \caption{} . – Sigur Jan 22 '24 at 20:02
  • 2
    If your next question is "How do I get my equation figure to go where I want it", then see https://tex.stackexchange.com/a/8631/107497 – Teepeemm Jan 22 '24 at 21:22
  • You can get rid of the figure number with https://tex.stackexchange.com/a/339136/5283 . – Simd Jan 23 '24 at 12:12

3 Answers3

6

Despite the name, the figure environment can contain anything.

For instance an equation, a picture, some text, whatever.

\documentclass{article}
\usepackage{mathtools}% Loads amsmath

\usepackage{lipsum}

\begin{document}

\lipsum[1][1-4]

\begin{figure}[htp] [ \underbrace{x\cdot y}{S{v}\mathstrut}\cdot \underbrace{z\vphantom{y}}_{(\mathrm{e)}} ] \caption{My interesting equation}\label{mie}

\end{figure}

\lipsum[2]

\end{document}

Note the typesetting: multiplication is never a period; using \text{$...$} is very redundant.

enter image description here

egreg
  • 1,121,712
2
\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage{caption}

\DeclareCaptionType{figformula}[Figure][]
\begin{document}
\begin{figformula}[h]
  \begin{equation*}
   \underbrace{x\ .\ y}_\text{$S_{v}$}.
    \underbrace{z}_\text{(e)}
  \end{equation*}
\caption{My math formula.}
\end{figformula}

\end{document}

enter image description here

Sebastiano
  • 54,118
1

Using figure's environment:

\documentclass{article}
\usepackage{mathtools}% Loads amsmath
\begin{document}
\begin{figure}
\begin{equation}
    \underbrace{x\ .\ y}_\text{$S_{v}$}.
    \underbrace{z}_\text{(e)}\nonumber
\end{equation}
\caption{Like show in the figure}
\end{figure}
\end{document}
Darío
  • 449
  • 1
  • 6