texlive[63937] Master/texmf-dist: jigsaw (19jul22)

commits+karl at tug.org commits+karl at tug.org
Tue Jul 19 22:08:56 CEST 2022


Revision: 63937
          http://tug.org/svn/texlive?view=revision&revision=63937
Author:   karl
Date:     2022-07-19 22:08:55 +0200 (Tue, 19 Jul 2022)
Log Message:
-----------
jigsaw (19jul22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/jigsaw/README.md
    trunk/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.pdf
    trunk/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.tex
    trunk/Master/texmf-dist/tex/latex/jigsaw/jigsaw.sty

Modified: trunk/Master/texmf-dist/doc/latex/jigsaw/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jigsaw/README.md	2022-07-19 20:06:54 UTC (rev 63936)
+++ trunk/Master/texmf-dist/doc/latex/jigsaw/README.md	2022-07-19 20:08:55 UTC (rev 63937)
@@ -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
 

Modified: trunk/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.tex	2022-07-19 20:06:54 UTC (rev 63936)
+++ trunk/Master/texmf-dist/doc/latex/jigsaw/jigsaw-doc.tex	2022-07-19 20:08:55 UTC (rev 63937)
@@ -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,9 +160,8 @@
 \end{tikzpicture}
 \end{tcblisting}
 
+The shapes of the jigsaw pieces are designed to seamlessly fit into each other which allows to produce tile patters in various ways:
 
-The shapes of the jigsaw pieces are designed to seamlessly fit into each other which allows to produce tile patters.
-
 \begin{tcblisting}{title={Manual tile pattern}}
 \begin{tikzpicture}
 \begin{scope}
@@ -178,6 +179,31 @@
 \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 @@
 \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}

Modified: trunk/Master/texmf-dist/tex/latex/jigsaw/jigsaw.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jigsaw/jigsaw.sty	2022-07-19 20:06:54 UTC (rev 63936)
+++ trunk/Master/texmf-dist/tex/latex/jigsaw/jigsaw.sty	2022-07-19 20:08:55 UTC (rev 63937)
@@ -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 at 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},



More information about the tex-live-commits mailing list.