summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/spath3/spath3.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/spath3/spath3.sty')
-rw-r--r--Master/texmf-dist/tex/latex/spath3/spath3.sty62
1 files changed, 42 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/latex/spath3/spath3.sty b/Master/texmf-dist/tex/latex/spath3/spath3.sty
index 876f5ca5841..43fd64cf5e2 100644
--- a/Master/texmf-dist/tex/latex/spath3/spath3.sty
+++ b/Master/texmf-dist/tex/latex/spath3/spath3.sty
@@ -15,7 +15,7 @@
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
\RequirePackage{pgf}
-\ProvidesExplPackage {spath3} {2016/02/19} {1.1} {Functions for
+\ProvidesExplPackage {spath3} {2019/02/12} {1.2} {Functions for
manipulating PGF soft paths}
\RequirePackage{xparse}
\tl_new:N \l__spath_tmpa_tl
@@ -28,6 +28,7 @@ manipulating PGF soft paths}
\fp_new:N \l__spath_tmpa_fp
\fp_new:N \l__spath_tmpb_fp
\int_new:N \l__spath_tmpa_int
+\int_new:N \g__spath_map_int
\tl_new:N \g__spath_moveto_tl
\tl_new:N \g__spath_lineto_tl
\tl_new:N \g__spath_curveto_tl
@@ -194,7 +195,7 @@ manipulating PGF soft paths}
}
\__spath_get:nnN {#1} {#2} #3
}
-\cs_generate_variant:Nn \spath_get:nnN {nnV,VnN,VnV}
+\cs_generate_variant:Nn \spath_get:nnN {VnN}
\cs_new_nopar:Npn \spath_generate_length:n #1
{
\__spath_get:nnN {#1} {path} \l__spath_tmpa_tl
@@ -1158,8 +1159,8 @@ manipulating PGF soft paths}
}
\cs_new_nopar:Npn \spath_map_component:Nn #1#2
{
- \int_gincr:N \g__prg_map_int
- \cs_gset:cpn { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
+ \int_gincr:N \g__spath_map_int
+ \cs_gset:cpn { __spath_map_ \int_use:N \g__spath_map_int :w } ##1 {#2}
\tl_set:NV \l__spath_tmpa_tl #1
\tl_set:Nx \l__spath_tmpa_tl {\tl_tail:N \l__spath_tmpa_tl}
\tl_put_right:NV \l__spath_tmpa_tl \g__spath_moveto_tl
@@ -1171,7 +1172,7 @@ manipulating PGF soft paths}
\tl_set:Nx \l__spath_tmpc_tl {\tl_head:N \l__spath_tmpa_tl}
\tl_if_eq:NNT \l__spath_tmpc_tl \g__spath_moveto_tl
{
- \exp_args:NnV \use:c { __prg_map_ \int_use:N \g__prg_map_int :w } \l__spath_tmpb_tl
+ \exp_args:NnV \use:c { __spath_map_ \int_use:N \g__spath_map_int :w } \l__spath_tmpb_tl
\tl_clear:N \l__spath_tmpb_tl
}
\tl_if_single:NTF \l__spath_tmpc_tl
@@ -1186,16 +1187,16 @@ manipulating PGF soft paths}
}
\cs_new_nopar:Npn \spath_map_segment_inline:Nn #1#2
{
- \int_gincr:N \g__prg_map_int
- \cs_gset:cpn { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 ##2 {#2}
- \spath_map_segment_function:Nc #1 { __prg_map_ \int_use:N \g__prg_map_int :w }
+ \int_gincr:N \g__spath_map_int
+ \cs_gset:cpn { __spath_map_ \int_use:N \g__spath_map_int :w } ##1 ##2 {#2}
+ \spath_map_segment_function:Nc #1 { __spath_map_ \int_use:N \g__spath_map_int :w }
}
\cs_new_nopar:Npn \spath_map_segment_inline:nn #1#2
{
- \int_gincr:N \g__prg_map_int
- \cs_gset:cpn { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 ##2 {#2}
+ \int_gincr:N \g__spath_map_int
+ \cs_gset:cpn { __spath_map_ \int_use:N \g__spath_map_int :w } ##1 ##2 {#2}
\spath_get:nnN {#1} {path} \l__spath_tmpd_tl
- \spath_map_segment_function:Nc \l__spath_tmpd_tl { __prg_map_ \int_use:N \g__prg_map_int :w }
+ \spath_map_segment_function:Nc \l__spath_tmpd_tl { __spath_map_ \int_use:N \g__spath_map_int :w }
}
\cs_new_nopar:Npn \spath_map_segment_function:nN #1#2
{
@@ -1265,6 +1266,27 @@ manipulating PGF soft paths}
\tl_set:Nx \l__spath_tmpa_tl {\tl_tail:N \l__spath_tmpa_tl}
}
+
+ \g__spath_closepath_tl
+ {
+ \tl_set_eq:NN \l__spath_tmpb_tl \g__spath_moveto_tl
+ \tl_put_right:Nx \l__spath_tmpb_tl
+ {
+ {\dim_use:N \l__spath_tmpa_dim}
+ {\dim_use:N \l__spath_tmpb_dim}
+ }
+ \tl_put_right:NV \l__spath_tmpb_tl \g__spath_lineto_tl
+
+ \tl_put_right:Nx \l__spath_tmpb_tl {{\tl_head:N \l__spath_tmpa_tl}}
+ \dim_set:Nn \l__spath_tmpa_dim {\tl_head:N \l__spath_tmpa_tl}
+ \tl_set:Nx \l__spath_tmpa_tl {\tl_tail:N \l__spath_tmpa_tl}
+
+ \tl_put_right:Nx \l__spath_tmpb_tl {{\tl_head:N \l__spath_tmpa_tl}}
+ \dim_set:Nn \l__spath_tmpb_dim {\tl_head:N \l__spath_tmpa_tl}
+ \tl_set:Nx \l__spath_tmpa_tl {\tl_tail:N \l__spath_tmpa_tl}
+
+ }
+
}
{
@@ -1322,8 +1344,8 @@ manipulating PGF soft paths}
}
\NewDocumentCommand \SPathInfoInto { m m m }
{
- \tl_set:Nn \l_tmpa_tl #3
- \spath_get:nnV {#1} {#2} \l_tmpa_tl
+ \tl_clear_new:N #3
+ \spath_get:nnN {#1} {#2} #3
}
\NewDocumentCommand \SPathShow { m }
{
@@ -1372,8 +1394,8 @@ manipulating PGF soft paths}
\tl_gclear:N \l__spath_smuggle_tl
\tl_set_eq:NN \l__spath_tmpa_tl \g__spath_moveto_tl
\tl_put_right:Nx \l__spath_tmpa_tl {
+ {\tl_item:nn {#2} {2}}
{\tl_item:nn {#2} {3}}
- {\tl_item:nn {#2} {4}}
}
\tl_put_right:NV \l__spath_tmpa_tl \g__spath_curvetoa_tl
\tl_put_right:Nx \l__spath_tmpa_tl
@@ -1463,7 +1485,7 @@ manipulating PGF soft paths}
\cs_generate_variant:Nn \spath_split_curve:nnNN {nVNN, VVNN}
%%
-%% Copyright (C) 2011 by Andrew Stacey <stacey@math.ntnu.no>
+%% Copyright (C) 2011-2019 by Andrew Stacey <stacey@math.ntnu.no>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
@@ -1477,15 +1499,15 @@ manipulating PGF soft paths}
%%
%% This work consists of the files spath3.dtx
%% calligraphy_doc.tex
-%% knot_doc.tex
+%% knots_doc.tex
%% and the derived files spath3.ins,
-%% spath3.pdf,
+%% spath3_code.pdf,
%% spath3.sty,
%% tikzlibrarycalligraphy.code.tex
%% tikzlibraryknots.code.tex
-%% calligraphy_doc.pdf
-%% knots_doc.pdf
-%% README.txt
+%% calligraphy.pdf
+%% knots.pdf
+%% README
%%
%%
%% End of file `spath3.sty'.