summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/jigsaw/jigsaw-doc.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/jigsaw/jigsaw-doc.tex')
-rw-r--r--graphics/pgf/contrib/jigsaw/jigsaw-doc.tex39
1 files changed, 33 insertions, 6 deletions
diff --git a/graphics/pgf/contrib/jigsaw/jigsaw-doc.tex b/graphics/pgf/contrib/jigsaw/jigsaw-doc.tex
index 377e8024c5..9abda93205 100644
--- a/graphics/pgf/contrib/jigsaw/jigsaw-doc.tex
+++ b/graphics/pgf/contrib/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}