1

I have a long expression over many lines for which I want to insert a few Wick contractions. To be clear each wick contraction will stay on a single line but the whole expression is many. I find that as soon as I try insert a wick contraction in a split environment with more then one line I cannot get a wick contraction. I have tried simple wick and simpler-wick packages. I would like to get something like what I have below:

\documentclass{article}
\usepackage{simpler-wick}
\begin{document}    
\begin{equation}
\begin{split}
 \wick{AB & =CDEF \\ & = \c G HI \c J}
\end{split}
\end{equation}
\end{document}

Is this possible? Thanks

2
  • 2
    Please, edit your post to add all commands we need to compile. What is \wick?
    – Sigur
    Oct 20, 2018 at 13:59
  • 2
    It can never work when you hide the & from the split parser like that. I agree with Sigur, please post a full minimal example so we know what we are dealing with.
    – daleif
    Oct 20, 2018 at 14:13

2 Answers 2

1

Welcome to TeX.SE!

NOTE: Update your TeX distribution before you run the code below. If you are using TeXLive, the following should work. If you are using another TeX distribution, you may have to download the tikzmark library from here.

In the example you post, simpler-wick does work because you only do a contraction within one block. That is, you only need to move \wick to the block in which the both \c of your contractions are.

\documentclass{article}
\usepackage{simpler-wick}
\usetikzlibrary{tikzmark}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{split}
 \tikzmarknode{A}{A}B & =C\tikzmarknode{D}{D}EF \\ & = \wick{\c1G HI \c1J}
\end{split}
\begin{tikzpicture}[overlay,remember picture]
\draw ([yshift=2pt]A.north) -- ++(0,3pt) -| ([yshift=2pt]D.north);
\end{tikzpicture}
\end{equation}
\end{document}

enter image description here

It will always work as long as the contraction does not span over a & or a line break. Most of the contractions in the physics literature will hence work as they typically do not go over equality signs nor over two lines, but of course there may be situations where this is different. In this case, you may build your own. You are very lucky that the new version of the tikzmark library has just been uploaded to CTAN and is already in the TeXLive distribution. So, in order for this to work, you need to update your TeX distribution. Using \tikzmarknode you can draw the contraction in the fist line, which runs over a & sign.

1
  • Thanks so much! I was obviously just running into trouble with the & issue. Worked perfectly! Oct 21, 2018 at 17:00
1

For fun, it's very easy to do with only pst-node and auto-pst-pdf, without disturbing the equation layout:

\documentclass{article}
\usepackage{amsmath}
\usepackage{pst-node, auto-pst-pdf}

\begin{document}

\begin{postscript}
  \begin{equation}
    \begin{split}
     \Rnode{A}{A}B & =C\Rnode{D}{D}EF \\
     & = \psDefBoxNodes{GJ}{GHIJ}
    \end{split}
\end{equation}
\psset{linewidth=0.4pt, angle=90, arm=0.7ex, nodesep =1pt}
\ncbar{A}{D}
\ncbar[offsetA=-0.4em, offsetB=-0.15em]{GJ:tl}{GJ:tr}
\end{postscript}

\end{document} 

enter image description here

5
  • Is there a solution without auto-pst-pdf?
    – pzorba75
    Oct 20, 2018 at 17:01
  • I use it only to have to postscript environment, which works with split or aligned, whereas pspicture doesn't seem to work.
    – Bernard
    Oct 20, 2018 at 17:08
  • Since you are stressing that your solution does not distort the equation: this is also true for the tikzmark based proposal in my solution. Note, however, that this may be actually a problem if you have several contractions, please see the simpler-wick manual for examples that illustrate what I mean.
    – user121799
    Oct 21, 2018 at 3:13
  • @marmot: So the extra vertical spacing that I see in your solution solution comes from the simpler-wick package?
    – Bernard
    Oct 21, 2018 at 9:00
  • @Bernard I think so. It definitely does not come from the overlay/tikzmark combination.
    – user121799
    Oct 21, 2018 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .