带有 tikz 方形箭头样式的 Overbracket

带有 tikz 方形箭头样式的 Overbracket

我试图将文本放在括号的右侧,以便它不与等式重叠。

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc}

\usepackage{amsmath}   

\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\tikzset{square arrow/.style={to path={-- ++(0,.25) -| (\tikztotarget)}}}

\begin{document}
\[
=\, -\nu_{gx}\,  \dfrac{\partial \, \left<\tikzmark{a}n\right>}{\partial\,x} \, =\, -\nu_{gx} \, \dfrac{\partial \left<\tikzmark{b}\eta_{0}\right>}{\partial \,x} \, \dfrac{\partial \,T}{\partial \,x}
\tikz[overlay,remember picture]
{\draw[<->,square arrow] ($(a.north)+(0.25em,1.25ex)$) to ($(b.north)+(0.50em,1.25ex)$) node [above,right] {local thermal equilibrium!};}
\]
\end{document}

在此处输入图片描述

答案1

需要调整两个端点的参数以适应尖括号内的字符的宽度:

在此处输入图片描述

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc}

\usepackage{amsmath}   

\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\tikzset{square arrow/.style={to path={-- ++(0,.25) -| (\tikztotarget)}}}

\begin{document}
\[
=\, -\nu_{gx}\,  \dfrac{\partial \, \left<\tikzmark{a}n\right>}{\partial\,x} \, =\, -\nu_{gx} \, \dfrac{\partial \left<\tikzmark{b}\eta_{0}\right>}{\partial \,x} \, \dfrac{\partial \,T}{\partial \,x}
\tikz[overlay,remember picture]{%
    \draw[<->,square arrow, red, thick] 
        ($(a.north)+(0.25em,0.30ex)$) to ($(b.north)+(0.50em,0.30ex)$) ;
    \node [above, yshift=1.50ex, blue] at  ($(a.north)!0.5!(b.north)$) {label};
    }
\]

\结束{文档}

答案2

你可能会误用chemmacros' 氧化还原命令:\OX{<name>,<text>}标记位置并\redox(<name1>,<name2>)连接它们:

\documentclass{amsart}
\usepackage{amsmath}   
\usepackage{chemmacros}

\begin{document}

\[
  =\, -\nu_{gx}\,  \dfrac{\partial \, \left<\OX{a,$n$}\right>}{\partial\,x} \,
  =\, -\nu_{gx} \, \dfrac{\partial \left<\OX{b,$\eta_{0}$}\right>}{\partial \,x} \, \dfrac{\partial \,T}{\partial \,x}
\]
\redox(a,b)[<->]{text over}
\end{document}

在此处输入图片描述

它有一些自定义选项:

\documentclass{amsart}
\usepackage{amsmath}   
\usepackage{chemmacros}

\begin{document}

\chemsetup[redox]{sep=1em,dist=1em}
\[
  =\, -\nu_{gx}\,  \dfrac{\partial \, \left<\OX{a,$n$}\right>}{\partial\,x} \,
  =\, -\nu_{gx} \, \dfrac{\partial \left<\OX{b,$\eta_{0}$}\right>}{\partial \,x} \, \dfrac{\partial \,T}{\partial \,x}
\]
\redox(a,b)[<->,draw=blue]{text over}
\end{document}

在此处输入图片描述

编辑:新要求:

\documentclass{amsart}
\usepackage{amsmath}   
\usepackage{chemmacros}

\begin{document}

\chemsetup[redox]{sep=1em,dist=1em}
\[
  =\, -\nu_{gx}\,  \dfrac{\partial \, \left<\OX{a,$n$}\right>}{\partial\,x} \,
  =\, -\nu_{gx} \, \dfrac{\partial \left<\OX{b,$\eta_{0}$}\right>}{\partial \,x} \, \dfrac{\partial \,T}{\partial \,x}
\]
\redox(a,b)[<->]
\tikz[remember picture,overlay] \draw (b.east) ++(0,.75) node[right] {local thermal equilibrium!};
\end{document}

在此处输入图片描述

相关内容