1

The following is what I have. I tried to draw braids using Latex following the braids package documentation. But I cannot find the tikz library braids.

\documentclass{amsart}
\usepackage{tikz,braids,pgfplots}
\usetikzlibrary{braids}


\begin{document}



\begin{center}
\begin{tikzpicture}
\pic[
rotate=90,
braid/.cd,
everystrand/.style={ultrathick},
strand1/.style={red},
strand2/.style={green},
strand3/.style={blue},
] {braid={s_1s_2^{−1}s_1s_2^{−1}s_1s_2^{−1}}};
\end{tikzpicture}
\end{center}



\end{document}
11
  • The old braids package has been reimplanted as a TikZ library. You should install it if your LaTeX distribution is not up to date.
    – SebGlav
    Oct 24, 2021 at 18:17
  • @SebGlav Thanks a lot. As shown in the code, I was trying to import the braids package from the tikzlibrary but resulted in the error. I am not sure how Latex distribution works. Also, if I tried the syntax \braid[number of strands = 2] (braid) s_1;, this works without \usetikzlibrary{braids}.
    – user174967
    Oct 24, 2021 at 18:31
  • What TeX distribution are you using? The tikz library version dates from 2019. Oct 24, 2021 at 19:05
  • @AndrewStacey I don't know about TeX distribution but I just searched it and ran pdflatex --version on my terminal. This is what I got: pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019) kpathsea version 6.3.1 Copyright 2019 Han The Thanh (pdfTeX) et al. There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and ... ...
    – user174967
    Oct 24, 2021 at 20:01
  • That looks like TeX Live 2019. I don't recall if the braids library made it into TL2019, but if not then you can download it from ctan. Though upgrading your distribution to TL2021 would be a good option instead. Oct 24, 2021 at 20:38

1 Answer 1

1

Compile with TL2020-2021

\documentclass{amsart}
\usepackage{tikz}
%\usepackage{braids} % https://ctan.org/pkg/braids?lang=en
\usetikzlibrary{braids}

\begin{document}

\begin{center}
\begin{tikzpicture}
\pic[
rotate=90,
braid/.cd,
every strand/.style={ultra thick}, %Note: <<== empty space
strand 1/.style={red}, %Note: <<== empty space
strand 2/.style={green}, %Note: <<== empty space
strand 3/.style={blue}, %Note: <<== empty space
] {braid={s_1 s_2^{-1} s_1 s_2^{-1} s_1 s_2^{-1}}}; %Note: dash for -1
\end{tikzpicture}
\end{center}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .