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 /Master/texmf-dist/doc/latex | |
parent | 9abe5e7e81cc75e9a63b9bbdffb081bdfc88e1b0 (diff) |
tikzfill (20jul22)
git-svn-id: svn://tug.org/texlive/trunk@63947 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex')
-rw-r--r-- | Master/texmf-dist/doc/latex/tikzfill/CHANGES.md | 23 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tikzfill/README.md | 56 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tikzfill/tikzfill-doc.sty | 130 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tikzfill/tikzfill.pdf | bin | 0 -> 721265 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/tikzfill/tikzfill.tex | 1385 |
5 files changed, 1594 insertions, 0 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} |