2

I'm trying to typeset the following (the part in green I'd like to add, but don't know how to:

enter image description here

Here's my sample code:

\documentclass{article}
\begin{document}
$$=F_j\underbrace{\frac{\partial G_j}{\partial x_i}}_{\substack{\text{derivative} \\ \text{acts} \\ \text{only} \\ \text{on} \: \vec G} }-F_j\frac{\partial G_j}{\partial a_j}$$
\end{document}

Any ideas?

Sebastiano
  • 54,118
alexqwx
  • 123

1 Answers1

3

You shouln't use $$ … $$, which is a plain TeX construction and can result in bad vertical spacing. Use \[ … \] instead.

Here is a solution using pst-node and must be compiled through LaTeX -> dvips -> pstopdf or XeLaTeX (auto-pst-pdf doesn't work here, for some reason). Also, I used the esvect package to have arrows above capital letters that have a more correct size (\overrightarrow is too large).

\documentclass[x11names]{article}
\usepackage{mathtools}
\usepackage[b]{esvect}
\usepackage{pst-node}

\begin{document}

\[%
 =\rnode{A}{F_j}\underbrace{\rnode{B}{\dfrac{∂ G_j}{∂ x_i}}}_{\mathclap{\substack{\text{derivative} \\ \text{acts only} \\ \text{on} \: \vv G}} }-F_j\frac{∂ G_j}{∂ a_j}
\ncbar[angleA=90, nodesep=3pt, arrows=<->, linecolor=DarkSeaGreen3]{A}{B}
\naput[labelsep =1pt]{\color{DarkSeaGreen3}\textsf{\scriptsize Scalar product}}
    \]%

\end{document} 

enter image description here

Bernard
  • 271,350