diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/spath3/tikzlibrarycalligraphy.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/spath3/tikzlibrarycalligraphy.code.tex | 387 |
1 files changed, 282 insertions, 105 deletions
diff --git a/Master/texmf-dist/tex/latex/spath3/tikzlibrarycalligraphy.code.tex b/Master/texmf-dist/tex/latex/spath3/tikzlibrarycalligraphy.code.tex index e987539cb0b..35dd9f51c35 100644 --- a/Master/texmf-dist/tex/latex/spath3/tikzlibrarycalligraphy.code.tex +++ b/Master/texmf-dist/tex/latex/spath3/tikzlibrarycalligraphy.code.tex @@ -66,7 +66,8 @@ \pgfsyssoftpath@getcurrentpath\l__cal_tmpa_tl \spath_components_to_seq:NV \l__cal_tmpa_seq \l__cal_tmpa_tl \seq_gclear_new:c {g__cal_pen_\pgfkeysvalueof{/tikz/pen~name}_seq} - \seq_gset_eq:cN {g__cal_pen_\pgfkeysvalueof{/tikz/pen~name}_seq} \l__cal_tmpa_seq + \seq_gset_eq:cN + {g__cal_pen_\pgfkeysvalueof{/tikz/pen~name}_seq} \l__cal_tmpa_seq \pgfusepath{discard}% } }, @@ -80,10 +81,12 @@ \spath_components_to_seq:NV \l__cal_tmpa_seq \l__cal_tmpa_tl \tl_if_exist:cTF {g__cal_pen_\pgfkeysvalueof{/tikz/pen~name}_seq} { - \cal_path_create:Nc \l__cal_tmpa_seq {g__cal_pen_\pgfkeysvalueof{/tikz/pen~name}_seq} + \cal_path_create:Nc \l__cal_tmpa_seq + {g__cal_pen_\pgfkeysvalueof{/tikz/pen~name}_seq} } { - \msg_warning:nnx { calligraphy } { undefined pen } { \pgfkeysvalueof{/tikz/pen~name} } + \msg_warning:nnx { calligraphy } { undefined pen } + { \pgfkeysvalueof{/tikz/pen~name} } } } }, @@ -156,8 +159,10 @@ \tl_set:cn {l__cal_stroke_style_#1} {#2} }, this~stroke~style/.code={ - \tl_clear_new:c {l__cal_stroke_inline_style_ \int_use:N \g__cal_path_component_int} - \tl_set:cn {l__cal_stroke_inline_style_ \int_use:N \g__cal_path_component_int} {#1} + \tl_clear_new:c + {l__cal_stroke_inline_style_ \int_use:N \g__cal_path_component_int} + \tl_set:cn + {l__cal_stroke_inline_style_ \int_use:N \g__cal_path_component_int} {#1} }, annotate/.style={ annotate~if, @@ -264,23 +269,29 @@ \spath_weld:NV \l__cal_tmp_patha_tl \l__cal_tmp_rpathb_tl \tl_clear:N \l__cal_tmpa_tl - \tl_set:Nn \l__cal_tmpa_tl {fill=\pgfkeysvalueof{/tikz/pen~colour},draw=none} + \tl_set:Nn \l__cal_tmpa_tl + { + fill=\pgfkeysvalueof{/tikz/pen~colour}, + draw=none + } \tl_if_exist:cT {l__cal_stroke_style_ \int_use:N \l__cal_tmpa_int} { - \tl_put_right:Nv \l__cal_tmpa_tl {l__cal_stroke_style_ \int_use:N \l__cal_tmpa_int} + \tl_put_right:Nv \l__cal_tmpa_tl + {l__cal_stroke_style_ \int_use:N \l__cal_tmpa_int} } \tl_if_exist:cT {l__cal_stroke_inline_style_ \int_use:N \l__cal_tmpa_int} { \tl_put_right:Nn \l__cal_tmpa_tl {,} - \tl_put_right:Nv \l__cal_tmpa_tl {l__cal_stroke_inline_style_ \int_use:N \l__cal_tmpa_int} + \tl_put_right:Nv \l__cal_tmpa_tl + {l__cal_stroke_inline_style_ \int_use:N \l__cal_tmpa_int} } \tl_if_exist:cT {l__cal_nib_style_ \int_use:N \l__cal_tmpb_int} { \tl_put_right:Nn \l__cal_tmpa_tl {,} - \tl_put_right:Nv \l__cal_tmpa_tl {l__cal_nib_style_ \int_use:N \l__cal_tmpb_int} + \tl_put_right:Nv \l__cal_tmpa_tl + {l__cal_nib_style_ \int_use:N \l__cal_tmpb_int} } \spath_tikz_path:VV \l__cal_tmpa_tl \l__cal_tmp_patha_tl - } \pgfsys@endscope \group_end: @@ -291,7 +302,9 @@ \seq_get_right:NN #2 \l__cal_tmpa_tl \spath_finalpoint:NV \l__cal_tmpa_tl \l__cal_tmpa_tl \spath_translate:NV \l__cal_tmp_path_tl \l__cal_tmpa_tl - \tikz@scan@one@point\pgfutil@firstofone\pgfkeysvalueof{/tikz/annotation~shift} + \tikz@scan@one@point + \pgfutil@firstofone + \pgfkeysvalueof{/tikz/annotation~shift} \spath_translate:Nnn \l__cal_tmp_path_tl {\pgf@x} {\pgf@y} @@ -302,7 +315,10 @@ \exp_last_unbraced:NV \pgfqpoint \l__cal_tmpa_tl \begin{scope}[reset~ cm] - \node[every~annotation~node/.try,tl~use:c = {l__cal_annotation_style_ \int_use:N \l__cal_tmpa_int _tl}] at (\pgf@x,\pgf@y) {\int_use:N \l__cal_tmpa_int}; + \node[ + every~annotation~node/.try, + tl~use:c = {l__cal_annotation_style_ \int_use:N \l__cal_tmpa_int _tl} + ] at (\pgf@x,\pgf@y) {\int_use:N \l__cal_tmpa_int}; \end{scope} } } @@ -480,8 +496,18 @@ (\l__cal_tmpa_fp^2 + \l__cal_tmpb_fp^2)^.5 } - \fp_set:Nn \l__cal_tmpa_fp {.5*\l__cal_taper_width_dim * \l__cal_tmpa_fp / \l__cal_tmpe_fp} - \fp_set:Nn \l__cal_tmpb_fp {.5*\l__cal_taper_width_dim * \l__cal_tmpb_fp / \l__cal_tmpe_fp} + \fp_set:Nn \l__cal_tmpa_fp + { + .5*\l__cal_taper_width_dim + * + \l__cal_tmpa_fp / \l__cal_tmpe_fp + } + \fp_set:Nn \l__cal_tmpb_fp + { + .5*\l__cal_taper_width_dim + * + \l__cal_tmpb_fp / \l__cal_tmpe_fp + } \fp_set:Nn \l__cal_tmpc_fp { @@ -496,13 +522,23 @@ (\l__cal_tmpc_fp^2 + \l__cal_tmpd_fp^2)^.5 } - \fp_set:Nn \l__cal_tmpc_fp {.5*\l__cal_line_width_dim * \l__cal_tmpc_fp / \l__cal_tmpe_fp} - \fp_set:Nn \l__cal_tmpd_fp {.5*\l__cal_line_width_dim * \l__cal_tmpd_fp / \l__cal_tmpe_fp} + \fp_set:Nn \l__cal_tmpc_fp + { + .5*\l__cal_line_width_dim + * + \l__cal_tmpc_fp / \l__cal_tmpe_fp + } + \fp_set:Nn \l__cal_tmpd_fp + { + .5*\l__cal_line_width_dim + * + \l__cal_tmpd_fp / \l__cal_tmpe_fp + } \tl_put_right:Nx \l__cal_tmpb_tl { {\dim_eval:n { \fp_to_dim:N \l__cal_tmpa_fp + \l__cal_tmpa_dim}} - {\dim_eval:n { \fp_to_dim:N \l__cal_tmpb_fp + \l__cal_tmpb_dim}} + {\dim_eval:n { \fp_to_dim:N \l__cal_tmpb_fp + \l__cal_tmpb_dim}} } \tl_put_right:NV \l__cal_tmpb_tl \c_spath_curvetoa_tl @@ -533,16 +569,44 @@ \tl_put_right:Nx \l__cal_tmpb_tl { - {\dim_eval:n { \fp_to_dim:N \l__cal_tmpc_fp + \l__cal_tmpg_dim - \fp_to_dim:n{ 1.32 * \l__cal_tmpd_fp}}} - {\dim_eval:n { \fp_to_dim:N \l__cal_tmpd_fp + \l__cal_tmph_dim + \fp_to_dim:n {1.32* \l__cal_tmpc_fp}}} + { + \dim_eval:n + { + \fp_to_dim:N \l__cal_tmpc_fp + \l__cal_tmpg_dim + - \fp_to_dim:n{ 1.32 * \l__cal_tmpd_fp + } + } + } + { + \dim_eval:n + { + \fp_to_dim:N \l__cal_tmpd_fp + \l__cal_tmph_dim + + \fp_to_dim:n {1.32* \l__cal_tmpc_fp + } + } + } } \tl_put_right:NV \l__cal_tmpb_tl \c_spath_curvetob_tl \tl_put_right:Nx \l__cal_tmpb_tl { - {\dim_eval:n { -\fp_to_dim:N \l__cal_tmpc_fp + \l__cal_tmpg_dim - \fp_to_dim:n {1.32 * \l__cal_tmpd_fp}}} - {\dim_eval:n { -\fp_to_dim:N \l__cal_tmpd_fp + \l__cal_tmph_dim + \fp_to_dim:n {1.32 * \l__cal_tmpc_fp}}} + { + \dim_eval:n + { + -\fp_to_dim:N \l__cal_tmpc_fp + \l__cal_tmpg_dim + - \fp_to_dim:n {1.32 * \l__cal_tmpd_fp + } + } + } + { + \dim_eval:n + { + -\fp_to_dim:N \l__cal_tmpd_fp + \l__cal_tmph_dim + + \fp_to_dim:n {1.32 * \l__cal_tmpc_fp + } + } + } } \tl_put_right:NV \l__cal_tmpb_tl \c_spath_curveto_tl @@ -581,16 +645,40 @@ \tl_put_right:Nx \l__cal_tmpb_tl { - {\dim_eval:n { -\fp_to_dim:N \l__cal_tmpa_fp + \l__cal_tmpa_dim + \fp_to_dim:n{ 1.32 * \l__cal_tmpb_fp}}} - {\dim_eval:n { -\fp_to_dim:N \l__cal_tmpb_fp + \l__cal_tmpb_dim - \fp_to_dim:n {1.32* \l__cal_tmpa_fp}}} + { + \dim_eval:n + { + -\fp_to_dim:N \l__cal_tmpa_fp + \l__cal_tmpa_dim + + \fp_to_dim:n{ 1.32 * \l__cal_tmpb_fp} + } + } + { + \dim_eval:n + { + -\fp_to_dim:N \l__cal_tmpb_fp + \l__cal_tmpb_dim + - \fp_to_dim:n {1.32* \l__cal_tmpa_fp} + } + } } \tl_put_right:NV \l__cal_tmpb_tl \c_spath_curvetob_tl \tl_put_right:Nx \l__cal_tmpb_tl { - {\dim_eval:n { \fp_to_dim:N \l__cal_tmpa_fp + \l__cal_tmpa_dim + \fp_to_dim:n {1.32 * \l__cal_tmpb_fp}}} - {\dim_eval:n { \fp_to_dim:N \l__cal_tmpb_fp + \l__cal_tmpb_dim - \fp_to_dim:n {1.32 * \l__cal_tmpa_fp}}} + { + \dim_eval:n + { + \fp_to_dim:N \l__cal_tmpa_fp + \l__cal_tmpa_dim + + \fp_to_dim:n {1.32 * \l__cal_tmpb_fp} + } + } + { + \dim_eval:n + { + \fp_to_dim:N \l__cal_tmpb_fp + \l__cal_tmpb_dim + - \fp_to_dim:n {1.32 * \l__cal_tmpa_fp} + } + } } \tl_put_right:NV \l__cal_tmpb_tl \c_spath_curveto_tl @@ -598,7 +686,7 @@ \tl_put_right:Nx \l__cal_tmpb_tl { {\dim_eval:n { \fp_to_dim:N \l__cal_tmpa_fp + \l__cal_tmpa_dim}} - {\dim_eval:n { \fp_to_dim:N \l__cal_tmpb_fp + \l__cal_tmpb_dim}} + {\dim_eval:n { \fp_to_dim:N \l__cal_tmpb_fp + \l__cal_tmpb_dim}} } \pgfsyssoftpath@setcurrentpath\l__cal_tmpb_tl @@ -617,98 +705,187 @@ \ExplSyntaxOff \expandafter\ifx\csname pgfdeclaredecoration\endcsname\relax \else -\pgfdeclaredecoration{calligraphic brace}{brace} -{ - \state{brace}[width=+\pgfdecoratedremainingdistance,next state=final] - { - \pgfsyssoftpath@setcurrentpath{\pgfutil@empty} - \pgfpathmoveto{\pgfpointorigin} - \pgfpathcurveto - {\pgfqpoint{.15\pgfdecorationsegmentamplitude}{.3\pgfdecorationsegmentamplitude}} - {\pgfqpoint{.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}} - {\pgfqpoint{\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}} - { - \pgftransformxshift{+\pgfdecorationsegmentaspect\pgfdecoratedremainingdistance} - \pgfpathlineto{\pgfqpoint{-\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}} - \pgfpathcurveto - {\pgfqpoint{-.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}} - {\pgfqpoint{-.15\pgfdecorationsegmentamplitude}{.7\pgfdecorationsegmentamplitude}} - {\pgfqpoint{0\pgfdecorationsegmentamplitude}{1\pgfdecorationsegmentamplitude}} - \pgfpathmoveto{\pgfqpoint{0\pgfdecorationsegmentamplitude}{1\pgfdecorationsegmentamplitude}} - \pgfpathcurveto - {\pgfqpoint{.15\pgfdecorationsegmentamplitude}{.7\pgfdecorationsegmentamplitude}} - {\pgfqpoint{.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}} - {\pgfqpoint{\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}} - } - { - \pgftransformxshift{+\pgfdecoratedremainingdistance} - \pgfpathlineto{\pgfqpoint{-\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}} +\pgfdeclaredecoration{calligraphic brace}{brace}% +{% + \state{brace}[width=+\pgfdecoratedremainingdistance,next state=final]% + {% + \pgfsyssoftpath@setcurrentpath{\pgfutil@empty}% + \pgfpathmoveto{\pgfpointorigin}% + \pgfpathcurveto% + {% + \pgfqpoint% + {.15\pgfdecorationsegmentamplitude}% + {.3\pgfdecorationsegmentamplitude}% + }% + {% + \pgfqpoint% + {.5\pgfdecorationsegmentamplitude}% + {.5\pgfdecorationsegmentamplitude}% + }% + {% + \pgfqpoint% + {\pgfdecorationsegmentamplitude}% + {.5\pgfdecorationsegmentamplitude}% + }% + {% + \pgftransformxshift% + {+\pgfdecorationsegmentaspect\pgfdecoratedremainingdistance}% + \pgfpathlineto% + {% + \pgfqpoint% + {-\pgfdecorationsegmentamplitude}% + {.5\pgfdecorationsegmentamplitude}% + }% \pgfpathcurveto - {\pgfqpoint{-.5\pgfdecorationsegmentamplitude}{.5\pgfdecorationsegmentamplitude}} - {\pgfqpoint{-.15\pgfdecorationsegmentamplitude}{.3\pgfdecorationsegmentamplitude}} - {\pgfqpoint{0pt}{0pt}} - } - \tikzset{ - taper width=.5\pgflinewidth, - taper + {% + \pgfqpoint% + {-.5\pgfdecorationsegmentamplitude}% + {.5\pgfdecorationsegmentamplitude}% + }% + {% + \pgfqpoint% + {-.15\pgfdecorationsegmentamplitude}% + {.7\pgfdecorationsegmentamplitude}% + }% + {% + \pgfqpoint% + {0\pgfdecorationsegmentamplitude}% + {1\pgfdecorationsegmentamplitude}% + }% + \pgfpathmoveto% + {% + \pgfqpoint% + {0\pgfdecorationsegmentamplitude}% + {1\pgfdecorationsegmentamplitude}% + }% + \pgfpathcurveto% + {% + \pgfqpoint% + {.15\pgfdecorationsegmentamplitude}% + {.7\pgfdecorationsegmentamplitude}% + }% + {% + \pgfqpoint% + {.5\pgfdecorationsegmentamplitude}% + {.5\pgfdecorationsegmentamplitude}% + }% + {% + \pgfqpoint% + {\pgfdecorationsegmentamplitude}% + {.5\pgfdecorationsegmentamplitude}% + }% }% - \pgfsyssoftpath@getcurrentpath\cal@tmp@path - \CopperplatePath{\cal@tmp@path} - } - \state{final}{} -} + {% + \pgftransformxshift{+\pgfdecoratedremainingdistance}% + \pgfpathlineto% + {% + \pgfqpoint% + {-\pgfdecorationsegmentamplitude}% + {.5\pgfdecorationsegmentamplitude}% + }% + \pgfpathcurveto% + {% + \pgfqpoint% + {-.5\pgfdecorationsegmentamplitude}% + {.5\pgfdecorationsegmentamplitude}% + }% + {% + \pgfqpoint% + {-.15\pgfdecorationsegmentamplitude}% + {.3\pgfdecorationsegmentamplitude}% + }% + {\pgfqpoint{0pt}{0pt}}% + }% + \tikzset{% + taper width=.5\pgflinewidth,% + taper% + }%% + \pgfsyssoftpath@getcurrentpath\cal@tmp@path% + \CopperplatePath{\cal@tmp@path}% + }% + \state{final}{}% +}% \pgfdeclaredecoration{calligraphic straight parenthesis}{brace} { - \state{brace}[width=+\pgfdecoratedremainingdistance,next state=final] - { - \pgfsyssoftpath@setcurrentpath{\pgfutil@empty} - \pgfpathmoveto{\pgfpointorigin} - \pgfpathcurveto - {\pgfqpoint{.76604\pgfdecorationsegmentamplitude}{.64279\pgfdecorationsegmentamplitude}} - {\pgfqpoint{2.3333\pgfdecorationsegmentamplitude}{\pgfdecorationsegmentamplitude}} - {\pgfqpoint{3.3333\pgfdecorationsegmentamplitude}{\pgfdecorationsegmentamplitude}} - { - \pgftransformxshift{+\pgfdecoratedremainingdistance} - \pgfpathlineto{\pgfqpoint{-3.3333\pgfdecorationsegmentamplitude}{\pgfdecorationsegmentamplitude}} - \pgfpathcurveto - {\pgfqpoint{-2.3333\pgfdecorationsegmentamplitude}{\pgfdecorationsegmentamplitude}} - {\pgfqpoint{-.76604\pgfdecorationsegmentamplitude}{.64279\pgfdecorationsegmentamplitude}} - {\pgfqpoint{0pt}{0pt}} - } - \tikzset{ - taper width=.5\pgflinewidth, - taper + \state{brace}[width=+\pgfdecoratedremainingdistance,next state=final]% + {% + \pgfsyssoftpath@setcurrentpath{\pgfutil@empty}% + \pgfpathmoveto{\pgfpointorigin}% + \pgfpathcurveto% + {% + \pgfqpoint% + {.76604\pgfdecorationsegmentamplitude}% + {.64279\pgfdecorationsegmentamplitude}% }% - \pgfsyssoftpath@getcurrentpath\cal@tmp@path - \CopperplatePath{\cal@tmp@path} - } + {% + \pgfqpoint% + {2.3333\pgfdecorationsegmentamplitude}% + {\pgfdecorationsegmentamplitude}% + }% + {% + \pgfqpoint% + {3.3333\pgfdecorationsegmentamplitude}% + {\pgfdecorationsegmentamplitude}% + }% + {% + \pgftransformxshift{+\pgfdecoratedremainingdistance}% + \pgfpathlineto% + {% + \pgfqpoint% + {-3.3333\pgfdecorationsegmentamplitude}% + {\pgfdecorationsegmentamplitude}% + }% + \pgfpathcurveto% + {% + \pgfqpoint% + {-2.3333\pgfdecorationsegmentamplitude}% + {\pgfdecorationsegmentamplitude}% + }% + {% + \pgfqpoint% + {-.76604\pgfdecorationsegmentamplitude}% + {.64279\pgfdecorationsegmentamplitude}% + }% + {\pgfqpoint{0pt}{0pt}}% + }% + \tikzset{% + taper width=.5\pgflinewidth,% + taper% + }% + \pgfsyssoftpath@getcurrentpath\cal@tmp@path% + \CopperplatePath{\cal@tmp@path}% + }% \state{final}{}% } \pgfdeclaredecoration{calligraphic curved parenthesis}{brace} { - \state{brace}[width=+\pgfdecoratedremainingdistance,next state=final] - { - \pgfsyssoftpath@setcurrentpath{\pgfutil@empty} - \pgfpathmoveto{\pgfpointorigin} - \pgf@xa=\pgfdecoratedremainingdistance\relax - \advance\pgf@xa by -1.5890\pgfdecorationsegmentamplitude\relax - \edef\cgrphy@xa{\the\pgf@xa} - \pgfpathcurveto - {\pgfqpoint{1.5890\pgfdecorationsegmentamplitude}{1.3333\pgfdecorationsegmentamplitude}} - {\pgfqpoint{\cgrphy@xa}{1.3333\pgfdecorationsegmentamplitude}} - {\pgfqpoint{\pgfdecoratedremainingdistance}{0pt}} - \tikzset{ - taper width=.5\pgflinewidth, - taper + \state{brace}[width=+\pgfdecoratedremainingdistance,next state=final]% + {% + \pgfsyssoftpath@setcurrentpath{\pgfutil@empty}% + \pgfpathmoveto{\pgfpointorigin}% + \pgf@xa=\pgfdecoratedremainingdistance\relax% + \advance\pgf@xa by -1.5890\pgfdecorationsegmentamplitude\relax% + \edef\cgrphy@xa{\the\pgf@xa}% + \pgfpathcurveto% + {% + \pgfqpoint% + {1.5890\pgfdecorationsegmentamplitude}% + {1.3333\pgfdecorationsegmentamplitude}% }% - \pgfsyssoftpath@getcurrentpath\cal@tmp@path - \CopperplatePath{\cal@tmp@path} - } + {\pgfqpoint{\cgrphy@xa}{1.3333\pgfdecorationsegmentamplitude}}% + {\pgfqpoint{\pgfdecoratedremainingdistance}{0pt}}% + \tikzset{% + taper width=.5\pgflinewidth,% + taper% + }% + \pgfsyssoftpath@getcurrentpath\cal@tmp@path% + \CopperplatePath{\cal@tmp@path}% + }% \state{final}{}% } \fi %% -%% Copyright (C) 2011-2019 by Andrew Stacey <loopspace@mathforge.org> +%% Copyright (C) 2011-2021 by Andrew Stacey <loopspace@mathforge.org> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License (LPPL), either @@ -720,7 +897,7 @@ %% This work is "maintained" (as per LPPL maintenance status) by %% Andrew Stacey. %% -%% This work consists of the files spath3.dtx +%% This work consists of the files spath3_code.dtx %% calligraphy_doc.tex %% knots_doc.tex %% spath3.tex |