diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzfill')
8 files changed, 1026 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzfill/tikzfill-common.sty b/Master/texmf-dist/tex/latex/tikzfill/tikzfill-common.sty new file mode 100644 index 00000000000..2adb2a7cea0 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikzfill/tikzfill-common.sty @@ -0,0 +1,56 @@ +%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20) +%% tikzfill-common.sty: auxiliary code for library loading +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% 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. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README.md +%% +\NeedsTeXFormat{LaTeX2e}[2020/10/01] +\ProvidesPackage{tikzfill-common}[2022/07/20 v1.0.0 Auxiliary code for tikzfill] +\RequirePackage{tikz} + +\ExplSyntaxOn + +\cs_new_nopar:Npn \__tikzfill_usetikzlibrary:n #1 + { + \cs_if_exist:NTF \tikzfillpkgprefix + { + \bool_set:Nn \l_tmpa_bool { \tl_if_blank_p:V \tikzfillpkgprefix } + } + { + \bool_set_true:N \l_tmpa_bool + } + \bool_if:NTF \l_tmpa_bool + { + \usetikzlibrary{ #1 } + } + { + \cs_if_exist:NF \l__tikzfill_library_seq + { + \seq_new:N \l__tikzfill_library_seq + } + \seq_set_from_clist:Nn \l__tikzfill_library_seq { #1 } + \seq_map_inline:Nn \l__tikzfill_library_seq + { + \cs_if_exist:cF { tikz@library@ ##1 @loaded } + { + \cs_gset:cpn { tikz@library@ ##1 @loaded }{} + \input{ \tikzfillpkgprefix tikzlibrary ##1 .code.tex} + } + } + } + } + +\ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex/tikzfill/tikzfill.hexagon.sty b/Master/texmf-dist/tex/latex/tikzfill/tikzfill.hexagon.sty new file mode 100644 index 00000000000..66ad292e479 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikzfill/tikzfill.hexagon.sty @@ -0,0 +1,24 @@ +%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20) +%% tikzfill.hexagon.sty: filling with hexagon patterns +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% 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. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README.md +%% +\ProvidesPackage{tikzfill.hexagon}[2022/07/20 v1.0.0 Hexagon pattern library for TikZ] +\RequirePackage{tikzfill-common} +\ExplSyntaxOn +\__tikzfill_usetikzlibrary:n { fill.hexagon } +\ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex/tikzfill/tikzfill.image.sty b/Master/texmf-dist/tex/latex/tikzfill/tikzfill.image.sty new file mode 100644 index 00000000000..fb7bb3e0302 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikzfill/tikzfill.image.sty @@ -0,0 +1,24 @@ +%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20) +%% tikzfill.image.sty: filling with images +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% 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. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README.md +%% +\ProvidesPackage{tikzfill.image}[2022/07/20 v1.0.0 Image filling library for TikZ] +\RequirePackage{tikzfill-common} +\ExplSyntaxOn +\__tikzfill_usetikzlibrary:n { fill.image } +\ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex/tikzfill/tikzfill.rhombus.sty b/Master/texmf-dist/tex/latex/tikzfill/tikzfill.rhombus.sty new file mode 100644 index 00000000000..58deb476557 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikzfill/tikzfill.rhombus.sty @@ -0,0 +1,24 @@ +%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20) +%% tikzfill.rhombus.sty: filling with rhombus patterns +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% 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. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README.md +%% +\ProvidesPackage{tikzfill.rhombus}[2022/07/20 v1.0.0 Rhombus pattern library for TikZ] +\RequirePackage{tikzfill-common} +\ExplSyntaxOn +\__tikzfill_usetikzlibrary:n { fill.rhombus } +\ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex/tikzfill/tikzfill.sty b/Master/texmf-dist/tex/latex/tikzfill/tikzfill.sty new file mode 100644 index 00000000000..c9a622b9e55 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikzfill/tikzfill.sty @@ -0,0 +1,24 @@ +%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20) +%% tikzfill.sty: load all fill libraries +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% 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. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README.md +%% +\ProvidesPackage{tikzfill}[2022/07/20 v1.0.0 Image and pattern libraries for TikZ] +\RequirePackage{tikzfill-common} +\ExplSyntaxOn +\__tikzfill_usetikzlibrary:n { fill.image, fill.hexagon, fill.rhombus } +\ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex/tikzfill/tikzlibraryfill.hexagon.code.tex b/Master/texmf-dist/tex/latex/tikzfill/tikzlibraryfill.hexagon.code.tex new file mode 100644 index 00000000000..2fccee15b99 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikzfill/tikzlibraryfill.hexagon.code.tex @@ -0,0 +1,315 @@ +%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20) +%% tikzlibraryfill.hexagon.code.tex: filling with hexagon patterns +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% 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. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README.md +%% +\ProvidesFile{tikzlibraryfill.hexagon.code.tex}[2022/07/20 v1.0.0 Hexagon pattern library] + +\usetikzlibrary{patterns.meta} + +\ExplSyntaxOn + +\int_new:N \l__tikzfill_hex_ring_int +\tl_new:N \l__tikzfill_hex_a_tl +\tl_new:N \l__tikzfill_hex_as_tl +\tl_new:N \l__tikzfill_hex_b_tl +\tl_new:N \l__tikzfill_hex_bs_tl +\tl_new:N \l__tikzfill_hex_linewidth_tl +\tl_new:N \l__tikzfill_hex_pos_tl + +\pgfdeclarepattern + { + name = hexagon~grid, + parameters = + { + \pgfkeysvalueof{/pgf/pattern~keys/size}, + \pgfkeysvalueof{/pgf/pattern~keys/angle}, + \pgfkeysvalueof{/pgf/pattern~keys/xshift}, + \pgfkeysvalueof{/pgf/pattern~keys/yshift}, + \pgfkeysvalueof{/pgf/pattern~keys/line~width}, + }, + defaults = + { + size /.initial = 8mm, + angle /.initial = 0, + line~width /.initial = 0.4pt, + xshift /.initial = 0pt, + yshift /.initial = 0pt, + }, + set~up~code = + { + \fp_set:Nn \l_tmpa_fp { \pgfkeysvalueof{/pgf/pattern~keys/size} } + \tl_set:Nx \l__tikzfill_hex_a_tl { \fp_to_dim:N \l_tmpa_fp } + \tl_set:Nx \l__tikzfill_hex_b_tl { \fp_to_dim:n { \l_tmpa_fp*sqrt(3)/2 } } + \tl_set:Nx \l__tikzfill_hex_linewidth_tl { \fp_to_dim:n { \pgfkeysvalueof{/pgf/pattern~keys/line~width} } } + }, + bottom~left = + { + \pgfpoint{ -\l__tikzfill_hex_b_tl-.1pt }{ -\l__tikzfill_hex_a_tl-\l__tikzfill_hex_linewidth_tl } + }, + top~right = + { + \pgfpoint{ \l__tikzfill_hex_b_tl+.1pt }{ 2*\l__tikzfill_hex_a_tl+.1pt } + }, + tile~size = + { + \pgfpoint{ 2*\l__tikzfill_hex_b_tl }{ 3*\l__tikzfill_hex_a_tl } + }, + tile~transformation = + { + \pgftransformrotate{ \pgfkeysvalueof{/pgf/pattern~keys/angle} } + \pgftransformshift + { + \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift} } + { \pgfkeysvalueof{/pgf/pattern~keys/yshift} } + } + }, + code= + { + \pgfsetlinewidth{\l__tikzfill_hex_linewidth_tl} + \pgfpathmoveto{\pgfpoint{ 0 }{ 2*\l__tikzfill_hex_a_tl+.1pt }} + \pgfpathlineto{\pgfpoint{ 0 }{ \l__tikzfill_hex_a_tl }} + \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_b_tl }{ 0.5*\l__tikzfill_hex_a_tl }} + \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_b_tl }{ -0.5*\l__tikzfill_hex_a_tl }} + \pgfpathlineto{\pgfpoint{ 0 }{ -\l__tikzfill_hex_a_tl }} + \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_b_tl }{ -0.5*\l__tikzfill_hex_a_tl }} + \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_b_tl }{ 0.5*\l__tikzfill_hex_a_tl }} + \pgfpathlineto{\pgfpoint{ 0 }{ \l__tikzfill_hex_a_tl }} + \pgfusepath{stroke} + } + } + +\tikzset{ + pattern~hexagon~grid /.style = + { + pattern={hexagon~grid[#1]} + } +} + + + +\pgfdeclarepattern + { + name = hexagon, + parameters = + { + \pgfkeysvalueof{/pgf/pattern~keys/size}, + \pgfkeysvalueof{/pgf/pattern~keys/angle}, + \pgfkeysvalueof{/pgf/pattern~keys/xshift}, + \pgfkeysvalueof{/pgf/pattern~keys/yshift}, + \pgfkeysvalueof{/pgf/pattern~keys/line~width}, + \pgfkeysvalueof{/pgf/pattern~keys/pos}, + \pgfkeysvalueof{/pgf/pattern~keys/band}, + \pgfkeysvalueof{/pgf/pattern~keys/_fill_}, + }, + defaults = + { + size /.initial = 8mm, + angle /.initial = 0, + xshift /.initial = 0pt, + yshift /.initial = 0pt, + line~width /.initial = 0.4pt, + pos /.initial = 0.8, + band /.initial = 0, + _fill_ /.initial = 1, + fill /.style = { _fill_=1 }, + draw /.style = { _fill_=0 }, + }, + set~up~code = + { + \fp_set:Nn \l_tmpa_fp { \pgfkeysvalueof{/pgf/pattern~keys/size} } + \tl_set:Nx \l__tikzfill_hex_a_tl { \fp_to_dim:N \l_tmpa_fp } + \tl_set:Nx \l__tikzfill_hex_b_tl { \fp_to_dim:n { \l_tmpa_fp*sqrt(3)/2 } } + \tl_set:Nx \l__tikzfill_hex_linewidth_tl { \fp_to_dim:n { \pgfkeysvalueof{/pgf/pattern~keys/line~width} } } + \tl_set:Nx \l__tikzfill_hex_pos_tl { \fp_to_decimal:n { min ( 1 , max( 0, \pgfkeysvalueof{/pgf/pattern~keys/pos} )) } } + }, + bottom~left = + { + \pgfpoint{ -\l__tikzfill_hex_b_tl-\l__tikzfill_hex_linewidth_tl }{ -\l__tikzfill_hex_a_tl-\l__tikzfill_hex_linewidth_tl } + }, + top~right = + { + \pgfpoint{ \l__tikzfill_hex_b_tl+\l__tikzfill_hex_linewidth_tl }{ 2*\l__tikzfill_hex_a_tl+\l__tikzfill_hex_linewidth_tl } + }, + tile~size = + { + \pgfpoint{ 2*\l__tikzfill_hex_b_tl }{ 3*\l__tikzfill_hex_a_tl } + }, + tile~transformation = + { + \pgftransformrotate{ \pgfkeysvalueof{/pgf/pattern~keys/angle} } + \int_compare:nNnTF { \pgfkeysvalueof{/pgf/pattern~keys/band} } = 0 + { + \pgftransformshift + { + \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift} } + { \pgfkeysvalueof{/pgf/pattern~keys/yshift} } + } + } + { + \pgftransformshift + { + \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift}-\l__tikzfill_hex_b_tl } + { \pgfkeysvalueof{/pgf/pattern~keys/yshift}+1.5*\l__tikzfill_hex_a_tl } + } + } + }, + code= + { + \tl_set:Nx \l__tikzfill_hex_as_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_a_tl } } + \tl_set:Nx \l__tikzfill_hex_bs_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_b_tl } } + \pgfpathmoveto{\pgfpoint{ 0 }{ \l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ 0 }{ -\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }} + \pgfpathclose + \int_compare:nNnTF { \pgfkeysvalueof{/pgf/pattern~keys/_fill_} } = 1 + { + \pgfusepath{fill} + } + { + \pgfsetlinewidth{\l__tikzfill_hex_linewidth_tl} + \pgfusepath{stroke} + } + } + } + + +\tikzset{ + pattern~hexagon /.style = + { + preaction={pattern={hexagon[#1,band=1]}}, + pattern={hexagon[#1,band=0]} + } +} + + + +\pgfdeclarepattern + { + name = hexagon~cycle, + parameters = + { + \pgfkeysvalueof{/pgf/pattern~keys/size}, + \pgfkeysvalueof{/pgf/pattern~keys/angle}, + \pgfkeysvalueof{/pgf/pattern~keys/xshift}, + \pgfkeysvalueof{/pgf/pattern~keys/yshift}, + \pgfkeysvalueof{/pgf/pattern~keys/rings}, + \pgfkeysvalueof{/pgf/pattern~keys/gap}, + \pgfkeysvalueof{/pgf/pattern~keys/band}, + }, + defaults = + { + size /.initial = 8mm, + angle /.initial = 0, + xshift /.initial = 0pt, + yshift /.initial = 0pt, + rings /.initial = 3, + gap /.initial = 1, + band /.initial = 0, + }, + set~up~code = + { + \fp_set:Nn \l_tmpa_fp { \pgfkeysvalueof{/pgf/pattern~keys/size} } + \tl_set:Nx \l__tikzfill_hex_a_tl { \fp_to_dim:N \l_tmpa_fp } + \tl_set:Nx \l__tikzfill_hex_b_tl { \fp_to_dim:n { \l_tmpa_fp*sqrt(3)/2 } } + \int_set:Nn \l__tikzfill_hex_ring_int { \fp_to_int:n { max ( 0, \pgfkeysvalueof{/pgf/pattern~keys/rings} ) }} + \fp_set:Nn \l_tmpa_fp { max ( 0.01, \pgfkeysvalueof{/pgf/pattern~keys/gap} ) } + \tl_set:Nx \l__tikzfill_hex_linewidth_tl { \fp_to_dim:n + { + \l__tikzfill_hex_b_tl / (( \l__tikzfill_hex_ring_int + 0.5 )*( 1 + \l_tmpa_fp )) + }} + }, + bottom~left = + { + \pgfpoint{ -\l__tikzfill_hex_b_tl }{ -\l__tikzfill_hex_a_tl } + }, + top~right = + { + \pgfpoint{ \l__tikzfill_hex_b_tl }{ 2*\l__tikzfill_hex_a_tl } + }, + tile~size = + { + \pgfpoint{ 2*\l__tikzfill_hex_b_tl }{ 3*\l__tikzfill_hex_a_tl } + }, + tile~transformation = + { + \pgftransformrotate{ \pgfkeysvalueof{/pgf/pattern~keys/angle} } + \int_compare:nNnTF { \pgfkeysvalueof{/pgf/pattern~keys/band} } = 0 + { + \pgftransformshift + { + \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift} } + { \pgfkeysvalueof{/pgf/pattern~keys/yshift} } + } + } + { + \pgftransformshift + { + \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift}-\l__tikzfill_hex_b_tl } + { \pgfkeysvalueof{/pgf/pattern~keys/yshift}+1.5*\l__tikzfill_hex_a_tl } + } + } + }, + code= + { + \tl_set:Nn \l__tikzfill_hex_pos_tl { \l__tikzfill_hex_linewidth_tl/2/\l__tikzfill_hex_b_tl } + \tl_set:Nx \l__tikzfill_hex_as_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_a_tl } } + \tl_set:Nx \l__tikzfill_hex_bs_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_b_tl } } + \pgfpathmoveto{\pgfpoint{ 0 }{ \l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ 0 }{ -\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }} + \pgfpathclose + \pgfusepath{fill} + % + \pgfsetlinewidth{\l__tikzfill_hex_linewidth_tl} + \int_step_function:nN { \l__tikzfill_hex_ring_int } \__tikzfill_hex_draw_ring:n + } + } + + +\cs_set:Npn \__tikzfill_hex_draw_ring:n #1 + { + \tl_set:Nn \l__tikzfill_hex_pos_tl { #1/( \l__tikzfill_hex_ring_int + 0.5 )} + \tl_set:Nx \l__tikzfill_hex_as_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_a_tl } } + \tl_set:Nx \l__tikzfill_hex_bs_tl { \fp_to_dim:n { \l__tikzfill_hex_pos_tl*\l__tikzfill_hex_b_tl } } + \pgfpathmoveto{\pgfpoint{ 0 }{ \l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ -\l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ 0 }{ -\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ -0.5*\l__tikzfill_hex_as_tl }} + \pgfpathlineto{\pgfpoint{ \l__tikzfill_hex_bs_tl }{ 0.5*\l__tikzfill_hex_as_tl }} + \pgfpathclose + \pgfusepath{stroke} + } + + +\tikzset{ + pattern~hexagon~cycle /.style = + { + preaction={pattern={hexagon~cycle[#1,band=1]}}, + pattern={hexagon~cycle[#1,band=0]}% + } +} + + +\ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex/tikzfill/tikzlibraryfill.image.code.tex b/Master/texmf-dist/tex/latex/tikzfill/tikzlibraryfill.image.code.tex new file mode 100644 index 00000000000..ed20d0e7808 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikzfill/tikzlibraryfill.image.code.tex @@ -0,0 +1,400 @@ +%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20) +%% tikzlibraryfill.image.code.tex: filling with images +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% 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. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README.md +%% +\ProvidesFile{tikzlibraryfill.image.code.tex}[2022/07/20 v1.0.0 Image filling library] + +\ExplSyntaxOn + +\box_new:N \l__tikzfill_img_box + +\tl_new:N \l__tikzfill_img_xa_tl +\tl_new:N \l__tikzfill_img_xb_tl +\tl_new:N \l__tikzfill_img_ya_tl +\tl_new:N \l__tikzfill_img_yb_tl +\tl_new:N \l__tikzfill_img_xc_tl +\tl_new:N \l__tikzfill_img_yc_tl +\tl_new:N \l__tikzfill_img_width_tl +\tl_new:N \l__tikzfill_img_height_tl + +\tl_new:N \l__tikzfill_img_opacity_tl +\tl_new:N \l__tikzfill_img_scale_tl +\tl_new:N \l__tikzfill_img_graphics_options_tl + +\fp_new:N \l__tikzfill_img_scale_x_fp +\fp_new:N \l__tikzfill_img_scale_y_fp + + +\cs_new_nopar:Npn \__tikzfill_img_process_ppbb: + { + \pgf@process{\pgfpointanchor{path~picture~bounding~box}{south~west}} + \tl_set:Nx \l__tikzfill_img_xa_tl { \dim_eval:n { \pgf@x } } + \tl_set:Nx \l__tikzfill_img_ya_tl { \dim_eval:n { \pgf@y } } + \pgf@process{\pgfpointanchor{path~picture~bounding~box}{north~east}} + \tl_set:Nx \l__tikzfill_img_xb_tl { \dim_eval:n { \pgf@x } } + \tl_set:Nx \l__tikzfill_img_yb_tl { \dim_eval:n { \pgf@y } } + \tl_set:Nx \l__tikzfill_img_width_tl { \dim_eval:n { \pgf@x - \l__tikzfill_img_xa_tl } } + \tl_set:Nx \l__tikzfill_img_height_tl { \dim_eval:n { \pgf@y - \l__tikzfill_img_ya_tl } } + \pgfsetfillopacity{\l__tikzfill_img_opacity_tl} + \pgfsetstrokeopacity{\l__tikzfill_img_opacity_tl} + } + + +\cs_new_nopar:Npn \__tikzfill_img_path_picture:n #1 + { + \pgfkeysalso + { + path~picture = + { + \__tikzfill_img_process_ppbb: + #1 + } + } + } + + +\cs_new_nopar:Npn \__tikzfill_img_draw_textbox:n #1 + { + \pgftext + [ + x = \dim_eval:n { \l__tikzfill_img_xa_tl + \l__tikzfill_img_width_tl/2 }, + y = \dim_eval:n { \l__tikzfill_img_ya_tl + \l__tikzfill_img_height_tl/2 } + ]{ #1 } + } + + +\cs_new_nopar:Npn \__tikzfill_img_include_graphics:n #1 + { + \tl_set_eq:NN \l_tmpa_tl \l__tikzfill_img_graphics_options_tl + \tl_if_empty:NTF \l_tmpa_tl + { + \tl_set:Nn \l_tmpa_tl { \includegraphics } + } + { + \tl_put_left:Nn \l_tmpa_tl { \includegraphics[ } + \tl_put_right:Nn \l_tmpa_tl { ] } + } + \l_tmpa_tl { #1 } + } + + +\cs_new_nopar:Npn \__tikzfill_img_set_box_to_image:n #1 + { + \hbox_set:Nn \l__tikzfill_img_box + { + \pgfinterruptpicture + \group_begin: + \__tikzfill_img_include_graphics:n { #1 } + \group_end: + \endpgfinterruptpicture + } + } + + + +\cs_new_nopar:Npn \__tikzfill_img_set_box_to_picture:n #1 + { + \hbox_set:Nn \l__tikzfill_img_box + { + \pgfinterruptpicture + \group_begin: + \pgfsetbaseline{0pt} + \tikzpicture#1\endtikzpicture + \group_end: + \endpgfinterruptpicture + } + } + + +\cs_new_nopar:Npn \__tikzfill_img_draw_box: + { + \__tikzfill_img_draw_textbox:n + { + \box_use_drop:N \l__tikzfill_img_box + } + } + + +\cs_new_nopar:Npn \__tikzfill_img_stretch_draw_box: + { + \box_resize_to_wd_and_ht_plus_dp:Nnn \l__tikzfill_img_box + { \fp_to_dim:n { \l__tikzfill_img_scale_tl*\l__tikzfill_img_width_tl }} + { \fp_to_dim:n { \l__tikzfill_img_scale_tl*\l__tikzfill_img_height_tl }} + \__tikzfill_img_draw_box: + } + + +\cs_new_nopar:Npn \xxxx__tikzfill_img_compute_scales: + { + \fp_set:Nn \l_tmpa_fl { \box_wd:N \l__tikzfill_img_box } + \fp_compare:nNnTF \l_tmpa_fl < {1pt} + { + \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \c_one_fp + } + { + \fp_set:Nn \l__tikzfill_img_scale_x_fp + { + \l__tikzfill_img_scale_tl*\l__tikzfill_img_width_tl / \l_tmpa_fl + } + } + \fp_set:Nn \l_tmpb_fl { \box_ht:N \l__tikzfill_img_box + \box_dp:N \l__tikzfill_img_box } + \fp_compare:nNnTF \l_tmpb_fl < {1pt} + { + \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \c_one_fp + } + { + \fp_set:Nn \l__tikzfill_img_scale_y_fp + { + \l__tikzfill_img_scale_tl*\l__tikzfill_img_height_tl / \l_tmpb_fl + } + } + } + + +\cs_new_nopar:Npn \__tikzfill_img_compute_scales: + { + \dim_set:Nn \l_tmpa_dim { \box_wd:N \l__tikzfill_img_box } + \dim_compare:nNnTF \l_tmpa_dim < {1pt} + { + \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \c_one_fp + } + { + \fp_set:Nn \l__tikzfill_img_scale_x_fp + { + \l__tikzfill_img_scale_tl * \l__tikzfill_img_width_tl / \l_tmpa_dim + } + } + \dim_set:Nn \l_tmpb_dim { \box_ht:N \l__tikzfill_img_box + \box_dp:N \l__tikzfill_img_box } + \dim_compare:nNnTF \l_tmpb_dim < {1pt} + { + \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \c_one_fp + } + { + \fp_set:Nn \l__tikzfill_img_scale_y_fp + { + \l__tikzfill_img_scale_tl * \l__tikzfill_img_height_tl / \l_tmpb_dim + } + } + } + + +\cs_new_nopar:Npn \__tikzfill_img_scale_draw_box: + { + \box_scale:Nnn \l__tikzfill_img_box + { \fp_to_dim:N \l__tikzfill_img_scale_x_fp } + { \fp_to_dim:N \l__tikzfill_img_scale_y_fp } + \__tikzfill_img_draw_box: + } + + +\cs_new_nopar:Npn \__tikzfill_img_overzoom_draw_box: + { + \__tikzfill_img_compute_scales: + \fp_compare:nNnTF \l__tikzfill_img_scale_x_fp > \l__tikzfill_img_scale_y_fp + { \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \l__tikzfill_img_scale_x_fp } + { \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \l__tikzfill_img_scale_y_fp } + \__tikzfill_img_scale_draw_box: + } + + +\cs_new_nopar:Npn \__tikzfill_img_zoom_draw_box: + { + \__tikzfill_img_compute_scales: + \fp_compare:nNnTF \l__tikzfill_img_scale_x_fp > \l__tikzfill_img_scale_y_fp + { \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \l__tikzfill_img_scale_y_fp } + { \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \l__tikzfill_img_scale_x_fp } + \__tikzfill_img_scale_draw_box: + } + + +\cs_new_nopar:Npn \__tikzfill_img_shrink_draw_box: + { + \__tikzfill_img_compute_scales: + \fp_compare:nNnTF \l__tikzfill_img_scale_x_fp > \l__tikzfill_img_scale_y_fp + { \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \l__tikzfill_img_scale_y_fp } + { \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \l__tikzfill_img_scale_x_fp } + \fp_compare:nNnT \l__tikzfill_img_scale_x_fp > 1 + { + \fp_set_eq:NN \l__tikzfill_img_scale_x_fp \c_one_fp + \fp_set_eq:NN \l__tikzfill_img_scale_y_fp \c_one_fp + } + \__tikzfill_img_scale_draw_box: + } + + +\cs_new_nopar:Npn \__tikzfill_img_tile_draw_box: + { + \dim_set:Nn \l_tmpa_dim { \box_wd:N \l__tikzfill_img_box } + \dim_set:Nn \l_tmpb_dim { \box_ht:N \l__tikzfill_img_box + \box_dp:N \l__tikzfill_img_box } + \dim_set:Nn \l_tmpb_dim { -\l_tmpb_dim } + + \dim_step_variable:nnnNn + { \l__tikzfill_img_xa_tl } + { \l_tmpa_dim } + { \l__tikzfill_img_xb_tl } + \l__tikzfill_img_xc_tl + { + \dim_step_variable:nnnNn + { \l__tikzfill_img_yb_tl } + { \l_tmpb_dim } + { \l__tikzfill_img_ya_tl } + \l__tikzfill_img_yc_tl + { + \pgftext + [ + x = \l__tikzfill_img_xc_tl, + y = \l__tikzfill_img_yc_tl, + left, + top + ] + { \box_use:N\l__tikzfill_img_box } + } + } + } + + +\tikzset + { + fill~image~opacity/.store~in=\l__tikzfill_img_opacity_tl, + fill~image~opacity=1, + fill~image~scale/.store~in=\l__tikzfill_img_scale_tl, + fill~image~scale=1, + fill~image~options/.store~in=\l__tikzfill_img_graphics_options_tl, + fill~image~options=, + fill~plain~image/.code= + { + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_draw_textbox:n + { + \__tikzfill_img_include_graphics:n { #1 } + } + } + }, + fill~plain~picture/.code= + { + \__tikzfill_img_set_box_to_picture:n { #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_draw_box: + } + }, + fill~stretch~image/.code= + { + \__tikzfill_img_set_box_to_image:n { #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_stretch_draw_box: + } + }, + fill~stretch~picture/.code= + { + \__tikzfill_img_set_box_to_picture:n { #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_stretch_draw_box: + } + }, + fill~overzoom~image/.code= + { + \__tikzfill_img_set_box_to_image:n { #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_overzoom_draw_box: + } + }, + fill~overzoom~picture/.code= + { + \__tikzfill_img_set_box_to_picture:n { #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_overzoom_draw_box: + } + }, + fill~zoom~image/.code= + { + \__tikzfill_img_set_box_to_image:n { #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_zoom_draw_box: + } + }, + fill~zoom~picture/.code= + { + \__tikzfill_img_set_box_to_picture:n { #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_zoom_draw_box: + } + }, + fill~shrink~image/.code= + { + \__tikzfill_img_set_box_to_image:n { #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_shrink_draw_box: + } + }, + fill~shrink~picture/.code= + { + \__tikzfill_img_set_box_to_picture:n { #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_shrink_draw_box: + } + }, + fill~tile~image/.code= + { + \__tikzfill_img_set_box_to_image:n { #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_tile_draw_box: + } + }, + fill~tile~picture/.code= + { + \__tikzfill_img_set_box_to_picture:n { #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_tile_draw_box: + } + }, + fill~tile~picture*/.code~n~args={2} + { + \__tikzfill_img_set_box_to_picture:n { #2 } + \box_scale:Nnn \l__tikzfill_img_box { #1 }{ #1 } + \__tikzfill_img_path_picture:n + { + \__tikzfill_img_tile_draw_box: + } + }, + } + + +\ExplSyntaxOff + +\tikzset + { + fill plain image*/.style n args={2}{fill image options={#1},fill plain image={#2}},% + fill stretch image*/.style n args={2}{fill image options={#1},fill stretch image={#2}},% + fill overzoom image*/.style n args={2}{fill image options={#1},fill overzoom image={#2}},% + fill zoom image*/.style n args={2}{fill image options={#1},fill zoom image={#2}},% + fill shrink image*/.style n args={2}{fill image options={#1},fill shrink image={#2}},% + fill tile image*/.style n args={2}{fill image options={#1},fill tile image={#2}},% + } + diff --git a/Master/texmf-dist/tex/latex/tikzfill/tikzlibraryfill.rhombus.code.tex b/Master/texmf-dist/tex/latex/tikzfill/tikzlibraryfill.rhombus.code.tex new file mode 100644 index 00000000000..e425470c44b --- /dev/null +++ b/Master/texmf-dist/tex/latex/tikzfill/tikzlibraryfill.rhombus.code.tex @@ -0,0 +1,159 @@ +%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20) +%% tikzlibraryfill.rhombus.code.tex: filling with rhombus patterns +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2022-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% 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. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README.md +%% +\ProvidesFile{tikzlibraryfill.rhombus.code.tex}[2022/07/15 v0.0.1 Rhombus pattern library] + +\usetikzlibrary{patterns.meta} + +\ExplSyntaxOn + +\fp_new:N \l__tikzfill_rho_angle_fp +\fp_new:N \l__tikzfill_rho_d_fp +\fp_new:N \l__tikzfill_rho_s_fp + +\tl_new:N \l__tikzfill_rho_dsize_tl +\tl_new:N \l__tikzfill_rho_linewidth_tl +\tl_new:N \l__tikzfill_rho_matrix_a_tl +\tl_new:N \l__tikzfill_rho_matrix_b_tl +\tl_new:N \l__tikzfill_rho_matrix_c_tl +\tl_new:N \l__tikzfill_rho_matrix_d_tl +\tl_new:N \l__tikzfill_rho_poffset_tl +\tl_new:N \l__tikzfill_rho_psize_tl +\tl_new:N \l__tikzfill_rho_size_tl + + +\pgfdeclarepattern + { + name = rhombus, + parameters = + { + \pgfkeysvalueof{/pgf/pattern~keys/size}, + \pgfkeysvalueof{/pgf/pattern~keys/angle}, + \pgfkeysvalueof{/pgf/pattern~keys/ratio}, + \pgfkeysvalueof{/pgf/pattern~keys/xshift}, + \pgfkeysvalueof{/pgf/pattern~keys/yshift}, + \pgfkeysvalueof{/pgf/pattern~keys/line~width}, + \pgfkeysvalueof{/pgf/pattern~keys/pos}, + \pgfkeysvalueof{/pgf/pattern~keys/band}, + \pgfkeysvalueof{/pgf/pattern~keys/_fill_}, + }, + defaults = + { + size /.initial = 10mm, + angle /.initial = -40, + ratio /.initial = 2, + xshift /.initial = 0pt, + yshift /.initial = 0pt, + line~width /.initial = 0.4pt, + pos /.initial = 1, + band /.initial = 0, + _fill_ /.initial = 1, + fill /.style = { _fill_=1 }, + draw /.style = { _fill_=0 }, + }, + set~up~code = + { + \tl_set:Nx \l__tikzfill_rho_linewidth_tl { \fp_to_dim:n { \pgfkeysvalueof{/pgf/pattern~keys/line~width} } } + + \fp_set:Nn \l_tmpa_fp { \pgfkeysvalueof{/pgf/pattern~keys/size} } + \tl_set:Nx \l__tikzfill_rho_size_tl { \fp_to_dim:N \l_tmpa_fp } + \tl_set:Nx \l__tikzfill_rho_dsize_tl { \fp_to_dim:n { 2 * \l_tmpa_fp } } + + \fp_set:Nn \l_tmpb_fp { min ( 1, max( 0, \pgfkeysvalueof{/pgf/pattern~keys/pos} )) } + \tl_set:Nx \l__tikzfill_rho_psize_tl { \fp_to_dim:n { \l_tmpa_fp * \l_tmpb_fp } } + \tl_set:Nx \l__tikzfill_rho_poffset_tl { \fp_to_dim:n { \l_tmpa_fp * (1-\l_tmpb_fp)/2 } } + + \fp_set:Nn \l__tikzfill_rho_angle_fp { \pgfkeysvalueof{/pgf/pattern~keys/angle} } + + \fp_set:Nn \l_tmpa_fp { max( 1 , \pgfkeysvalueof{/pgf/pattern~keys/ratio} ) } + \fp_set:Nn \l_tmpa_fp { \l_tmpa_fp*\l_tmpa_fp } + \fp_set:Nn \l__tikzfill_rho_s_fp{ (\l_tmpa_fp-1)/(\l_tmpa_fp+1) } + + \fp_set:Nn \l__tikzfill_rho_d_fp { sqrt( 1 - \l__tikzfill_rho_s_fp * \l__tikzfill_rho_s_fp ) } + \fp_set:Nn \l_tmpb_fp + { + \l__tikzfill_rho_angle_fp - atand( \l__tikzfill_rho_d_fp / ( 1 + \l__tikzfill_rho_s_fp ) ) + } + \fp_set:Nn \l_tmpa_fp { cosd(\l_tmpb_fp) } + \fp_set:Nn \l_tmpb_fp { sind(\l_tmpb_fp) } + + \tl_set:Nx \l__tikzfill_rho_matrix_a_tl { \fp_to_decimal:N \l_tmpa_fp } + \tl_set:Nx \l__tikzfill_rho_matrix_b_tl { \fp_to_decimal:N \l_tmpb_fp } + \tl_set:Nx \l__tikzfill_rho_matrix_c_tl { \fp_to_decimal:n + { + \l__tikzfill_rho_s_fp * \l_tmpa_fp - \l__tikzfill_rho_d_fp * \l_tmpb_fp + }} + \tl_set:Nx \l__tikzfill_rho_matrix_d_tl { \fp_to_decimal:n + { + \l__tikzfill_rho_s_fp * \l_tmpb_fp + \l__tikzfill_rho_d_fp * \l_tmpa_fp + }} + }, + bottom~left = { \pgfpoint{-\l__tikzfill_rho_linewidth_tl}{-\l__tikzfill_rho_linewidth_tl} }, + top~right = { \pgfpoint{\l__tikzfill_rho_dsize_tl+\l__tikzfill_rho_linewidth_tl} + {\l__tikzfill_rho_dsize_tl+\l__tikzfill_rho_linewidth_tl} }, + tile~size = { \pgfqpoint{\l__tikzfill_rho_dsize_tl}{\l__tikzfill_rho_dsize_tl} }, + tile~transformation = + { + \pgftransformshift + { + \pgfpoint{ \pgfkeysvalueof{/pgf/pattern~keys/xshift} } + { \pgfkeysvalueof{/pgf/pattern~keys/yshift} } + } + \pgftransformcm{\l__tikzfill_rho_matrix_a_tl}{\l__tikzfill_rho_matrix_b_tl} + {\l__tikzfill_rho_matrix_c_tl}{\l__tikzfill_rho_matrix_d_tl} + {\pgfpointorigin} + }, + code = + { + \int_set:Nn \l_tmpa_int { \pgfkeysvalueof{/pgf/pattern~keys/band} } + \int_compare:nNnF \l_tmpa_int = 1 + { + \pgfpathrectangle{\pgfqpoint{\l__tikzfill_rho_poffset_tl}{\l__tikzfill_rho_poffset_tl}} + {\pgfqpoint{\l__tikzfill_rho_psize_tl}{\l__tikzfill_rho_psize_tl}} + \pgfpathrectangle{\pgfpoint{\l__tikzfill_rho_size_tl+\l__tikzfill_rho_poffset_tl}{\l__tikzfill_rho_size_tl+\l__tikzfill_rho_poffset_tl}} + {\pgfqpoint{\l__tikzfill_rho_psize_tl}{\l__tikzfill_rho_psize_tl}} + } + \int_compare:nNnT \l_tmpa_int > 0 + { + \pgfpathrectangle{\pgfpoint{\l__tikzfill_rho_poffset_tl}{\l__tikzfill_rho_size_tl+\l__tikzfill_rho_poffset_tl}} + {\pgfqpoint{\l__tikzfill_rho_psize_tl}{\l__tikzfill_rho_psize_tl}} + \pgfpathrectangle{\pgfpoint{\l__tikzfill_rho_size_tl+\l__tikzfill_rho_poffset_tl}{\l__tikzfill_rho_poffset_tl}} + {\pgfqpoint{\l__tikzfill_rho_psize_tl}{\l__tikzfill_rho_psize_tl}} + } + \int_compare:nNnTF { \pgfkeysvalueof{/pgf/pattern~keys/_fill_} } = 1 + { + \pgfusepath{fill} + } + { + \pgfsetlinewidth{\l__tikzfill_rho_linewidth_tl} + \pgfusepath{draw} + } + } + } + + +\tikzset{ + pattern~rhombus /.style = + { + pattern={rhombus[#1]} + } +} + + +\ExplSyntaxOff |