我该如何排版这个:
(这是对推导中使用的折叠的解释)
编辑:
以下是公式和 XeLaTeX MWE 的代码:
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\begin{document}
\begin{equation}
\sum_{i,\,j,\,m,\,k} \!\!\!\! \left \langle C_i C_j C_m C_k \right \rangle =
3 \left ( \sum_{n,\,m}
\left \langle C_n^2 \right \rangle
\left \langle C_m^2 \right \rangle
\right )
+ \underbrace{\sum_i \left \langle C_i^4 \right \rangle}
\end{equation}
\end{document}
它给:
编辑2:
我用 pstricks 制作了它,但是我可以将这个方程式编号为常规方程式吗?
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{pstricks}
\usepackage{pstricks-add}
\begin{document}
\newcommand{\arcTwo}[2]{% first arg is a and size, second arg is b
\begin{pspicture}(-#1,-#1)(#1,#1)
% \psgrid[gridcolor=green,subgridcolor=yellow]
\psellipticarc(0,0)(#1,#2){0}{180}
\end{pspicture}}
\newcommand{\arcFour}[2]{% first arg is a and size, second arg is b
\begin{pspicture}(-#1,-#1)(#1,#1)
% \psgrid[gridcolor=green,subgridcolor=yellow]
\psellipticarc(0,0)(#1,#2){180}{360}
\end{pspicture}}
\begin{pspicture}(0,-1.2)(8.5,1.5)
% \psgrid[gridcolor=green,subgridcolor=yellow]
\rput(1.3,0.35){\arcTwo{.2}{.15}}
\rput(2.2,0.35){\arcTwo{.3}{.15}}
\rput(1.55,0.65){\arcTwo{.45}{.25}}
\rput(2.05,0.65){\arcTwo{.45}{.25}}
\rput(1.8,1.15){\arcTwo{.7}{.3}}
\rput(1.8,1.15){\arcTwo{.3}{.15}}
\psbrace[
braceWidthInner=1mm,
braceWidth=.5mm,
braceWidthOuter=1mm,
](2.6,0.35)(2.6,1.5){}
\psline[
linewidth=.3mm,
linearc=2mm,
]{->}(2.9,.93)(3.4,.93)(3.4,.3)
\rput(1.3,-0.15){\arcFour{.2}{.15}}
\rput(1.7,-0.15){\arcFour{.23}{.15}}
\rput(2.18,-0.15){\arcFour{.27}{.15}}
\psline[
linewidth=.3mm,
linearc=2mm,
]{->}(1.7,-0.4)(1.7,-1.1)(7.45,-1.1)(7.45,-0.8)
$\displaystyle
\sum_{i,\,j,\,m,\,k} \!\!\!\! \left \langle C_i C_j C_m C_k \right \rangle =
3 \left ( \sum_{n,\,m}
\left \langle C_n^2 \right \rangle
\left \langle C_m^2 \right \rangle
\right )
+ \underbrace{\sum_i \left \langle C_i^4 \right \rangle}
$
\end{pspicture}
\end{document}
给出:
编辑3:
由于某种奇怪的原因我
附上 Werner 的回答。我使用的是最新的 TeXLive 2014。这是我的文件列表。
答案1
您不必放置pspicture
环境即可使用pstricks
。相反,您应该使用节点连接并在方程式后指定连接类型:
\documentclass{article}
\usepackage{mathtools,lipsum}
\usepackage{pstricks,pstricks-add}
\psset{linewidth=.4pt}
\begin{document}
\lipsum[1]
\vspace{2\baselineskip}
\begin{equation}
\smashoperator[r]{\sum_{i, j, m, k}} \bigl\langle
\rnode{CiCjCmCk}{
\Rnode{Ci}{C_{\mathrlap{i}\vphantom{j}\phantom{m}}}
\Rnode{Cj}{C_{\mathrlap{j}\phantom{m}}}
\Rnode{Cm}{C_{m\vphantom{j}}}
\Rnode{Ck}{C_{\mathrlap{k}\vphantom{j}\phantom{m}}}} \bigr\rangle =
\Rnode{coeff}{3} \Bigl( \sum_{n,\,m}
\bigl\langle C_n^2 \bigr\rangle
\bigl\langle C_m^2 \bigr\rangle
\Bigr)
+ \Rnode{Ci4}{\underbrace{\sum_i \bigl\langle C_i^4 \bigr\rangle}}
\end{equation}
% Auxiliary nodes
\rput([nodesep=3pt,angle=-90]Ci){\pnode{lowC}}
\rput([nodesep=3pt,angle=90]Ci){\pnode{highC1}}
\rput([nodesep=10pt,angle=90]Ci){\pnode{highC2}}
\rput([nodesep=20pt,angle=90]Ci){\pnode{highC3}}
% Draw equation elements
{\psset{arcangle=-90}
\pcarc{-}(Ci|lowC)(Cj|lowC)
\pcarc{-}(Cj|lowC)(Cm|lowC)
\pcarc{-}(Cm|lowC)(Ck|lowC)
}
{\psset{arcangle=90}
\pcarc{-}(Ci|highC1)(Cj|highC1)
\pcarc{-}(Cm|highC1)(Ck|highC1)
\pcarc{-}(Ci|highC2)(Cm|highC2)
\pcarc{-}(Cj|highC2)(Ck|highC2)
\pcarc{-}(Ci|highC3)(Ck|highC3)
\pcarc{-}(Cj|highC3)(Cm|highC3)
}
\psbrace[
braceWidthInner=1mm,
braceWidth=.7pt,
braceWidthOuter=1mm,
]([nodesep=-3pt]Ck|highC1)([nodesep=-3pt]Ck|[nodesep=13pt,angle=90]highC3){\pnode(3pt,0){brTip}}
{\psset{linearc=2mm}
\pcangle[angleA=0,angleB=-90]{->}(brTip)([nodesep=3pt,angle=90]coeff)
\ncbar[nodesepA=10pt,nodesepB=3pt,angleA=-90,angleB=-90,arm=.5]{->}{CiCjCmCk}{Ci4}
}
\vspace{\baselineskip}
\lipsum[2]
\end{document}
\vspace
我在上面/下面添加了一些内容equation
,以便为连接提供一些空间(否则可能只是与文本主体重叠)。
答案2
另一种方法是使用该tikzmark
库:
\documentclass{article}
\usepackage{fontspec,kantlipsum,tikz}
\usetikzlibrary{tikzmark,calc,decorations.pathreplacing}
\begin{document}
\kant[1]
\vspace*{10ex}
\begin{equation}
\sum_{i,\,j,\,m,\,k} \!\!\!\! \left \langle \tikzmark{Ci} C_i \tikzmark{Cj} C_j \tikzmark{Cm} C_m \tikzmark{Ck} C_k \tikzmark{Cs} \right \rangle =
\tikzmark{3l} 3 \tikzmark{3r} \left ( \sum_{n,\,m}
\left \langle C_n^2 \right \rangle
\left \langle C_m^2 \right \rangle
\right )
+ \tikzmark{ul}\underbrace{\sum_i \left \langle C_i^4 \right \rangle}\tikzmark{ur}
\end{equation}
\begin{tikzpicture}[remember picture, overlay, thick]
\foreach \i in {Ci, Cj, Cm, Ck, Cs, 3l, 3r, ul, ur} \coordinate (\i) at ({pic cs:\i});
\foreach \i/\j in {i/j,j/m,m/k,k/s} \coordinate (C\i\j) at ($(C\i)!1/2!(C\j)$);
\foreach \i in {3,u} \coordinate (\i) at ($(\i l)!1/2!(\i r)$);
\foreach \i/\j/\k in {ij/jm/2.5ex, mk/ks/2.5ex, ij/mk/4ex, jm/ks/4ex, jm/mk/6.5ex, ij/ks/6.5ex} \draw ([yshift=\k]C\i) [out=95, in=85] to ([yshift=\k]C\j);
\foreach \i/\j/\k in {ij/jm/-.5ex, jm/mk/-.5ex, mk/ks/-.5ex} \draw ([yshift=\k]C\i) [out=-95, in=-85] to ([yshift=\k]C\j);
\draw [->, rounded corners=2pt] ([yshift=-2.5ex]Cm) -- +(0,-5ex) -| ([yshift=-5ex]u);
\draw [decorate, decoration=brace] ([yshift=9.5ex, xshift=2.5pt]Cs) coordinate (n2) -- ([yshift=2.25ex]Cs -| n2) coordinate [midway] (n3) coordinate (n4);
\draw [->, rounded corners=2pt] (n3) +(5pt,0) -| (3 |- n4);
\end{tikzpicture}
\vspace*{7.5ex}
\kant[2]
\end{document}