![TikZ 辫子包:绘制辫子图的闭合](https://linux22.com/image/458733/TikZ%20%E8%BE%AB%E5%AD%90%E5%8C%85%EF%BC%9A%E7%BB%98%E5%88%B6%E8%BE%AB%E5%AD%90%E5%9B%BE%E7%9A%84%E9%97%AD%E5%90%88.png)
我一直在使用辫子包(https://www.ctan.org/pkg/braids),但我不知道如何绘制图表的闭包,如下图左所示为一个示例。
目前我有右侧的图表,对应的是:
\documentclass{amsart}
\usepackage{tikz}
\usepackage{braids}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=1]
\braid[line width=2pt, nudge factor=-0.25, control factor=0.75, style strands={1}{red},
style strands={2}{blue},
style strands={3}{black}, style strands={4}{green}, style strands={5}{yellow}] (braid) at (0,0) s_1^{-1} s_3^{-1} s_1^{-1} s_4 s_2 s_4 s_2 s_4 s_1^{-1} s_3^{-1};
\draw[thick] (-0.3,0) -- (4.3,0);
\draw[thick] (-0.3,-10.5) -- (4.3,-10.5);
\end{tikzpicture}
\end{center}
\end{document}
我怎样才能画出这个图的闭合图?
答案1
手册中描述了坐标:
现在你可以连接两端,例如像这样:
\documentclass[tikz, border=1cm]{standalone}
\usepackage{braids}
\begin{document}
\begin{tikzpicture}
\braid[line width=2pt, nudge factor=-0.25, control factor=0.75, style strands={1}{red},
style strands={2}{blue},
style strands={3}{black}, style strands={4}{green}, style strands={5}{yellow}] (braid) at (0,0) s_1^{-1} s_3^{-1} s_1^{-1} s_4 s_2 s_4 s_2 s_4 s_1^{-1} s_3^{-1};
\draw[thick] (-0.3,0) -- (4.3,0);
\draw[thick] (-0.3,-10.5) -- (4.3,-10.5);
\draw[dotted] (braid-rev-3-s) -- ++(0,1) -- ++(1,0) |- ([shift=(south:1)]braid-rev-3-e) -- (braid-rev-3-e);
\end{tikzpicture}
\end{document}