2

In the MWE below, I wanted to get the formula to show up with underbraces and lines pointing to the text like this:

enter image description here

Here is my code:

\documentclass{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{mathptmx}
\usepackage{calc}

\begin{document}

\begin{equation}
  L_{\omega_{m}}=\frac{1}{8}\dfrac{FkT}{P_{s~av}}\dfrac{\omega_{o}^{2}}{\omega_{m}^{2}}\left(\dfrac{P_{in}}{\omega_{o}W_{e}}% 
  + \dfrac{1}{Q_{unl}}+\dfrac{P_{sig}}{\omega_{o}W_{e}} \right)^{2} \left(1 + \dfrac{\omega_{c}}{\omega_{m}} \right)
\end{equation}

\end{document} 
Joe
  • 9,080

1 Answers1

5

This can be done with the tikzmark library (compile the document two or three times for the elements to reach their final positions):

enter image description here

The code:

\documentclass{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{mathptmx}
\usepackage{calc}
\usepackage{tikz}
\usetikzlibrary{tikzmark,calc,decorations.pathreplacing}

\begin{document}

\begin{equation}
  L_{\omega_{m}}=\frac{1}{8}\dfrac{FkT}{\tikzmark{starta}P_{s~av}\tikzmark{enda}}\dfrac{\omega_{o}^{2}}{\omega_{m}^{2}}\left(\dfrac{P_{in}}{\tikzmark{startb}\omega_{o}W_{e}\tikzmark{endb}}% 
  + \dfrac{1}{\tikzmark{startc}Q_{unl}\tikzmark{endc}}+\dfrac{P_{sig}}{\tikzmark{startd}\omega_{o}W_{e}\tikzmark{endd}} \right)^{2} \left(1 + \dfrac{\omega_{c}}{\tikzmark{starte}\omega_{m}\tikzmark{ende}} \right)
\end{equation}

\begin{tikzpicture}[remember picture,overlay]
\foreach \Value/\Length/\Text in {%
  a/15pt/{Phase\\perturbation},%
  b/40pt/{Input power\\over\\reactive power},%
  c/20pt/{Resonator $Q$},%
  d/40pt/{Signal power\\over\\reactive power},%
  e/20pt/{Flicker\\effect}%
  }
{
\draw[decorate,decoration={brace,mirror,raise=5pt}]
  ({pic cs:start\Value}) -- coordinate (aux-\Value) ({pic cs:end\Value}|-{pic cs:start\Value});
\draw
  ([yshift=-7pt]aux-\Value) -- ++(0pt,-\Length)
  node[below,align=center] {\Text};  
}
\end{tikzpicture}

\end{document} 
Gonzalo Medina
  • 505,128