1

Sometimes some users use simplewick package to draw contractions above and below expressions. For my humble opinion it is a old package (into the guide there are double dollars ($$...$$) that I still don't understand how it works compared to simpler-wick package of Joshua Ellis. The latest is much simpler but I still don't understand (certainly because of my low level of understanding of the English language).

I didn't want to use Taichiro Kugo's alternative method that uses a wick.sty style that conflicts sometimes with amsmath.

The only thing I don't understand are the chains of many {} and them order. For example into the guide, pag. 1, there is:

$$
\contraction{}{A}{B}{C}
\contraction[2ex]{A}{B}{C}{D}
ABCD
$$

that gives

enter image description here

There are also the instruction into the guide that I have not understood:

  • The first (optional) argument is the height of the contraction. When omitted (as in the first contraction above) it defaults to 1ex,

  • the second argument contains the expression that lies before the contraction start,

  • the third argument contains the expression, above which the start of the contraction is centered,

  • the fourth argument is the part of the formula that is bridged by the contraction, and finally

  • the contraction ends above the center of the last argument of the macro.

How should the various quantities be joined together and is there an easier way to explain this guide?

For example I have this MWE:

\documentclass[a4paper,12pt]{article}
\usepackage{simplewick}
    \begin{document}
\begin{equation}
  \bcontraction{}{A}{B}{C}
  \bcontraction[2pt]{A}{B}{C}{D}
  ABCD
  \end{equation}
\end{document}

For example if I must glue A with C, because I not can write \bcontraction{}{A}{C} and similary \bcontraction[2pt]{B}{D} to glue B with D?

enter image description here

Sebastiano
  • 54,118
  • I suppose it never occurred to you to make that example into a MWE? – David Carlisle Jan 11 '20 at 22:56
  • @DavidCarlisle I wanted realized an answer for this question: tex.stackexchange.com/questions/523858/can-i-make-this-in-latex but the wick there are not centered on the exact monomial. I have done several attempts but after an hour, I had to leave everything. – Sebastiano Jan 12 '20 at 00:17
  • 2
    the instruction that you quoted shows there has to be four {} arguments. – David Carlisle Jan 12 '20 at 00:51

2 Answers2

1

You don't say what part you did not understand, I don't know the package but taking the text you posted:

  • the first bullet point: the first \contraction has no [] so it is set at some default height, the second has [2em] so it is set higher.

  • The second bullet: The first \contraction has {} so there is nothing before it so it. The second one has {A} so it starts after A

  • The third bullet: the first \contraction has {A} so the first (low) starts on A, the second one has {B} so the second higher one starts on B

  • The fourth bullet: the first \contraction has {B} so the first (low) line spans over B, the second one has {C} so the second higher one spans over C

  • the fifth bullet: the first \contraction has {C} so the first line ends at C, the second one has {D} so the second higher line ends at D.

David Carlisle
  • 757,742
1

I'm not quite sure what you really need explained, since the documentation seems fairly straightforward. The best way to understand it yourself might be to simply play with some examples and see what happens when you change stuff around. But here's a restatement of the example from the documentation.

\documentclass{article}
\usepackage{simplewick}
\begin{document}

\[
\contraction{}{A}{B}{C}
\contraction[2ex]{A}{B}{C}{D}
A B C D
\]

\end{document}

The output of this is:

output of code 1

Now let's see how the output matches the input. First, why do we have an empty {} for the ABC contraction?

Note that the documentation uses macro-writing terminology calling the optional argument the "first" argument. Of course this is correct from the macro definition point of view, but it's a bit confusing from the user point of view, so I will use a more user-oriented terminology and refer to only the obligatory arguments as "first", "second" etc., and simply call the optional argument the optional argument.

The answer is that the first obligatory argument of the command is the material that precedes and is not contained in the part the contraction connects. Since there is no material before the A in the expression, then the part "before" the A is simply {}.

The second argument is where the contraction will start. So in this example, it's B. The third argument is the part of the expression that the contraction will cover. The last argument is where the contraction should end, in this case C.

In the second contraction, the part of the expression before the contraction begins is A, so the first argument of the macro is A. As in other contraction, the second argument says where the contraction should start, in this case at B. The last argument says where it should end, in this case D.

Why can't I use a simpler syntax?

The syntax of the contraction macros is fixed, so you can't simplify them: you must supply the "before" context, the starting point, the middle and the ending point. To see why, consider the following example:

\documentclass{article}

\usepackage{simplewick}
\begin{document}

\[
\contraction{ABCDB}{A}{BABBAC}{B}
ABCDBABABBACBACB
\]
\end{document}

output of code 2

If you had a syntax that simply specified the "start" and "end" you would have no way to tell which which of the A's would be the correct place to start, and which of the B's in the example would be the correct ending. So the syntax can't be simpler for this reason. You need to specify not only the beginning and the end, but also the middle part.

Could there be a different syntax?

As I have mentioned elsewhere there are different ways to achieve the same effect. I would probably adapt the technique I use in this answer, which seems to be what people have done in the answers to this question:

Alan Munn
  • 218,180