summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/strands
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-07-12 20:14:47 +0000
committerKarl Berry <karl@freefriends.org>2021-07-12 20:14:47 +0000
commitec2b3004e91ead1481b5eb814459a8a6e44d831a (patch)
treeb0e795ecbe743101d86602e32041f6feddcc884c /Master/texmf-dist/tex/latex/strands
parent1aa0f73c97d23bde5c70e0a8c58a0ec5f4e4b1b6 (diff)
strands (12jul21)
git-svn-id: svn://tug.org/texlive/trunk@59906 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/strands')
-rw-r--r--Master/texmf-dist/tex/latex/strands/strands.sty117
1 files changed, 103 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/strands/strands.sty b/Master/texmf-dist/tex/latex/strands/strands.sty
index b82941397ee..2051db360ca 100644
--- a/Master/texmf-dist/tex/latex/strands/strands.sty
+++ b/Master/texmf-dist/tex/latex/strands/strands.sty
@@ -9,31 +9,39 @@
%% This is a generated file.
%%
%% Copyright (C) 2021 by Diego Arcis <arcisd@gmail.com>
-%% --------------------------------------------------------------------------
-%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
+%% --------------------------------------------------------------------
+%% This work may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3 of this license
+%% or (at your option) any later version.
+%%
+%% The latest version of this license is in:
%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
%%
-\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{strands}
- [<+date+> <+version+> <+description+>]
+%% and version 1.3 or later is part of all distributions of LaTeX, that
+%% is, version 2005/12/01 or later.
+%%
+%% The Current Maintainer of this work is Diego Arcis.
+%%
+%% This work consists of the files strands.dtx and strands.ins and they
+%% derive the filebase strands.sty.
+%% --------------------------------------------------------------------
+%%
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\ProvidesPackage{strands}[2021/07/11 v1.1 Strands]
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{strands}[Diego Arcis 2021/07/05 Strands v1.0]
\RequirePackage{forarray}
\RequirePackage{ifthen}
\RequirePackage{tikz}
\RequirePackage{xfp}
\RequirePackage{xstring}
\RequirePackage{xkeyval}
+
\usetikzlibrary{snakes}
+
\newcommand{\getelem}[3]{ % \getelem{list}{index}{\name}
\StrBetween[#2,\fpeval{#2+1}]{,#1,}{,}{,}[#3]
}
+
\makeatletter
\define@cmdkey[str]{strands}{backcolor}{}
\define@cmdkey[str]{strands}{bend}{}
@@ -81,6 +89,7 @@
\define@cmdkey[str]{strands}{timeswidth}{}
\define@cmdkey[str]{strands}{tkzpic}{}
\define@cmdkey[str]{strands}{width}{}
+
\presetkeys[str]{strands}{
backcolor=white, % color of the paper.
bend=45, % bend of partitions.
@@ -129,7 +138,9 @@ timeswidth=3,
tkzpic=1,
width=0.6, % to set the width between strands.
}{}
+
\setkeys[str]{strands}{}
+
\DeclareOptionX{backcolor}{\renewcommand{\cmdstr@strands@backcolor}{#1}}
\DeclareOptionX{bend}{\renewcommand{\cmdstr@strands@bend}{#1}}
\DeclareOptionX{bendbraid}{\renewcommand{\cmdstr@strands@bendbraid}{#1}}
@@ -172,10 +183,13 @@ width=0.6, % to set the width between strands.
\DeclareOptionX{width}{\renewcommand{\cmdstr@strands@width}{#1}}
\DeclareOptionX*{\PackageWarning{strands}{`\CurrentOption' ignored}} % ignore unknown options.
\ProcessOptionsX\relax
+
\ifnum\cmdstr@strands@externalize=1
\usetikzlibrary{external}
\tikzexternalize[optimize=false,prefix=strpack]
\fi
+
+
\makeatletter
\define@cmdkey[str]{decor}{bulla}{}
\define@cmdkey[str]{decor}{bullb}{}
@@ -188,6 +202,7 @@ width=0.6, % to set the width between strands.
\define@cmdkey[str]{decor}{nstr}{}
\define@cmdkey[str]{decor}{type}{}
\define@cmdkey[str]{decor}{width}{}
+
\presetkeys[str]{decor}{
bulla=1,
bullb=1,
@@ -201,6 +216,7 @@ nstr=\cmdstr@strands@nstr,
type=3,
width=\cmdstr@strands@width
}{}
+
\newcommand{\decoratestrands}[1][]{
\setkeys[str]{decor}{#1} % set variables.
\foreach\ind in{0,...,\fpeval{\cmdstr@decor@nstr-1}}{
@@ -252,6 +268,11 @@ width=\cmdstr@strands@width
\fi
}
}
+
+
+
+
+
\makeatletter
\define@cmdkey[str]{vvpart}{bend}{}
\define@cmdkey[str]{vvpart}{bulla}{}
@@ -270,6 +291,7 @@ width=\cmdstr@strands@width
\define@cmdkey[str]{vvpart}{strwidth}{}
\define@cmdkey[str]{vvpart}{type}{}
\define@cmdkey[str]{vvpart}{width}{}
+
\presetkeys[str]{vvpart}{
bend=\cmdstr@strands@bend,
bulla=1,
@@ -289,6 +311,7 @@ strwidth=\cmdstr@strands@strwidth,
type=3,
width=\cmdstr@strands@width
}{}
+
\newcommand{\vvpartition}[2][]{
\setkeys[str]{vvpart}{#1} % set variables.
\node[\cmdstr@strands@normcolor]at(0,\cmdstr@vvpart@norma){\cmdstr@strands@normsymbol};
@@ -354,6 +377,7 @@ abs(abs(\secbul)-abs(\firbul)))*\cmdstr@vvpart@bend}
}\fi
}\fi
}
+
\makeatletter
\define@cmdkey[str]{vpart}{bend}{}
\define@cmdkey[str]{vpart}{bulla}{}
@@ -375,6 +399,7 @@ abs(abs(\secbul)-abs(\firbul)))*\cmdstr@vvpart@bend}
\define@cmdkey[str]{vpart}{tkzpic}{}
\define@cmdkey[str]{vpart}{type}{}
\define@cmdkey[str]{vpart}{width}{}
+
\presetkeys[str]{vpart}{
bend=\cmdstr@strands@bend,
bulla=1,
@@ -397,6 +422,7 @@ tkzpic=\cmdstr@strands@tkzpic,
type=3,
width=\cmdstr@strands@width
}{}
+
\newcommand{\vpartition}[2][]{
\setkeys[str]{vpart}{#1} % set variables.
\ifthenelse{\equal{\cmdstr@vpart@tkzpic}{1}}{
@@ -443,6 +469,11 @@ width=\cmdstr@vpart@width
]{#2}
}
}
+
+
+
+
+
\makeatletter
\define@cmdkey[str]{apart}{bend}{}
\define@cmdkey[str]{apart}{bull}{}
@@ -460,6 +491,7 @@ width=\cmdstr@vpart@width
\define@cmdkey[str]{apart}{tkzpic}{}
\define@cmdkey[str]{apart}{type}{}
\define@cmdkey[str]{apart}{width}{}
+
\presetkeys[str]{apart}{
bend=\cmdstr@strands@bend,
bull=1,
@@ -478,6 +510,7 @@ tkzpic=\cmdstr@strands@tkzpic,
type=1,
width=\cmdstr@strands@width
}{}
+
\newcommand{\arcpartition}[2][]{
\setkeys[str]{apart}{#1}
\vpartition[
@@ -501,6 +534,11 @@ type=-\cmdstr@apart@type,
width=\cmdstr@apart@width
]{#2}
}
+
+
+
+
+
\makeatletter
\define@cmdkey[str]{perm}{bulla}{}
\define@cmdkey[str]{perm}{bullb}{}
@@ -519,6 +557,7 @@ width=\cmdstr@apart@width
\define@cmdkey[str]{perm}{tkzpic}{}
\define@cmdkey[str]{perm}{type}{}
\define@cmdkey[str]{perm}{width}{}
+
\presetkeys[str]{perm}{
bulla=1,
bullb=1,
@@ -538,6 +577,7 @@ tkzpic=\cmdstr@strands@tkzpic,
type=2,
width=\cmdstr@strands@width
}{}
+
\newcommand{\permutation}[2][]{
\setkeys[str]{perm}{#1}
\vpartition[
@@ -561,6 +601,11 @@ type=\cmdstr@perm@type,
width=\cmdstr@perm@width
]{#2}
}
+
+
+
+
+
\makeatletter
\define@cmdkey[str]{tpair}{above}{}
\define@cmdkey[str]{tpair}{bend}{}
@@ -581,6 +626,7 @@ width=\cmdstr@perm@width
\define@cmdkey[str]{tpair}{tkzpic}{}
\define@cmdkey[str]{tpair}{type}{}
\define@cmdkey[str]{tpair}{width}{}
+
\presetkeys[str]{tpair}{
above=1,
bend=\cmdstr@strands@bend,
@@ -602,6 +648,7 @@ tkzpic=\cmdstr@strands@tkzpic,
type=-1,
width=\cmdstr@strands@width
}{}
+
\newcommand{\tiedpair}[3][]{
\setkeys[str]{tpair}{#1}
\ifthenelse{\equal{\cmdstr@tpair@tkzpic}{1}}{
@@ -663,6 +710,9 @@ width=\cmdstr@tpair@width
]{#3}
}
}
+
+
+
\makeatletter
\define@cmdkey[str]{tie}{bend}{}
\define@cmdkey[str]{tie}{bull}{}
@@ -678,6 +728,7 @@ width=\cmdstr@tpair@width
\define@cmdkey[str]{tie}{tieheight}{}
\define@cmdkey[str]{tie}{tiewidth}{}
\define@cmdkey[str]{tie}{width}{}
+
\presetkeys[str]{tie}{
bend=\cmdstr@strands@tiebend, % bend of the ties.
bull=1, % use 1 to use bullets, 0 otherwise.
@@ -694,6 +745,7 @@ tieheight=\cmdstr@strands@tieheight, % height of the tie respect to the global h
tiewidth=\cmdstr@strands@tiewidth, % width of the tie line.
width=\cmdstr@strands@width % width between strands.
}{}
+
\newcommand{\tie}[2][]{
\setkeys[str]{tie}{#1}
\foreach\elem[count=\ind]in{#2}{
@@ -735,6 +787,8 @@ style=\cmdstr@tie@style
\fi
}
}
+
+
\makeatletter
\define@cmdkey[str]{bbackstr}{cdnx}{}
\define@cmdkey[str]{bbackstr}{cdny}{}
@@ -743,6 +797,7 @@ style=\cmdstr@tie@style
\define@cmdkey[str]{bbackstr}{strwidth}{}
\define@cmdkey[str]{bbackstr}{timeswidth}{}
\define@cmdkey[str]{bbackstr}{width}{}
+
\presetkeys[str]{bbackstr}{
cdnx=nothing,
cdny=nothing,
@@ -751,6 +806,7 @@ strwidth=\cmdstr@strands@strwidth,
timeswidth=\cmdstr@strands@timeswidth, % times the width of the back line is bigger.
width=\cmdstr@strands@width
}{}
+
\newcommand{\bbackstrands}[1][]{ %
\setkeys[str]{bbackstr}{#1}
\draw[
@@ -765,6 +821,8 @@ line width=\fpeval{\cmdstr@bbackstr@timeswidth*\cmdstr@bbackstr@strwidth}pt
to(\fpeval{\cmdstr@bbackstr@cdnx+\cmdstr@bbackstr@width},
\fpeval{\cmdstr@bbackstr@cdny-\cmdstr@bbackstr@height});
}
+
+
\makeatletter
\define@cmdkey[str]{lleftstr}{bend}{}
\define@cmdkey[str]{lleftstr}{cdnx}{}
@@ -773,6 +831,7 @@ to(\fpeval{\cmdstr@bbackstr@cdnx+\cmdstr@bbackstr@width},
\define@cmdkey[str]{lleftstr}{height}{}
\define@cmdkey[str]{lleftstr}{strwidth}{}
\define@cmdkey[str]{lleftstr}{width}{}
+
\presetkeys[str]{lleftstr}{
bend=\cmdstr@strands@bendbraid,
cdnx=nothing,
@@ -782,6 +841,7 @@ height=\cmdstr@strands@height,
strwidth=\cmdstr@strands@strwidth,
width=\cmdstr@strands@width
}{}
+
\newcommand{\lleftstrand}[1][]{
\setkeys[str]{lleftstr}{#1}
\draw[
@@ -795,6 +855,8 @@ to[bend left=\cmdstr@lleftstr@bend]
(\fpeval{\cmdstr@lleftstr@cdnx+\cmdstr@lleftstr@width},
\fpeval{\cmdstr@lleftstr@cdny-\cmdstr@lleftstr@height-\cmdstr@strands@coverunion});
}
+
+
\makeatletter
\define@cmdkey[str]{rrightstr}{bend}{}
\define@cmdkey[str]{rrightstr}{cdnx}{}
@@ -804,6 +866,7 @@ to[bend left=\cmdstr@lleftstr@bend]
\define@cmdkey[str]{rrightstr}{height}{}
\define@cmdkey[str]{rrightstr}{strwidth}{}
\define@cmdkey[str]{rrightstr}{width}{}
+
\presetkeys[str]{rrightstr}{
bend=\cmdstr@strands@bendbraid,
cdnx=nothing,
@@ -814,6 +877,7 @@ height=\cmdstr@strands@height,
strwidth=\cmdstr@strands@strwidth,
width=\cmdstr@strands@width
}{}
+
\newcommand{\rrightstrand}[1][]{ % color / init-x-coordinate / init-y-coordinate.
\setkeys[str]{rrightstr}{#1}
\draw[
@@ -828,17 +892,21 @@ to[bend right=\cmdstr@rrightstr@bend]
(\cmdstr@rrightstr@cdnx,
\fpeval{\cmdstr@rrightstr@cdny-\cmdstr@rrightstr@height-\cmdstr@strands@coverunion});
}
+
+
\makeatletter
\define@cmdkey[str]{ccrossback}{cdnx}{}
\define@cmdkey[str]{ccrossback}{cdny}{}
\define@cmdkey[str]{ccrossback}{height}{}
\define@cmdkey[str]{ccrossback}{width}{}
+
\presetkeys[str]{ccrossback}{
cdnx=nothing,
cdny=nothing,
height=\cmdstr@strands@height,
width=\cmdstr@strands@width
}{}
+
\newcommand{\ccrossback}[1][]{
\setkeys[str]{ccrossback}{#1}
\filldraw[\cmdstr@strands@backcolor]
@@ -846,6 +914,8 @@ width=\cmdstr@strands@width
\fpeval{\cmdstr@ccrossback@cdny-\cmdstr@ccrossback@height/2})
circle(\cmdstr@strands@braidcross pt);
}
+
+
\makeatletter
\define@cmdkey[str]{bbraidgen}{bend}{}
\define@cmdkey[str]{bbraidgen}{cdnx}{}
@@ -858,6 +928,7 @@ circle(\cmdstr@strands@braidcross pt);
\define@cmdkey[str]{bbraidgen}{strwidth}{}
\define@cmdkey[str]{bbraidgen}{type}{}
\define@cmdkey[str]{bbraidgen}{width}{}
+
\presetkeys[str]{bbraidgen}{
bend=\cmdstr@strands@bendbraid,
cdnx=0,
@@ -871,6 +942,7 @@ strwidth=\cmdstr@strands@strwidth,
type=1, % negative-braid=-1 | positive-braid=1 | virtual-braid=2 | singular-braid=3
width=\cmdstr@strands@width
}{}
+
\tikzset{
cross/.style={ % node style to draw x--crosses inside nodes.
path picture={
@@ -882,6 +954,7 @@ path picture={
}
}
}
+
\newcommand{\bbraidgen}[1][]{
\setkeys[str]{bbraidgen}{#1}
\bbackstrands[ % trivial two-strands-braid.
@@ -966,6 +1039,8 @@ circle(\cmdstr@strands@braidsingcross pt);
\fi
\fi
}
+
+
\makeatletter
\define@cmdkey[str]{ttanglegen}{bend}{}
\define@cmdkey[str]{ttanglegen}{cdnx}{}
@@ -982,6 +1057,7 @@ circle(\cmdstr@strands@braidsingcross pt);
\define@cmdkey[str]{ttanglegen}{tiestyle}{}
\define@cmdkey[str]{ttanglegen}{tiewidth}{}
\define@cmdkey[str]{ttanglegen}{width}{}
+
\presetkeys[str]{ttanglegen}{
bend=\cmdstr@strands@bendtangle,
cdnx=0,
@@ -999,6 +1075,7 @@ tiestyle=\cmdstr@strands@tiestyle,
tiewidth=\cmdstr@strands@tiewidth,
width=\cmdstr@strands@width
}{}
+
\newcommand{\ttanglegen}[1][]{
\setkeys[str]{ttanglegen}{#1}
\bbackstrands[ % trivial two-strands-braid.
@@ -1046,6 +1123,8 @@ to(\fpeval{\cmdstr@ttanglegen@cdnx+\cmdstr@ttanglegen@width/2},
\fpeval{\cmdstr@ttanglegen@cdny-(2*\cmdstr@ttanglegen@height)/3-0.03});
\fi
}
+
+
\makeatletter
\define@cmdkey[str]{aaddgen}{bendbraid}{}
\define@cmdkey[str]{aaddgen}{bendtangle}{}
@@ -1069,6 +1148,7 @@ to(\fpeval{\cmdstr@ttanglegen@cdnx+\cmdstr@ttanglegen@width/2},
\define@cmdkey[str]{aaddgen}{tiestyle}{}
\define@cmdkey[str]{aaddgen}{tiewidth}{}
\define@cmdkey[str]{aaddgen}{width}{}
+
\presetkeys[str]{aaddgen}{
bendbraid=\cmdstr@strands@bendbraid,
bendtangle=\cmdstr@strands@bendtangle,
@@ -1093,6 +1173,7 @@ tiestyle=\cmdstr@strands@tiestyle,
tiewidth=\cmdstr@strands@tiewidth,
width=\cmdstr@strands@width
}{}
+
\newcommand{\aaddgen}[1][]{
\setkeys[str]{aaddgen}{#1}
\StrChar{\cmdstr@aaddgen@generator}{1}[\firstchar]
@@ -1157,7 +1238,7 @@ width=\cmdstr@aaddgen@width
}{\ifthenelse{\equal{\firstchar}{\cmdstr@strands@genchartie}}{
\tie[
bull=\cmdstr@aaddgen@tiebull,
-bulletie=\cmdstr@aaddgen@tiebullsize, %%%%%%%%%%%%%%%%%%%%%
+bulletie=\cmdstr@aaddgen@tiebullsize,
color=\cmdstr@aaddgen@tiecolor,
height=\cmdstr@aaddgen@height,
floor=\fpeval{\cmdstr@aaddgen@posy-1},
@@ -1189,6 +1270,8 @@ width=\cmdstr@aaddgen@width
]
}{DO NOTHING!}}}}}}} % \ifthenelse always use "else", so it will do nothing if other letter.
}
+
+
\makeatletter
\define@cmdkey[str]{ggens}{bendbraid}{}
\define@cmdkey[str]{ggens}{bendtangle}{}
@@ -1216,6 +1299,7 @@ width=\cmdstr@aaddgen@width
\define@cmdkey[str]{ggens}{tiewidth}{}
\define@cmdkey[str]{ggens}{type}{}
\define@cmdkey[str]{ggens}{width}{}
+
\presetkeys[str]{ggens}{
bendbraid=\cmdstr@strands@bendbraid,
bendtangle=\cmdstr@strands@bendtangle,
@@ -1244,7 +1328,9 @@ tiewidth=\cmdstr@strands@tiewidth,
type=3,
width=\cmdstr@strands@width
}{}
+
\newcounter{levelscounter} % count levels.
+
\newcommand{\sstrands}[2][]{
\setkeys[str]{ggens}{#1}
\StrSubstitute{#2}{ }{}[\cmdstr@ggens@nstrsave] % remove whitespaces.
@@ -1312,6 +1398,7 @@ type=\cmdstr@ggens@type,
width=\cmdstr@ggens@width
]
}
+
\makeatletter
\define@cmdkey[str]{gens}{bendbraid}{}
\define@cmdkey[str]{gens}{bendtangle}{}
@@ -1342,6 +1429,7 @@ width=\cmdstr@ggens@width
\define@cmdkey[str]{gens}{tkzpic}{}
\define@cmdkey[str]{gens}{type}{}
\define@cmdkey[str]{gens}{width}{}
+
\presetkeys[str]{gens}{
bendbraid=\cmdstr@strands@bendbraid,
bendtangle=\cmdstr@strands@bendtangle,
@@ -1373,6 +1461,7 @@ tkzpic=\cmdstr@strands@tkzpic,
type=3,
width=\cmdstr@strands@width
}{}
+
\newcommand{\strands}[2][]{
\setkeys[str]{gens}{#1}
\ifthenelse{\equal{\cmdstr@gens@tkzpic}{1}}{
@@ -1436,7 +1525,7 @@ type=\cmdstr@gens@type,
width=\cmdstr@gens@width
]{#2}
}
-}% \end{macrocode}
+}
\endinput
%%