將箭頭放在文字上方

將箭頭放在文字上方

我正在嘗試排版以下內容(我想添加的綠色部分,但不知道如何:

在此輸入影像描述

這是我的範例程式碼:

\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}

有任何想法嗎?

答案1

您不應該使用 $$ … $$,這是一個普通的 TeX 結構,可能會導致錯誤的垂直間距。代替使用\[ … \]

這是一個使用and 必須透過orpst-node編譯的解決方案(由於某種原因在這裡不起作用)。另外,我使用該包在大寫字母上方設置了尺寸更正確的箭頭(\overrightarrow 太大)。LaTeX -> dvips -> pstopdfXeLaTeXauto-pst-pdfesvect

\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} 

在此輸入影像描述

相關內容