I want to vertically align a TikZ image inside angled brackets. I am not able to do it by adding yshift arguments to the knot environment or to the \draw or \strand commands.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes, decorations, arrows.meta, decorations.markings, bending, knots, hobby, spath3, intersections}
\newcommand{\KP}[1]{%
\begin{tikzpicture}[baseline=-\dimexpr\fontdimen22\textfont2\relax]
#1
\end{tikzpicture}%
}
\newcommand{\KPthirtyoneone}{
\KP{
\begin{knot}[flip crossing=2, consider self intersections = true, clip width = 5, ignore endpoint intersections=false]
\draw[scale=0.6, line width=0.6pt] (0,1) .. controls (0.5,0.8) .. (1,1);
\strand[scale=0.6, line width=0.6pt, looseness=1.4] (0,0) to [out=0,in=0] (0.5,0.7) to [out=180,in=180] (1,0);
\end{knot}
}
}
\begin{document}
[\Bigl\langle\hspace{-6pt}\vcenter{\hbox{\KPthirtyoneone}}\hspace{-6pt}\Bigr\rangle]
\end{document}
I have taken some of the code from https://tex.stackexchange.com/a/306010/128462. It produces the following output:
How do I vertically center the image inside the brackets?



ignore endpoint intersections = falsebecause it adds space to the picture that's unwanted. If it wasn't, I'd proposebaseline={([yshift=+-\fontdimen22\textfont2]current bounding box)}}. – Qrrbrbirlbel Apr 29 '23 at 12:33clip width=5probably isn't helping with that. – Andrew Stacey May 02 '23 at 19:00yshiftdoesn't appear to have an effect is because that only shifts the path relative to the internal coordinates of the picture. It does nothing to how TeX sees the picture from the outside, which is what matters for vertical alignment. – Andrew Stacey May 02 '23 at 19:02