smimram / satex

String diagrams in LaTeX.
https://smimram.github.io/satex/
GNU General Public License v3.0
13 stars 3 forks source link

Label shifted upward when used inside tikzcd #3

Closed Leo-Schelstraete closed 4 months ago

Leo-Schelstraete commented 4 months ago

The label of a string diagram is slightly shifted upward when used inside a tikzcd environment:

main.pdf

image

The above was produced with the following MWE, with the command lines pdflatex main.tex > satex main.satex > pdflatex main.tex:

\documentclass{standalone}

\usepackage{tikz-cd}
\usepackage{satex}

\begin{document}
$\twocell{((1->1)["f"])}$
\begin{tikzcd}
  \twocell{((1->1)["f"])}
\end{tikzcd}
\end{document}
smimram commented 4 months ago

satex generates tikzpicture environments, so that your example is equivalent to

\begin{tikzcd}
  \begin{tikzpicture}[baseline=(current bounding box.center),yscale=-1,scale=0.5,every path/.style={join=round,cap=round},]
    \draw (0.000000,0.000000) -- (0.000000,0.500000);
    \draw (0.000000,0.500000) -- (0.000000,1.000000);
    \filldraw[fill=white] (0.000000,0.500000) ellipse (0.300000 and 0.300000);
    \draw (0.000000,0.500000) node[] {$\scriptstyle f$};
  \end{tikzpicture}
\end{tikzcd}

which produces the same result. I have to investigate whether there is a way of making this work. If you have ideas...

smimram commented 4 months ago

See https://tex.stackexchange.com/questions/483346/tikz-cd-nested-tikzpicture-wrong-center-anchor