Giter Club home page Giter Club logo

braids's Introduction

The braids Library

This is the official home of the development repository for the braids library. This library enables drawing of braid diagrams with PGF/TikZ using a simple syntax. The braid itself is specified by giving a word in the braid group, and there are many options for styling the strands and for drawing “floors”.

This library was previously published as a separate LaTeX package but since version 2.0, it has been reimplemented as a TikZ library. If starting with a fresh document, please consider using the new library instead.

The published version of this is available on CTAN, or wherever you get your LaTeX packages from (such as TeXLive).

Usage

To use this development version:

  • Download the files braids_code.dtx and braids.tex.
  • To generate the library files, run tex braids_code.dtx.
  • To generate the documentation, run pdflatex braids.tex.

The generated file tikzlibrarybraids.code.tex must be in the same directory with the tex file that uses this library. (Alternatively, specify some other way that tex uses this version of the library instead of the one included with your tex installation.)

Tests and Examples

The file braid_pic.tex in the tests directory contains many examples of using the library. To compile these examples, clone this repository or download that file and run the commands pdflatex tests/braid_pic.tex from the root directory of this repository.

braids's People

Contributors

caramdir avatar loopspace avatar nilesjohnson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

nilesjohnson

braids's Issues

Setting the braid height causes the braids to invert

As an example, here is s_1, without a height set.
\begin{center}
\begin{tikzpicture}
\pic[
braid/.cd,
%height = 1cm,
name prefix=braid,
] {braid={s_1}};
\end{tikzpicture}
\end{center}

by uncommenting out the height line, we get s_^{-1}.

Installation issue?

Hi Andrew!

I'm having problems getting your braids package to work for me. I have downloaded the package from CTAN

http://mirrors.ctan.org/graphics/pgf/contrib/braids.zip

unzipped it and entered the braids folder, run pdflatex braids_code.tex twice and then pdflatex braids.tex and I get the following error message

! Undefined control sequence.
...\l__braid_tmpb_tl }\str_case_e:nnTF
{\l__braid_tmpa_str }{{}{...
l.62 ...{17} s_2-s
{13}-s_{16} s_1-s_{12}-s_{15}}}
;

Could you help me figure out what's not working?

Thanks!
Paul

Annular braids

An annular braid is one that wraps round from one side to the next, so the first and last strands can cross.

First thoughts on implementation:

Allow for specifying a "first strand" and "last strand", then any strands beyond that are clipped out but can still be used in crossings, with strand styles wrapped so that strand 1 and strand n+1 have the same style, and something similar about crossings so that if strand 0 and strand 1 cross then so do strands n and n+1.

grandchainmb

Knots type cuts at crossings using the braids package

This is not an issue but a feature request.

Is it possible to have crossings of the type generated using the knots package for the braids package? By that I mean the following.

This is a crossing using the braids package.

Screenshot_20240117_101534

And this is a crossing using the knots package.

Screenshot_20240117_101502

The crossing using the knots package looks as if the upper strand has an invisible opaque tube surrounding it which covers the lower strand. The cuts to the lower strand are thus at an angle to the strand direction, while the cuts are always perpendicular to the lower strand in the braids package. I wanted to ask/request if there is a possibility of the knots type cuts in the braids package.

Missing character: There is no c in font nullfont!

There are some missing character warnings with the new tikz library. I know they can be ignored, but they make it harder to find all the other problems with my tex documents :/

Example input:

\documentclass{minimal}

\usepackage{tikz}
\usetikzlibrary{
  braids,
  arrows.meta
}

\begin{document}

\begin{tikzpicture}[ultra thick]
\pic[
  rotate=90,
  braid/.cd,
  strand 1/.style={red},
  height=1cm,
  width=1cm,
] (braid) at (1,2) {braid={s_1 s_2}};
\end{tikzpicture}

\end{document}

Output snippet:

[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
Missing character: There is no c in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no = in font nullfont!
[1] (./braid_pic.aux) )
Output written on braid_pic.pdf (1 page, 1341 bytes).

suggestions for documentation improvement

(continuing the discussion we started at #2, but as a separate issue)

Here are some more specific suggestions I had for the documentation of the tikz library. I could definitely do some of these, if you like (and others, with a little help explaining the parts I don't know). But I'm happy to defer to your judgement and let you handle them (or not) as you prefer.

  1. Section 2.2, line 4 mentions name prefix. Probably this should appear as one of the keys in the left margin, somewhere. It's not in the /tikz/braid/ namespace though, so maybe it should be listed before the 2.1 section break? (Update: oh, this is a general tikz thing that I didn't know about. Maybe a link to the tikz documentation for it?)
  2. Section 2.2, paragraph 2, the last sentence says "This node is not actually rendered, but its anchors can be used..." Do you mean the node doesn't really exist, or just that it's not drawn? What are some examples of the anchors that can be used? I expected something like \node at (braidname.south) {X}; to mark the bottom center of the braid, but it doesn't seem to work. I include name prefix=braidname, but I get Package pgf Error: No shape named 'braidname' is known.
  3. braid/.cd appears in the examples on page 6, but doesn't seem to be documented. (Update: after some testing, this appears to be a tikz change directory command!)
  4. page 3, in the last paragraph before item number 3, says "Replacing the floor pic will change how it is drawn". Does this mean one can draw floor shapes that are not rectangles? E.g., an oval?
  5. Related to the above, how can one draw a rectangular floor where only one of the edges is drawn? Is this possible?
  6. These explanations of braid/every floor and braid/floor <n> might be better placed on page 4, where those keys appear in the left margin. Then, the description in item number 2 on page 2 could be shortened with a reference to further details below.

I made a little example in this commit illustrating what I know about the above items, with several notes about how it might be improved. Here is a link to the pdf output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.