# Typesetting ST-traces in LaTeX

An ST-trace is a string with additional back-reference arc or arrows which may cross. An example may be seen at page 13 of http://kilby.stanford.edu/~rvg/pub/STbisimulation.pdf

So, basically, this is a string like $a^+b^+c^+a^-b^-$, but with an arc or arrow, under or over, from the $a^-$ back to the $a^+$ and from the $b^-$ back to the $b^+$.

How on earth can I typeset this in LaTeX?

-

Here's a possibility with tikz-cd:

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}
$\begin{tikzcd}[column sep=.7em] b^+ \arrow[rrr,dash,bend left] & a^+ & a^+ \arrow[rrr,dash,bend left] & b^- & a^+ \arrow[rrr,dash,bend left] & a^- & b^+ & a^- \end{tikzcd}$
\end{document}


You can mark the “crossing over” with

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}
$\begin{tikzcd}[column sep=1.4em] b^+ \arrow[rrr,dash,bend left=40] & a^+ & a^+ \arrow[rrr,dash,bend left=40,crossing over] & b^- & a^+ \arrow[rrr,dash,bend left=40,crossing over] & a^- & b^+ & a^- \end{tikzcd}$
\end{document}


-

A solution with pstricks, and more sprifically with the psmatrix environment of pdt-node. With the pdf option, it can be compiled with pdflatex provided you set the --enable-shellescape switch, or __enable-write18 for MiKTeX:

\documentclass[12pt, pdf]{standalone}%

\usepackage{pst-node}

\begin{document}

$\psset{arcangle = 45} \begin{psmatrix}[nodesep =3pt,colsep = 2em, arcangle = 30] [name = a0] a^+ & [name = b0] b^+ & c^+ & [name = a1] a^- & [name = b1]b^- \ncarc{a0}{a1} \ncarc[border = 1pt, bordercolor = white]{b0}{b1} \end{psmatrix}$

\end{document}


-