答案1
这非常简单pstricks
– 更准确地说是pst-node
:
\documentclass{article}
\usepackage{mathtools}
\usepackage{pst-node}
\usepackage{auto-pst-pdf}
\begin{document}
\[ \rnode{X1}{x^2}y + \rnode{XY}{3xy} + \rnode{X2}{2x} + \rnode{C}{6} \]%
\ncbar[nodesep=0.5ex, arm=1.5ex, angle=-90]{X1}{X2}
\ncbar[nodesepB=0.5ex, angle=-90]{XY}{C}
\end{document}
答案2
和tikzmark
:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\[
\tikzmarknode{A}{x}^2 y
+ 3\tikzmarknode{B}{x}y + 2\tikzmarknode{C}{x} + \tikzmarknode{D}{6}
%
\begin{tikzpicture}[overlay, remember picture,
every path/.style = {shorten <=1pt,shorten >=1pt}
]
\draw (A.south) -- ++ (0,-0.2) -| (C);
\draw (B.south) -- ++ (0,-0.4) -| (D);
\end{tikzpicture}
\]
\vspace{4mm} % space for tikzpicture
text text text text text text text text text text text text
\end{document}
经过两次编译你将得到:
答案3
拥有simpler-wick
和以下补丁你可以做
\documentclass[fleqn]{article}
\usepackage[sep=3pt,offset=0.5ex]{simpler-wick}
\newif\ifWickBelow
\WickBelowfalse
\pgfkeys{
/simplerwick/below/.code={\WickBelowtrue},
}
\makeatletter
\def\swick@end#1#2{
\swick@setfalse@#1
\tikzexternaldisable
\begin{tikzpicture}[remember picture, baseline=(swick-close#1.base)]
\node[use as bounding box, inner sep=0pt, outer sep=0pt] (swick-close#1) {$\displaystyle #2$};
\end{tikzpicture}
\tikz[remember picture, overlay]
{
\ifWickBelow
\draw ($(swick-open#1.south) + (0, -3pt)$)
-- ($(swick-open#1.base) + (0, -\swick@offset) + #1*(0, -\swick@sep)$)
-- ($(swick-close#1.base) + (0, -\swick@offset) + #1*(0, -\swick@sep)$)
-- ($(swick-close#1.south) + (0, -3pt)$);
\else
\draw ($(swick-open#1.north) + (0, 3pt)$)
-- ($(swick-open#1.base) + (0, \swick@offset) + #1*(0, \swick@sep)$)
-- ($(swick-close#1.base) + (0, \swick@offset) + #1*(0, \swick@sep)$)
-- ($(swick-close#1.north) + (0, 3pt)$);
\fi}
\tikzexternalenable}
\makeatother
\begin{document}
\[\wick[below]{x\c1{\widehat{~}}2 y+3\c2xy+2\c1 x+\c26}\]
\end{document}
有几种替代方法来做 Wick 收缩,例如这里。