Saturday, May 1, 2010

overlapping/embracing braces

I recently had trouble trying to tex this:



If you have some experience with latex you see the trouble with the overlapping here. It took a while and it's a load of patchwork, but it works beautifully.

\contraction{a_{n'} + \makebox[0pt][l]{$
\displaystyle{\cuntraction{\phantom{a_r(k) +
\overline\psi(x) \gamma^\mu \psi(x) A_\mu(x)}}}$}
a_r(k) + \overline\psi(x)} \gamma^\mu \makebox[0pt][l]
{$\displaystyle{\contraction{\phantom{\psi(x)
A_\mu(x) a^{+}_{n}}}}$} \psi(x) A_\mu(x) a^{+}_{n}
\ket{0}

It looks like this:


contraction was defined here and cuntraction is the same with an overbrace instead. To understand all ingredients review this pdf

The main idea is that makebox collapses the bounding box that latex uses to position items on a page without touching the content, so the under/overbrace will be displayed and dimensioned according to the lenght of its argument, which in turn won't be displayed because it's hidden via phantom. Since the bounding box is collapsed the following text will start as if there hadn't been any box.

PS:
I thought the above was complicated. Well i stand corrected, the following is plain ridiculous:

No comments:

Post a Comment