diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/jigsaw/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.pdf | bin | 167851 -> 176773 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.tex | 39 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/jigsaw/jigsaw.sty | 47 |
4 files changed, 59 insertions, 29 deletions
diff --git a/Master/texmf-dist/doc/latex/jigsaw/README.md b/Master/texmf-dist/doc/latex/jigsaw/README.md index 74d412760fb..bd493b23a7e 100644 --- a/Master/texmf-dist/doc/latex/jigsaw/README.md +++ b/Master/texmf-dist/doc/latex/jigsaw/README.md @@ -2,7 +2,7 @@ A small LaTeX package to draw jigsaw pieces with TikZ. It is possible to draw individual pieces and adjust their shape, produce tile patterns or to automatically generate complete jigsaws. -Current version: 2022/06/20 version v0.2 +Current version: 2022/07/18 version v0.3 This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt diff --git a/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.pdf b/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.pdf Binary files differindex 43e3b10c215..00f6b25cc8b 100644 --- a/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.pdf +++ b/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.pdf diff --git a/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.tex b/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.tex index 377e8024c5b..9abda932054 100644 --- a/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.tex +++ b/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.tex @@ -21,7 +21,9 @@ \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage[bitstream-charter]{mathdesign} +%\usepackage{duckuments} \usepackage{jigsaw} +\usetikzlibrary{matrix} \usepackage[most]{tcolorbox} \usepackage[paper=a4paper,margin=2.9cm]{geometry} \usepackage{url} @@ -61,7 +63,7 @@ texcsstyle=*\color{duckblue}\bfseries, keywordstyle=\color{red!60!black}\bfseries, morekeywords={tikzpicture,scope}, - moretexcs={path,node,draw,clip,includegraphics,color,piece,tile,jigsaw}, + moretexcs={path,node,draw,clip,pic,includegraphics,color,piece,tile,jigsaw}, delim ={[s][\ttfamily\color{green!50!black}]{$}{$}}, moredelim=[is][\footnotesize\ttfamily\color{orange!70!black}]{|}{|}, moredelim={[s][\color{gray}]{<}{>}}, @@ -96,7 +98,7 @@ \url{https://github.com/samcarter/jigsaw}\\ \url{https://www.ctan.org/pkg/jigsaw} }{samcarter}} -\date{Version v0.2 \textendash{} 2022/06/20} +\date{Version v0.3 \textendash{} 2022/07/18} \begin{document} \maketitle @@ -158,8 +160,7 @@ The piece shape is also available as \TikZ \verb|pic|: \end{tikzpicture} \end{tcblisting} - -The shapes of the jigsaw pieces are designed to seamlessly fit into each other which allows to produce tile patters. +The shapes of the jigsaw pieces are designed to seamlessly fit into each other which allows to produce tile patters in various ways: \begin{tcblisting}{title={Manual tile pattern}} \begin{tikzpicture} @@ -178,6 +179,31 @@ The shapes of the jigsaw pieces are designed to seamlessly fit into each other w \end{tikzpicture} \end{tcblisting} +\begin{tcblisting}{title={Manual pattern using \texttt{\textbackslash pic}}} +\begin{tikzpicture} +\pic at (0,1) [fill=lightgray,draw] + {piece={1}{1}{0}{0}}; +\pic at (1,1) [fill=teal] + {piece={1}{0}{0}{-1}}; +\pic at (0,0) [fill=teal] + {piece={0}{-1}{-1}{0}}; +\pic at (1,0) [fill=lightgray] + {piece={0}{0}{-1}{1}}; +\end{tikzpicture} +\end{tcblisting} + +\begin{tcblisting}{title={Manual pattern using Ti\emph{k}Z matrix}} +% \usetikzlibrary{matrix} +\begin{tikzpicture} +\matrix [nodes=draw]{ +\pic [fill=lightgray]{piece={-1}{-1}{0}{0}};& +\pic [fill=teal]{piece={1}{0}{0}{-1}}; \\ +\pic [fill=teal]{piece={0}{-1}{1}{0}}; & +\pic [fill=lightgray]{piece={0}{0}{-1}{1}};\\ +}; +\end{tikzpicture} +\end{tcblisting} + Manually position each jigsaw piece at the correct position can be tedious, therefore the command \lstinline|\tile[<colour>]{<bottom>}{<right>}{<top>}{<left>}| was added. It can be used outside of of the \lstinline|tikzpicture| environment to place the pieces besides each other like normal letters in a text. Line breaks have to be added at the appropriate positions and one has to be careful not to introduce additional spaces between the jigsaw pieces from unprotected line endings. \begin{tcblisting}{title={The tile command}} @@ -207,8 +233,9 @@ This automatically generated jigsaw can also be overlaid on a picture: \begin{tcblisting}{title={Overlaid image}} \begin{tikzpicture} \clip (0,0) rectangle (6,4); -\node at (3,2) {\includegraphics[width=6cm] - {example-image-duck}}; +\node at (3,2) {% + \includegraphics[width=6cm,height=4cm]{example-image-duck}% +}; \jigsaw{6}{4} \end{tikzpicture} \end{tcblisting} diff --git a/Master/texmf-dist/tex/latex/jigsaw/jigsaw.sty b/Master/texmf-dist/tex/latex/jigsaw/jigsaw.sty index ae1a7360422..ad8bcc96743 100644 --- a/Master/texmf-dist/tex/latex/jigsaw/jigsaw.sty +++ b/Master/texmf-dist/tex/latex/jigsaw/jigsaw.sty @@ -40,19 +40,19 @@ } \newcommand{\halfpiece}[2]{ - \draw \side{#1} [rotate around={90:(0.5,0.5)}] \side{#2}; + \draw \side{#1} [rotate around={90:(0.5,0.5)}] \side{#2}; } \newcommand{\piece}[5][\@nil]{ - \def\tmp{#1}% - \ifx\tmp\@nnil - \else - \fill[#1] - \side{#2} - [rotate around={90:(0.5,0.5)}] -- \side{#3} - [rotate around={90:(0.5,0.5)}] -- \side{#4} - [rotate around={90:(0.5,0.5)}] -- \side{#5} - -- cycle; + \def\tmp{#1}% + \ifx\tmp\@nnil + \else + \fill[#1] + \side{#2} + [rotate around={90:(0.5,0.5)}] -- \side{#3} + [rotate around={90:(0.5,0.5)}] -- \side{#4} + [rotate around={90:(0.5,0.5)}] -- \side{#5} + -- cycle; \fi \draw \side{#2} @@ -62,12 +62,12 @@ } \newcommand{\tile}[5][\@nil]{% - \begin{tikzpicture} - \path (0,0) rectangle (1,0.97); - \begin{pgfinterruptboundingbox} - \piece[#1]{#2}{#3}{#4}{#5} - \end{pgfinterruptboundingbox} - \end{tikzpicture}% + \begin{tikzpicture} + \path (0,0) rectangle (1,0.97); + \begin{pgfinterruptboundingbox} + \piece[#1]{#2}{#3}{#4}{#5} + \end{pgfinterruptboundingbox} + \end{tikzpicture}% } \pgfmathdeclarerandomlist{inout}{{-1}{1}} @@ -99,12 +99,15 @@ pics/piece/.style n args={4}{ inherit options/.code={\csname tikz@options\endcsname},inherit options, code = { - \path[pic actions] - \side{#1} - [rotate around={90:(0.5,0.5)}] -- \side{#2} - [rotate around={90:(0.5,0.5)}] -- \side{#3} - [rotate around={90:(0.5,0.5)}] -- \side{#4} - -- cycle; + \path (0,0) rectangle (1,1); + \begin{pgfinterruptboundingbox} + \path[pic actions] + \side{#1} + [rotate around={90:(0.5,0.5)}] -- \side{#2} + [rotate around={90:(0.5,0.5)}] -- \side{#3} + [rotate around={90:(0.5,0.5)}] -- \side{#4} + -- cycle; + \end{pgfinterruptboundingbox} } }, piece/.search also={,/tikz,/pgf}, |