diff options
author | Karl Berry <karl@freefriends.org> | 2022-07-20 20:21:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-07-20 20:21:23 +0000 |
commit | db0f94e9ad3d312bd60fa58f13881909d8c22c9a (patch) | |
tree | e16a2e71c7f97072ae0f28c910ec4161090e6a1d | |
parent | 9abe5e7e81cc75e9a63b9bbdffb081bdfc88e1b0 (diff) |
tikzfill (20jul22)
git-svn-id: svn://tug.org/texlive/trunk@63947 c570f23f-e606-0410-a88d-b1316a301751
16 files changed, 2622 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/tikzfill/CHANGES.md b/Master/texmf-dist/doc/latex/tikzfill/CHANGES.md new file mode 100644 index 00000000000..23037f13d1c --- /dev/null +++ b/Master/texmf-dist/doc/latex/tikzfill/CHANGES.md @@ -0,0 +1,23 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on +[Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to +[Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added +### Changed +### Deprecated +### Removed +### Fixed +### Security + + + +## [1.00] - 2022-07-20 + +### Added +- Initial public release diff --git a/Master/texmf-dist/doc/latex/tikzfill/README.md b/Master/texmf-dist/doc/latex/tikzfill/README.md new file mode 100644 index 00000000000..2ce0a8735a9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tikzfill/README.md @@ -0,0 +1,56 @@ +# The LaTeX package tikzfill - version 1.0.0 (2022/07/20) + + +> 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 + + +`tikzfill` is a collection of *TikZ* libraries which add +further options to fill *TikZ* paths with images and +patterns. The libraries comprise fillings with images from +files and from *TikZ* pictures. Also, patterns of hexagons +and of rhombi are provided. + + +## Contents of the package + +- `README.md` this file +- `CHANGES.md` log of changes (history) +- `tikzfill.sty` LaTeX package file (style file) +- `tikzfill-common.sty` LaTeX package file (style file) +- `tikzfill.hexagon.sty` LaTeX package file (style file) +- `tikzfill.image.sty` LaTeX package file (style file) +- `tikzfill.rhombus.sty` LaTeX package file (style file) +- `tikzlibraryfill.hexagon.code.tex` TikZ library file +- `tikzlibraryfill.image.code.tex` TikZ library file +- `tikzlibraryfill.rhombus.code.tex` TikZ library file +- `tikzfill.pdf` Documentation for tikzfill +- `tikzfill.tex` Source code of the documentation +- `tikzfill-doc.sty` Source code of the documentation + + +## Installation + +Copy the contents of the `tikzfill.tds.zip` from CTAN to your local TeX file tree. + +Alternatively, put the files to their respective locations within the TeX installation: + +- `tikzfill.sty` -> /tex/latex/tikzfill +- `tikzfill-common.sty` -> /tex/latex/tikzfill +- `tikzfill.hexagon.sty` -> /tex/latex/tikzfill +- `tikzfill.image.sty` -> /tex/latex/tikzfill +- `tikzfill.rhombus.sty` -> /tex/latex/tikzfill +- `tikzlibraryfill.hexagon.code.tex` -> /tex/latex/tikzfill +- `tikzlibraryfill.image.code.tex` -> /tex/latex/tikzfill +- `tikzlibraryfill.rhombus.code.tex` -> /tex/latex/tikzfill diff --git a/Master/texmf-dist/doc/latex/tikzfill/tikzfill-doc.sty b/Master/texmf-dist/doc/latex/tikzfill/tikzfill-doc.sty new file mode 100644 index 00000000000..60b1320964b --- /dev/null +++ b/Master/texmf-dist/doc/latex/tikzfill/tikzfill-doc.sty @@ -0,0 +1,130 @@ +% !TeX encoding=UTF-8 +%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20) +%% tikzfill-doc.sty: style file for the documentation +%% +%% ------------------------------------------------------------------------------------------- +%% 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 +%% +\def\version{1.0.0}% +\def\datum{2022/07/20}% + +\def\tikzfillpkgprefix{} +\IfFileExists{tikzfill-doc.cfg}{\input{tikzfill-doc.cfg}}{} + +% prevent hypdoc from loading (sets hyperindex=false) +%\@namedef{ver@hypdoc.sty}{9999/12/31} +%\@namedef{opt@hypdoc.sty}{hypdoc} + + +\RequirePackage[T1]{fontenc} +\RequirePackage[utf8]{inputenc} +\RequirePackage[english]{babel} +\RequirePackage{lmodern,parskip,array,makeidx} +\RequirePackage{amsmath,amssymb} +\RequirePackage[svgnames,table,hyperref]{xcolor} +\RequirePackage{tikz,siunitx,xfp,tabularray} +\usetikzlibrary{patterns,shadings,fadings} +\RequirePackage{varioref} +\RequirePackage[pdftex,bookmarks,raiselinks,pageanchor,hyperindex,colorlinks]{hyperref} +\urlstyle{sf} +\RequirePackage{cleveref} + +\RequirePackage[a4paper,left=2.5cm,right=2.5cm,top=1.5cm,bottom=1.5cm, + marginparsep=3mm,marginparwidth=18mm, + headheight=0mm,headsep=0cm, + footskip=1.5cm,includeheadfoot]{geometry} +\RequirePackage{fancyhdr} +\fancyhf{} +\fancyfoot[C]{\thepage}% +\renewcommand{\headrulewidth}{0pt} +\renewcommand{\footrulewidth}{0pt} +\pagestyle{fancy} +\tolerance=2000% +\setlength{\emergencystretch}{20pt}% + +\RequirePackage{longtable,booktabs,ifthen,etoolbox} + +\RequirePackage{shortvrb} +\AtBeginDocument{\MakeShortVerb{\|}} + +\RequirePackage{tcolorbox} +\tcbuselibrary{skins,minted,breakable,documentation,raster,hooks} + +\definecolor{Green_Dark}{rgb}{0.078431,0.407843,0.176471} +\definecolor{Blue_Dark}{rgb}{0.090196,0.211765,0.364706} +\definecolor{Blue_Bright}{rgb}{0.858824,0.898039,0.945098} + +\tcbset{skin=enhanced, + sbs/.style={sidebyside,before lower app={\tcbset{sidebyside=false}}}, + minted options={fontsize=\footnotesize}, + doc raster={raster before skip=4mm plus 2mm minus 1mm}, + doc head={colback=yellow!10!white,interior style=fill}, + doc head key={colback=magenta!5!white,interior style=fill}, + color key=DarkViolet, + color value=Teal, + color color=Teal, + color counter=Orange!85!black, + color length=Orange!85!black, + index colorize, + index annotate, + beforeafter example/.style={ + before skip balanced=4pt plus 2pt minus 1pt, + after skip balanced=6pt plus 2pt minus 1pt + }, + docexample/.style={bicolor, + beforeafter example, + arc is angular,fonttitle=\bfseries, + fontlower=\footnotesize, + colframe=green!25!yellow!50!black, + colback=green!25!yellow!7, + colbacklower=white, + drop fuzzy shadow=green!25!yellow!50!black, + listing engine=minted, + documentation minted style=colorful, + documentation minted options={fontsize=\footnotesize}, + }, +} + +\renewcommand*{\tcbdocnew}[1]{\textcolor{green!50!black}{\sffamily\bfseries N} #1} +\renewcommand*{\tcbdocupdated}[1]{\textcolor{blue!75!black}{\sffamily\bfseries U} #1} + +\NewDocumentCommand{\csvsorter}{}{\textsf{\bfseries\color{red!20!black}CSV-Sorter}} + +\newtcbinputlisting{\csvlisting}[1]{docexample,minted options={fontsize=\footnotesize},minted language=latex, + fonttitle=\bfseries,listing only,title={CSV file \flqq\texttt{\detokenize{#1.csv}}\frqq},listing file=#1.csv} + +\newtcbinputlisting{\xmllisting}[1]{docexample,minted options={fontsize=\footnotesize},minted language=xml, + fonttitle=\bfseries,listing only,title={Configuration file \flqq\texttt{\detokenize{#1.xml}}\frqq},listing file=#1.xml} + +\NewTotalTCBox{\verbbox}{m}{enhanced,on line,size=fbox,frame empty,colback=red!5!white, + colupper=red!85!black,fontupper=\bfseries\ttfamily}{\detokenize{"}#1\detokenize{"}} + +\NewDocumentCommand{\ctanpkg}{m} + {% + \href{https://ctan.org/pkg/#1}{\texttt{#1}}% + } + +\def\tikzname{Ti\emph{k}Z} + +\tcbmakedocSubKey{docTikzKey}{tikz} +\tcbmakedocSubKeys{docTikzKeys}{tikz} +\tcbmakedocSubKey{docPatternKey}{pgf/pattern keys} +\tcbmakedocSubKeys{docPatternKeys}{pgf/pattern keys} + + +\makeindex + +\pdfsuppresswarningpagegroup=1 diff --git a/Master/texmf-dist/doc/latex/tikzfill/tikzfill.pdf b/Master/texmf-dist/doc/latex/tikzfill/tikzfill.pdf Binary files differnew file mode 100644 index 00000000000..e68d134f782 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tikzfill/tikzfill.pdf diff --git a/Master/texmf-dist/doc/latex/tikzfill/tikzfill.tex b/Master/texmf-dist/doc/latex/tikzfill/tikzfill.tex new file mode 100644 index 00000000000..4762f597713 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tikzfill/tikzfill.tex @@ -0,0 +1,1385 @@ +% \LaTeX-Main\ +% !TeX encoding=UTF-8 +%% The LaTeX package tikzfill - version 1.0.0 (2022/07/20) +%% tikzfill.tex: Manual +%% +%% ------------------------------------------------------------------------------------------- +%% 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 +%% +% \RequirePackage[check-declarations,enable-debug]{expl3} +\documentclass[a4paper,11pt]{article} +\usepackage{tikzfill-doc} + +\usepackage{\tikzfillpkgprefix tikzfill} + +\hypersetup{ + pdftitle={Manual for the tikzfill package}, + pdfauthor={Thomas F. Sturm}, + pdfsubject={TikZ libraries for filling with images and patterns}, +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} + +\begin{tcboutputlisting} +% \documentclass[a4paper]{article} +% \usepackage{tikzfill} +% \usetikzlibrary{fadings,shadings} +% \usepackage[skins,breakable]{tcolorbox} +% \usepackage{ninecolors} +% \begin{document} +\begin{tcolorbox}[spread,blankest,phantom={\thispagestyle{empty}}] +\begin{tikzfadingfrompicture}[name=titlepicture] + \path + [ + pattern hexagon cycle = { size=28mm, rings=5 }, + pattern color = white, + ] + (-\tcbtextwidth/2,-\tcbtextheight/2) rectangle + (\tcbtextwidth/2,\tcbtextheight/2); +\end{tikzfadingfrompicture}% +% +\begin{tikzpicture} + \fill + [ + upper left = blue5, upper right = cyan5, + lower left = magenta5, lower right = blue5, + ] + (-\tcbtextwidth/2,-\tcbtextheight/2) rectangle + (\tcbtextwidth/2,\tcbtextheight/2); +\shade + [ + path fading = titlepicture, + fit fading = false, + upper left = blue6, upper right = cyan6, + lower left = magenta6, lower right = blue6, + ] + (-\tcbtextwidth/2,-\tcbtextheight/2) rectangle + (\tcbtextwidth/2,\tcbtextheight/2); +\node[white,font=\Huge\bfseries] (title) at (0,\tcbtextheight/4) + {The \texttt{tikzfill} package}; +\node[white,font=\Large\bfseries,below=8mm] (title) at (title.south) + {Manual for version \version\ (\datum)}; +\node[white,font=\large\bfseries,below=8mm] (title) at (title.south) + {Thomas F.~Sturm}; +\end{tikzpicture} +\end{tcolorbox} +% \end{document} +\end{tcboutputlisting} +\tcbuselistingtext +\tcbinputlisting{title=Cover code,docexample,listing only} + +\clearpage + +\begin{center} +\begin{tcolorbox}[enhanced,hbox,tikznode,left=8mm,right=8mm,boxrule=0.4pt, + colback=white,colframe=black!50!yellow, + drop lifted shadow=black!50!yellow,arc is angular, + before=\par\vspace*{5mm},after=\par\bigskip] +{\bfseries\LARGE The \texttt{tikzfill} package}\\[3mm] +{\large Manual for version \version\ (\datum)} +\end{tcolorbox} +{\large Thomas F.~Sturm% + \footnote{Prof.~Dr.~Dr.~Thomas F.~Sturm, Institut f\"{u}r Mathematik und Informatik, + Universit\"{a}t der Bundeswehr M\"{u}nchen, D-85577 Neubiberg, Germany; + email: \href{mailto:thomas.sturm@unibw.de}{thomas.sturm@unibw.de}}\par\medskip +\normalsize\url{https://www.ctan.org/pkg/tikzfill}\par +\url{https://github.com/T-F-S/tikzfill} +} +\end{center} +\bigskip +\begin{absquote} + \begin{center}\bfseries Abstract\end{center} + |tikzfill| is a collection of \tikzname\ libraries which add further + options to fill \tikzname\ paths with images and patterns. + The libraries comprise fillings with images from files and from \tikzname\ pictures. + Also, patterns of hexagons and of rhombi are provided. +\end{absquote} + +\clearpage +\tableofcontents + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\clearpage +\section{Short Introduction}\label{sec:intro} + +\tikzname\ is a very advanced and comprehensive graphics package for \LaTeX. +The package |tikzfill| comprises a collection of libraries for \tikzname\, which +add further options to fill \tikzname\ paths with images and patterns. + +For \LaTeX, the provided libraries can be loaded using the preferred +\tikzname\ mechanism by +\begin{dispListing*}{} +\usetikzlibrary{fill.***} % LATEX (primary choice) and plain TEX +\end{dispListing*} +where |***| is to be replaced by the actual library name found on the following pages. + +Alternatively, the libraries can be loaded using \LaTeX\ style files +\begin{dispListing*}{} +\usepackage{tikzfill.***} % LATEX (secondary choice) +\end{dispListing*} + +If you want to load all \tikzname\ libraries of this package, you can use +the following \LaTeX\ style file +\begin{dispListing*}{} +\usepackage{tikzfill} % load all libraries +\end{dispListing*} + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\clearpage +\section{Image and Picture Fill Library}\label{sec:imagefill}% + +\begin{dispListing*}{title=\tikzname\ Library |fill.image|} +\usetikzlibrary{fill.image} % LATEX (primary choice) and plain TEX +\usetikzlibrary[fill.image] % ConTEXt +\usepackage{tikzfill.image} % LATEX (secondary choice) +\end{dispListing*} + +This library defines options to fill graphs with images or arbitray pictures. + +Until |tcolorbox| version 5.1.1 (2022/06/24), the code of this library was part +of |tcolorbox|. Now, on suggestion of +\href{https://github.com/muzimuzhi}{muzimuzhi}, +it is a separate library usable without |tcolorbox|. Also, the code is +completely rewritten with |expl3|. + + + +\subsection{Fill Plain} +\begin{docTikzKey}{fill plain image}{=\meta{file name}}{no default, initially unset} + Fills the current path with an external image referenced by \meta{file name}. + The image is put in the center of the path, but it is not resized to fit into + the path area. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw,fill plain image=goldshade.png] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docTikzKey}{fill plain image*}{=\meta{file name}}{no default, initially unset} + Fills the current path with an external image referenced by \meta{file name}. + The image is put in the center of the path, but it is not resized to fit into + the path area. + The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw, + fill plain image*={width=2.5cm}{goldshade.png}] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + +\enlargethispage*{8mm} + +\begin{docTikzKey}{fill plain picture}{=\meta{graphical code}}{no default, initially unset} + Fills the current path with the given \meta{graphical code}. + The result is put in the center of the path, but it is not resized to fit into + the path area. Note that this is almost identical to the standard |path picture| option. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw,fill plain picture={% + \draw[red!50!yellow,line width=2mm] + (0,0) circle (8mm); + \draw[red,line width=5mm] (-1,-1) -- (1,1); + \draw[red,line width=5mm] (-1,1) -- (1,-1); + }] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\clearpage +\subsection{Fill Stretch} +\begin{docTikzKey}{fill stretch image}{=\meta{file name}}{no default, initially unset} + Fills the current path with an external image referenced by \meta{file name}. + The image is stretched to fill the path area. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[fill stretch image=goldshade.png] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docTikzKey}{fill stretch image*}{=\marg{graphics options}\marg{file name}}{no default, initially unset} + Fills the current path with an external image referenced by \meta{file name}. + The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command. + The image is stretched to fill the path area. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[fill stretch image*= + {angle=90,origin=c}{goldshade.png}] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docTikzKey}{fill stretch picture}{=\meta{graphical code}}{no default, initially unset} + Fills the current path with the given \meta{graphical code}. + The result is stretched to fill the path area. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw,fill stretch picture={% + \draw[red!50!yellow,line width=2mm] + (0,0) circle (8mm); + \draw[red,line width=5mm] (-1,-1) -- (1,1); + \draw[red,line width=5mm] (-1,1) -- (1,-1); + }] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\clearpage +\subsection{Fill Overzoom} +\begin{docTikzKey}{fill overzoom image}{=\meta{file name}}{no default, initially unset} + Fills the current path with an external image referenced by \meta{file name}. + The image is zoomed such that the path area fills the image. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[fill overzoom image=goldshade.png] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docTikzKey}{fill overzoom image*}{=\marg{graphics options}\marg{file name}}{no default, initially unset} + Fills the current path with an external image referenced by \meta{file name}. + The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command. + The image is zoomed such that the path area fills the image. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[fill overzoom image*= + {angle=90,origin=c}{goldshade.png}] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docTikzKey}{fill overzoom picture}{=\meta{graphical code}}{no default, initially unset} + Fills the current path with the given \meta{graphical code}. + The result is zoomed such that the path area fills the image. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw,fill overzoom picture={% + \draw[red!50!yellow,line width=2mm] + (0,0) circle (8mm); + \draw[red,line width=5mm] (-1,-1) -- (1,1); + \draw[red,line width=5mm] (-1,1) -- (1,-1); + }] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\clearpage +\subsection{Fill Zoom} +\begin{docTikzKey}{fill zoom image}{=\meta{file name}}{no default, initially unset} + Fills the current path with an external image referenced by \meta{file name}. + The image is zoomed such that it fits inside the path area. + Typically, some parts of the path area will stay unfilled. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw,fill zoom image=goldshade.png] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docTikzKey}{fill zoom image*}{=\marg{graphics options}\marg{file name}}{no default, initially unset} + Fills the current path with an external image referenced by \meta{file name}. + The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command. + The image is zoomed such that it fits inside the path area. + Typically, some parts of the path area will stay unfilled. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw,fill zoom image*= + {angle=90,origin=c}{goldshade.png}] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docTikzKey}{fill zoom picture}{=\meta{graphical code}}{no default, initially unset} + Fills the current path with the given \meta{graphical code}. + The result is zoomed such that it fits inside the path area. + Typically, some parts of the path area will stay unfilled. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw,fill zoom picture={% + \draw[red!50!yellow,line width=2mm] + (0,0) circle (8mm); + \draw[red,line width=5mm] (-1,-1) -- (1,1); + \draw[red,line width=5mm] (-1,1) -- (1,-1); + }] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\clearpage +\subsection{Fill Shrink} +\begin{docTikzKey}{fill shrink image}{=\meta{file name}}{no default, initially unset} + Fills the current path with an external image referenced by \meta{file name}. + The image is zoomed such that it fits inside the path area, but it never + gets enlarged. + Typically, some parts of the path area will stay unfilled. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw,fill shrink image=goldshade.png] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docTikzKey}{fill shrink image*}{=\meta{file name}}{no default, initially unset} + Fills the current path with an external image referenced by \meta{file name}. + The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command. + The image is zoomed such that it fits inside the path area, but it never + gets enlarged. + Typically, some parts of the path area will stay unfilled. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw, + fill shrink image*={width=1.5cm}{goldshade.png}] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docTikzKey}{fill shrink picture}{=\meta{graphical code}}{no default, initially unset} + Fills the current path with the given \meta{graphical code}. + The result is zoomed such that it fits inside the path area, but it never + gets enlarged. + Typically, some parts of the path area will stay unfilled. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw,fill shrink picture={% + \draw[red!50!yellow,line width=2mm] + (0,0) circle (8mm); + \draw[red,line width=5mm] (-1,-1) -- (1,1); + \draw[red,line width=5mm] (-1,1) -- (1,-1); + }] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\clearpage +\subsection{Fill Tile} +\begin{docTikzKey}{fill tile image}{=\meta{file name}}{no default, initially unset} + Fills the current path with a tile pattern using an external image referenced by \meta{file name}. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[fill tile image=pink_marble.png] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docTikzKey}{fill tile image*}{=\marg{graphics options}\marg{file name}}{no default, initially unset} + Fills the current path with a tile pattern using an external image referenced by \meta{file name}. + The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[fill tile image*={width=8mm}{pink_marble.png}] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + +\begin{docTikzKey}{fill tile picture}{=\meta{graphical code}}{no default, initially unset} + Fills the current path with a tile pattern using the given \meta{graphical code}. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw,fill tile picture={% + \draw[red!50!yellow,line width=2mm] + (0,0) circle (8mm); + \draw[red,line width=5mm] (-1,-1) -- (1,1); + \draw[red,line width=5mm] (-1,1) -- (1,-1); + }] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docTikzKey}{fill tile picture*}{=\marg{fraction}\marg{graphical code}}{no default, initially unset} + Fills the current path with a tile pattern using the given \meta{graphical code}. + The graphic is resized by \meta{fraction}. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[draw,fill tile picture*={0.25}{% + \draw[red!50!yellow,line width=2mm] + (0,0) circle (8mm); + \draw[red,line width=5mm] (-1,-1) -- (1,1); + \draw[red,line width=5mm] (-1,1) -- (1,-1); + }] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\clearpage +\subsection{Filling Options} +\begin{docTikzKey}{fill image opacity}{=\meta{fraction}}{no default, initially |1.0|} + Sets the fill opacity for the image or picture fill options to the given \meta{fraction}. +\begin{dispExample} +\begin{tikzpicture} +\path[fill stretch image=goldshade.png] (0,0) circle (8mm); +\path[fill=red,fill stretch image=goldshade.png,fill image opacity=0.75] + (2,0) circle (8mm); +\path[fill=red,fill stretch image=goldshade.png,fill image opacity=0.5] + (4,0) circle (8mm); +\path[fill=red,fill stretch image=goldshade.png,fill image opacity=0.25] + (6,0) circle (8mm); +\path[fill=red] (8,0) circle (8mm); +\end{tikzpicture} +\end{dispExample} +\end{docTikzKey} + + +\begin{docTikzKey}{fill image scale}{=\meta{fraction}}{no default, initially |1.0|} + Stretches, zooms, overzooms or shrinks the image or picture to the given \meta{fraction} of the + width and height of the current path. +\begin{dispExample} +\begin{tikzpicture} +\path[draw,fill zoom image=goldshade.png] + (0,0) rectangle +(2,2); + +\path[draw,fill zoom image=goldshade.png,fill image scale=0.75] + (3,0) rectangle +(2,2); + +\path[draw,fill zoom image=goldshade.png,fill image scale=1.5] + (6,0) rectangle +(2,2); +\end{tikzpicture} +\end{dispExample} +\end{docTikzKey} + + +\begin{docTikzKey}{fill image options}{=\meta{graphics options}}{no default, initially empty} + The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command + for the image fill options. This can be just together with + \refKey{/tikz/fill stretch image}, \refKey{/tikz/fill overzoom image}, \refKey{/tikz/fill zoom image}, + and \refKey{/tikz/fill tile image}. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\path[fill image options={width=8mm}, + fill tile image=pink_marble.png] + (2.75,-0.75) -- (3,0) -- (2.75,0.75) + \foreach \w in {45,90,...,315} + { -- (\w:1.5cm) } -- cycle; +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{dispExample*}{sbs,lefthand ratio=0.6,center lower,fonttitle=\bfseries, + title=Image blending example} +\begin{tikzpicture}[every node/.style= + {circle,minimum width=2cm}] +\node[fill stretch image=blueshade.png] + (A) at (120:3cm) {A}; +\node[fill stretch image=goldshade.png] + (B) at (60:3cm) {B}; +\node[ + preaction={fill stretch image=blueshade.png}, + fill stretch image=goldshade.png, + fill image opacity=0.5] (C) {C}; +\path (A) -- node{$+$} (B); +\draw[->,very thick] (A)--(C); +\draw[->,very thick] (B)--(C); +\end{tikzpicture} +\end{dispExample*} + + + + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\clearpage +\section{Hexagon Pattern Library}\label{sec:hexagon}% + +\begin{dispListing*}{title=\tikzname\ Library |fill.hexagon|} +\usetikzlibrary{fill.hexagon} % LATEX (primary choice) and plain TEX +\usetikzlibrary[fill.hexagon] % ConTEXt +\usepackage{tikzfill.hexagon} % LATEX (secondary choice) +\end{dispListing*} + +Based on |patterns.meta|, this library defines new hexagon patterns to fill graphs. + + + +%------------------------------------------------------------------------------- +\subsection{Hexagon} +The \docValue{hexagon} pattern draws hexagons which may be filled or outlined. +A single pattern is one of two different \emph{bands}, called band 0 and band 1. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern = { hexagon + [ + size = 5mm, angle = 15, line width = 1mm + ]}, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} + +Both bands together build a uniform combined pattern. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + preaction = { + pattern = { hexagon + [ + size = 5mm, angle = 15, line width = 1mm, band = 1 + ]}, + pattern color=blue }, + pattern = { hexagon + [ + size = 5mm, angle = 15, line width = 1mm, band = 0 + ]}, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} + +\begin{docTikzKey}{pattern hexagon}{=\marg{pattern keys}}{style, no default} + Convenience shortcut for setting the combined pattern (in one color). + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon = + { + size = 5mm, angle = 15, line width = 1mm + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + +\clearpage + +\begin{docPatternKey}{size}{=\meta{size}}{no default, initially |8mm|} + The given \meta{size} denotes the length of an edge of one hexagonical tile + where the (possibly smaller) hexagon is located in. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon = + { + size = 5mm, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + + +\begin{docPatternKey}{fill}{}{no value, initially set} + Sets the hexagons to be filled. |fill| and |draw| are mutually exclusionary. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon = + { + fill, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + +\begin{docPatternKey}{draw}{}{no value, initially unset} + Sets the hexagons to be outlined. |fill| and |draw| are mutually exclusionary. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon = + { + draw, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + +\begin{docPatternKey}{line width}{=\meta{length}}{no default, initially |0.4pt|} + Sets the \meta{length} value of the line width. + This is only relevant, if the hexagons are not filled. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon = + { + draw, line width = 1mm, + }, + pattern color=red + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + + +\begin{docPatternKeys} + { + { + doc name = xshift, + doc parameter = {=\meta{xshift}}, + doc description = {no default, initially |0pt|} + }, + { + doc name = yshift, + doc parameter = {=\meta{yshift}}, + doc description = {no default, initially |0pt|} + } + } + The pattern is shifted by \meta{xshift} and \meta{yshift}. + \par + Note that for \docValue*{hexagon} is valid, that a pattern is shifted first and rotated afterwards. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + preaction={pattern hexagon grid, pattern color=blue}, + pattern hexagon = + { + xshift=3mm, yshift=1mm, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKeys} + + + +\begin{docPatternKey}{angle}{=\meta{angle}}{no default, initially |0|} + The pattern is rotated by the given \meta{angle}. + \par + Note that for \docValue*{hexagon} is valid, that a pattern is shifted first and rotated afterwards. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon = + { + angle = 15, + }, + pattern color=red + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + + +\begin{docPatternKey}{pos}{=\meta{value}}{no default, initially |0.8|} + Sets the edge position with a \meta{value} between 0 and 1, where $0$ is + the center and $1$ the outer rim of the hexagonical tile. $1$ is a less + efficient way to either fill the whole graph or to draw a \docValue*{hexagon grid}. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + preaction={ pattern hexagon={pos=0.8}, + pattern color=blue!80!red }, + preaction={ pattern hexagon={pos=0.6}, + pattern color=blue!60!red }, + preaction={ pattern hexagon={pos=0.4}, + pattern color=blue!40!red }, + pattern hexagon={pos=0.2}, + pattern color=blue!20!red, + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + +\clearpage + + +\begin{docPatternKey}{band}{=\meta{number}}{no default, initially |0|} + \meta{number} can take 0 or 1 and denotes one of two different bands of the pattern. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + preaction = { pattern={hexagon[band=1,draw, + line width=1mm]}, + pattern color=blue }, + pattern={hexagon[band=0,pos=0.5]}, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + + +\clearpage +%------------------------------------------------------------------------------- +\subsection{Hexagon Grid} +The \docValue{hexagon grid} pattern draws a grid made of hexagons. It is +a single pattern und more efficient than \docValue*{hexagon} with settings |draw,pos=1|. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern = { hexagon grid + [ + size = 5mm, angle = 15, line width = 1mm + ]}, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} + + +\begin{docTikzKey}{pattern hexagon grid}{=\marg{pattern keys}}{style, no default} + Convenience shortcut for setting the pattern to \docValue{hexagon grid}: +\begin{dispListing} + pattern = { hexagon grid [ ... ] } +\end{dispListing} +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon grid = + { + size = 5mm, angle = 15, line width = 1mm + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + + +\begin{docPatternKey}{size}{=\meta{size}}{no default, initially |8mm|} + The given \meta{size} denotes the length of an edge of one hexagon. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon grid = + { + size = 5mm, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + +\clearpage + + +\begin{docPatternKeys} + { + { + doc name = xshift, + doc parameter = {=\meta{xshift}}, + doc description = {no default, initially |0pt|} + }, + { + doc name = yshift, + doc parameter = {=\meta{yshift}}, + doc description = {no default, initially |0pt|} + } + } + The pattern is shifted by \meta{xshift} and \meta{yshift}. + \par + Note that for \docValue*{hexagon grid} is valid, that a pattern is shifted first and rotated afterwards. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + preaction={pattern={hexagon grid}, pattern color=blue}, + pattern hexagon grid = + { + xshift=3mm, yshift=1mm, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKeys} + + +\begin{docPatternKey}{angle}{=\meta{angle}}{no default, initially |0|} + The pattern is rotated by the given \meta{angle}. + \par + Note that for \docValue*{hexagon grid} is valid, that a pattern is shifted first and rotated afterwards. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon grid = + { + angle = 15, + }, + pattern color=red + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + + +\begin{docPatternKey}{line width}{=\meta{length}}{no default, initially |0.4pt|} + Sets the \meta{length} value of the line width. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon grid = + { + line width = 2mm, + }, + pattern color=red + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + +\clearpage +%------------------------------------------------------------------------------- +\subsection{Hexagon Cycle} +The \docValue{hexagon cycle} pattern draws several hexagon rings in a cyclic manor. +A single pattern is one of two different \emph{bands}, called band 0 and band 1. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern = { hexagon cycle + [ + size = 5mm, angle = 15 + ]}, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} + +Both bands together build a uniform combined pattern. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + preaction = { + pattern = { hexagon cycle + [ + size = 5mm, angle = 15, band = 1 + ]}, + pattern color=blue }, + pattern = { hexagon cycle + [ + size = 5mm, angle = 15, band = 0 + ]}, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} + +\begin{docTikzKey}{pattern hexagon cycle}{=\marg{pattern keys}}{style, no default} + Convenience shortcut for setting the combined pattern (in one color). + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon cycle = + { + size = 5mm, angle = 15 + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + +\clearpage + +\begin{docPatternKey}{size}{=\meta{size}}{no default, initially |8mm|} + The given \meta{size} denotes the length of an edge of one hexagonical tile + where the (smaller) hexagons are located in. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon cycle = + { + size = 5mm, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + +\begin{docPatternKeys} + { + { + doc name = xshift, + doc parameter = {=\meta{xshift}}, + doc description = {no default, initially |0pt|} + }, + { + doc name = yshift, + doc parameter = {=\meta{yshift}}, + doc description = {no default, initially |0pt|} + } + } + The pattern is shifted by \meta{xshift} and \meta{yshift}. + \par + Note that for \docValue*{hexagon cycle} is valid, that a pattern is shifted first and rotated afterwards. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + postaction={pattern={hexagon grid}, pattern color=blue}, + pattern hexagon cycle = + { + xshift=3mm, yshift=1mm, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKeys} + + +\begin{docPatternKey}{angle}{=\meta{angle}}{no default, initially |0|} + The pattern is rotated by the given \meta{angle}. + \par + Note that for \docValue*{hexagon cycle} is valid, that a pattern is shifted first and rotated afterwards. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon cycle = + { + angle = 15, + }, + pattern color=red + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + +\clearpage + + +\begin{docPatternKey}{rings}{=\meta{number}}{no default, initially |3|} + Sets the \meta{number} of rings as $0, 1, 2, 3, \ldots$ + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon cycle = + { + rings = 2, + }, + pattern color=red + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + +\begin{docPatternKey}{gap}{=\meta{value}}{no default, initially |1|} + Sets the gap between two rings as \meta{value} times the line width of a ring. + \meta{value} has to be greater or equal $0.01$. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern hexagon cycle = + { + gap = 0.5, + }, + pattern color=red + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + +\begin{docPatternKey}{band}{=\meta{number}}{no default, initially |0|} + \meta{number} can take 0 or 1 and denotes one of two different bands of the pattern. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + preaction = { pattern={hexagon cycle[ + band=1, gap=0.5 ]}, pattern color=blue }, + pattern={hexagon cycle[band=0,rings=2]}, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\clearpage +\section{Rhombus Pattern Library}\label{sec:rhombus}% + +\begin{dispListing*}{title=\tikzname\ Library |fill.rhombus|} +\usetikzlibrary{fill.rhombus} % LATEX (primary choice) and plain TEX +\usetikzlibrary[fill.rhombus] % ConTEXt +\usepackage{tikzfill.rhombus} % LATEX (secondary choice) +\end{dispListing*} + +Based on |patterns.meta|, this library defines new rhombus patterns to fill graphs. + +%------------------------------------------------------------------------------- +\subsection{Rhombus} +The \docValue{rhombus} pattern draws rhombi or diamonds. The rhombi may be +filled or outlined and can be arranged in different \emph{bands}, called band 0, band 1, and band 2. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern = { rhombus + [ + size = 8mm, angle = 15 + ]}, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} + + +\begin{docTikzKey}{pattern rhombus}{=\marg{pattern keys}}{style, no default} + Convenience shortcut for setting the pattern to \docValue{rhombus}: +\begin{dispListing} + pattern = { rhombus [ ... ] } +\end{dispListing} +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern rhombus = + { + size = 8mm, angle = 15 + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docTikzKey} + + +\begin{docPatternKey}{size}{=\meta{size}}{no default, initially |10mm|} + The given \meta{size} denotes the length of an edge of one rhombical tile + where the (possibly smaller) rhombus is located in. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern rhombus = + { + size = 5mm, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + +\clearpage + +\begin{docPatternKey}{fill}{}{no value, initially set} + Sets the rhombi to be filled. |fill| and |draw| are mutually exclusionary. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern rhombus = + { + fill, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + +\begin{docPatternKey}{draw}{}{no value, initially unset} + Sets the rhombi to be outlined. |fill| and |draw| are mutually exclusionary. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern rhombus = + { + draw, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + +\begin{docPatternKey}{line width}{=\meta{length}}{no default, initially |0.4pt|} + Sets the \meta{length} value of the line width. This is only relevant, if + the rhombi are not filled. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern rhombus = + { + line width = 1mm, draw + }, + pattern color=red + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + +\begin{docPatternKey}{angle}{=\meta{angle}}{no default, initially |-40|} + The pattern is rotated by the given \meta{angle}. + \par + Note that for \docValue*{rhombus} is valid, that a pattern is rotated first and shifted afterwards. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern rhombus = + { + angle = 15, + }, + pattern color=red + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + +\clearpage + +\begin{docPatternKeys} + { + { + doc name = xshift, + doc parameter = {=\meta{xshift}}, + doc description = {no default, initially |0pt|} + }, + { + doc name = yshift, + doc parameter = {=\meta{yshift}}, + doc description = {no default, initially |0pt|} + } + } + The pattern is shifted by \meta{xshift} and \meta{yshift}. + \par + Note that for \docValue*{rhombus} is valid, that a pattern is rotated first and shifted afterwards. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + preaction={pattern rhombus, pattern color=blue}, + pattern rhombus = + { + xshift=3mm, yshift=1mm, + }, + pattern color=red + ] + (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKeys} + + + +\begin{docPatternKey}{ratio}{=\meta{value}}{no default, initially |2|} + Sets the \meta{value} of the ratio + between the longer diagonal and the shorter diagonal. + Therefore, $\text{\meta{value}}\ge 1$. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + pattern rhombus = + { + ratio = 4 + }, + pattern color=red + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + + + +\begin{docPatternKey}{pos}{=\meta{value}}{no default, initially |1|} + Sets the edge position with a \meta{value} between 0 and 1, where $0$ is + the center and $1$ the outer rim of the rhombical tile. + +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + preaction={ pattern rhombus={pos=1}, + pattern color=blue }, + preaction={ pattern rhombus={pos=0.8}, + pattern color=blue!80!red }, + preaction={ pattern rhombus={pos=0.6}, + pattern color=blue!60!red }, + preaction={ pattern rhombus={pos=0.4}, + pattern color=blue!40!red }, + pattern rhombus={pos=0.2}, + pattern color=blue!20!red, + ] +(0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + +\clearpage + + +\begin{docPatternKey}{band}{=\meta{number}}{no default, initially |0|} + \meta{number} can take 0, 1, or 2. + Here, 0 and 1 denote one of two different bands of the pattern, + while 2 denotes the comination of both. +\begin{dispExample*}{sbs,lefthand ratio=0.66,right=2mm,sidebyside gap=5mm,center lower} +\begin{tikzpicture} +\draw[ + preaction = { + pattern rhombus = { + pos = 0.8, band = 0 }, + pattern color=red }, + pattern rhombus = { + pos = 0.8, band = 1 + }, + pattern color=blue + ] (0,0) rectangle (4,4); +\end{tikzpicture} + +\begin{tikzpicture} +\draw[ + pattern rhombus = { + pos = 0.8, band = 2 + }, + pattern color=red + ] (0,0) rectangle (4,4); +\end{tikzpicture} +\end{dispExample*} +\end{docPatternKey} + +\clearpage + +\printindex + +\end{document} 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 diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 93c561bb668..cdcd82891bb 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -797,7 +797,7 @@ my @TLP_working = qw( tikz-nef tikz-network tikz-opm tikz-optics tikz-page tikz-palattice tikz-planets tikz-qtree tikz-relay tikz-sfc tikz-swigs tikz-timing tikz-trackschematic tikz-truchet - tikzbricks tikzcodeblocks tikzducks tikzinclude tikzlings + tikzbricks tikzcodeblocks tikzducks tikzfill tikzinclude tikzlings tikzmark tikzmarmots tikzorbital tikzpackets tikzpagenodes tikzpeople tikzpfeile tikzposter tikzscale tikzsymbols diff --git a/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc b/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc index 41531df0716..0098ed38e0d 100644 --- a/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc @@ -193,6 +193,7 @@ depend tikz-truchet depend tikzbricks depend tikzcodeblocks depend tikzducks +depend tikzfill depend tikzinclude depend tikzlings depend tikzmark diff --git a/Master/tlpkg/tlpsrc/tikzfill.tlpsrc b/Master/tlpkg/tlpsrc/tikzfill.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/tikzfill.tlpsrc |