texlive[71947] Master: polyomino (1aug24)

commits+karl at tug.org commits+karl at tug.org
Thu Aug 1 21:58:26 CEST 2024


Revision: 71947
          https://tug.org/svn/texlive?view=revision&revision=71947
Author:   karl
Date:     2024-08-01 21:58:26 +0200 (Thu, 01 Aug 2024)
Log Message:
-----------
polyomino (1aug24)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/polyomino/
    trunk/Master/texmf-dist/doc/latex/polyomino/README.md
    trunk/Master/texmf-dist/doc/latex/polyomino/polyomino.pdf
    trunk/Master/texmf-dist/doc/latex/polyomino/polyomino.tex
    trunk/Master/texmf-dist/tex/latex/polyomino/
    trunk/Master/texmf-dist/tex/latex/polyomino/polyomino.sty
    trunk/Master/tlpkg/tlpsrc/polyomino.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/polyomino/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/polyomino/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/polyomino/README.md	2024-08-01 19:58:26 UTC (rev 71947)
@@ -0,0 +1,25 @@
+# `polyomino`
+
+## Polyominoes using Ti*k*Z and LaTeX3
+
+Version 1.0 (2024/08/01)
+
+This package is based on the package [Ti*k*Z](https://ctan.org/pkg/pgf) and can be used to draw polyominoes. It is possible to define custom styles, pics and grids.
+
+%% README.md
+%% Copyright 2024 Matthias Floré
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% 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.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+% 
+% The Current Maintainer of this work is Matthias Floré.
+%
+% This work consists of the files polyomino.pdf, polyomino.sty,
+% polyomino.tex and README.md.
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/polyomino/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/polyomino/polyomino.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/polyomino/polyomino.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/polyomino/polyomino.pdf	2024-08-01 19:57:32 UTC (rev 71946)
+++ trunk/Master/texmf-dist/doc/latex/polyomino/polyomino.pdf	2024-08-01 19:58:26 UTC (rev 71947)

Property changes on: trunk/Master/texmf-dist/doc/latex/polyomino/polyomino.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/polyomino/polyomino.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/polyomino/polyomino.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/polyomino/polyomino.tex	2024-08-01 19:58:26 UTC (rev 71947)
@@ -0,0 +1,278 @@
+%% polyomino.tex
+%% Copyright 2024 Matthias Floré
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% 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.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+% 
+% The Current Maintainer of this work is Matthias Floré.
+%
+% This work consists of the files polyomino.pdf, polyomino.sty,
+% polyomino.tex and README.md.
+\documentclass[a4paper,english,dvipsnames]{ltxdoc}
+\usepackage[english]{babel}
+\usepackage{graphicx}
+\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry}
+\usepackage{parskip}
+\usepackage{iftex}
+\ifluatex
+\else
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\fi
+\usepackage{mathtools}
+\usepackage{amssymb}
+\allowdisplaybreaks
+\usepackage{pdflscape}
+\usepackage{polyomino}
+\input{pgfmanual-en-macros.tex}
+\usepackage{codehigh}
+\usepackage{fancyhdr}
+\pagestyle{fancy}
+\renewcommand{\headrulewidth}{0pt}
+\fancyhead{}
+\ExplSyntaxOn
+\NewExpandableDocumentCommand \repeatnumber {}
+  { \prg_replicate:nn { \thepage } { * } }
+\ExplSyntaxOff
+\fancyfoot[C]{\IfRefUndefinedExpandable{Thesourcecode}{}{\begin{tikzpicture}[scale=0.9]
+\polyomino[
+  grid,
+  p={*}{style={teal,draw=black}}
+]{\repeatnumber}
+\end{tikzpicture}}}
+\usepackage[nottoc]{tocbibind}
+\usepackage{imakeidx}
+\makeindex[program=makeindex,columns=2,intoc=true]
+\indexsetup{othercode={\thispagestyle{fancy}}}
+\AtEndPreamble{\hypersetup{%
+linktoc=all,
+pdfstartview=FitH,
+colorlinks=true,
+linkcolor=Mahogany,
+citecolor=ForestGreen,
+urlcolor=MidnightBlue,
+bookmarksnumbered=true,
+pdftitle={The polyomino package},
+pdfauthor={Matthias Floré},
+pdfsubject={Manual},
+pdfkeywords={polyomino}}}
+\setcounter{tocdepth}{2}
+\setcounter{secnumdepth}{2}
+\title{The \texttt{polyomino} package\\[12pt]\large Polyominoes using \tikzname{} and \LaTeX3}
+\author{Matthias Floré}
+\date{Version 1.0 (2024/08/01)}%\\[12pt]
+\begin{document}
+\maketitle
+\thispagestyle{fancy}
+\begin{abstract}
+\noindent This package is based on the package |tikz| (see \cite{TtTaPGFp}) and can be used to draw polyominoes. It is possible to define custom styles, pics and grids.% This is the manual for version .
+\end{abstract}
+\tableofcontents
+\section{Usage}
+The package |polyomino| can be used by putting the following in the preamble.
+\begin{codeexample}[code only]
+\usepackage{polyomino}
+\end{codeexample}
+The package |polyomino| loads the package |tikz|.
+\section{The command \textbackslash polyomino}
+\begin{command}{\polyomino\opt{\oarg{options}}\marg{polyomino specification}}
+This command can be placed inside a |tikzpicture| environment. The \meta{polyomino specification} is a token list. Spaces in this list are ignored. With the initial settings, a |,| starts a new row. Otherwise each element in this list corresponds to a cell. An element can consist of multiple characters by surrounding it with braces. The \meta{options} can be given with the keys described in Section \ref{Keys}.
+\begin{codeexample}[width=8cm]
+\pgfkeys{
+  /polyomino,
+  p={F}{style={blue,draw=black,ultra thick}},
+  p={I}{style={brown,draw=black,ultra thick}},
+  p={L}{style={cyan,draw=black,ultra thick}},
+  p={N}{style={gray,draw=black,ultra thick}},
+  p={P}{style={lime,draw=black,ultra thick}},
+  p={T}{style={magenta,draw=black,ultra thick}},
+  p={U}{style={olive,draw=black,ultra thick}},
+  p={V}{style={orange,draw=black,ultra thick}},
+  p={W}{style={pink,draw=black,ultra thick}},
+  p={X}{style={purple,draw=black,ultra thick}},
+  p={Y}{style={red,draw=black,ultra thick}},
+  p={Z}{style={teal,draw=black,ultra thick}}
+}
+\begin{tikzpicture}
+\polyomino[
+  grid
+]{
+  UUUVVV,
+  UXUZZV,
+  XXXFZV,
+  IXFFZZ,
+  ILLFFT,
+  ILNTTT,
+  ILNWWT,
+  ILNNWW,
+  PPPNYW,
+  PPYYYY
+}
+\end{tikzpicture}
+\end{codeexample}
+The algorithm constructs the border of each polyomino. It does not consider holes determined by empty cells. Although it does detect a cell inside a polyomino which has a different style. This is illustrated in the example below.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}[scale=0.8]
+\polyomino[
+  p={a}{style={gray,draw=black,thick}}
+]{
+  aaaaa,
+  a.a.a,
+  aaaaa
+}
+\polyomino[
+  at={(0,-4)},
+  p={a}{style={gray,draw=black,thick}},
+  p={*}{style={white,draw=black,thick}}
+]{
+  aaaaa,
+  a*a*a,
+  aaaaa
+}
+\end{tikzpicture}
+\end{codeexample}
+\end{command}
+\section{Keys}\label{Keys}
+The keys in this Section can be given as \meta{options} to the command |\polyomino|.
+
+There are two key families: |/polyomino| and |/polyomino/p_2|. The key family |/polyomino| is intended for usage in documents whereas |/polyomino/p_2| is not. In the key family |/polyomino|, also keys from the key family |/polyomino/p_2| will be looked up. The second argument from the key |p| only accepts keys from the key family |/polyomino/p_2|.
+\begin{key}{/polyomino/at=\marg{point} (initially (0,0))}
+This key defines the bottom left coordinate of the polyomino.
+\end{key}
+\begin{key}{/polyomino/p\_2/connected}
+This key sets the |pic| type (which is activated by the key |pic|) to false. This is the initial setting.
+\end{key}
+\begin{key}{/polyomino/p\_2/discrete}
+This key sets the |pic| type (which is activated by the key |pic|) to true.
+\end{key}
+\begin{key}{/polyomino/empty cell=\marg{token list} (initially .)}
+A cell corresponding to the \meta{token list} in the \meta{polyomino specification} will be left empty.
+
+A cell corresponding to the empty token list will always be left empty.
+\end{key}
+\begin{key}{/polyomino/grid=\opt{\meta{boolean}} (default true, initially false)}
+If true then a grid is drawn. The grid does not apply to borders of polyominoes. The style of this grid is determined by the key |grid style|. A grid does not apply to a cell with a |pic|.
+\end{key}
+\begin{stylekey}{/polyomino/grid style=\marg{options} (initially \normalfont empty)}
+This key determines the style of the grid.
+\begin{codeexample}[width=6.5cm]
+\begin{tikzpicture}[rotate=90]
+\polyomino[
+  grid,
+  grid style={gray,dash pattern=on 3mm off 4mm on 3mm off 0mm},
+  p={L}{style={darkgray,draw=black}},
+  p={P}{style={green,draw=black}},
+  p={T}{style={violet,draw=black}},
+  p={V}{style={yellow,draw=black}}
+]{
+  LTVVV,
+  LTTTV,
+  LTPPV,
+  LLPPP
+}
+\end{tikzpicture}
+\end{codeexample}
+\end{stylekey}
+\begin{stylekey}{/polyomino/p\_2/p=\marg{name}\marg{options} (initially \normalfont empty)}
+This key determines the style of the polyomino with \meta{name} in the \meta{polyomino specification}.
+
+The \meta{options} only accept keys from the key family |/polyomino/p_2|.
+
+In the example below, the polyominoes have the same shape but are differentiated by using different names.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\pgfkeys{
+  /polyomino,
+  p={a}{},
+  p={b}{},
+  style={fill=none,draw}
+}
+\def\example{
+  aa,
+  ab,
+  ab,
+  bb
+}
+\polyomino{\example}
+\polyomino[
+  at={(2,0)}
+]{\example}
+\end{tikzpicture}
+\end{codeexample}
+\end{stylekey}
+\begin{key}{/polyomino/p\_2/pic=\marg{code}}
+The \meta{code} defines the |pic| which is used for each cell of the polyomino.
+
+A grid does not apply to a cell with a |pic|.
+\begin{codeexample}[width=7cm]
+\begin{tikzpicture}
+\polyomino[
+  empty cell=*,
+  grid,
+  p={a}{style={red,draw=black}},
+  p={b}{style={blue,draw=black}},
+  p={c}{style={orange,draw=black}},
+  p={circle}{pic={\fill[green] (0,0) circle[radius=0.4];}},
+  row sep=;
+]{
+     {}    * * b    {}    c ;
+     a     a b b {circle} c ;
+  {circle} a a b    c     c
+}
+\end{tikzpicture}
+\end{codeexample}
+\begin{codeexample}[width=5cm]
+\begin{tikzpicture}
+\polyomino[
+  p={circle}{
+    pic={\path[pic actions] (0,0) circle[radius=0.45];},
+    style={right color=cyan,left color=red,draw,dashed}
+  },
+  p={L}{
+    pic={
+      \fill[yellow!80!black] (-0.5,-0.5) rectangle +(1,1);
+      \fill[yellow!50,rounded corners] (-0.4,-0.4) rectangle +(0.8,0.8);
+    }
+  },
+  p={square}{
+    pic={\path[pic actions] (-0.45,-0.45) rectangle +(0.9,0.9);},
+    style={fill=magenta,draw,rounded corners}
+  }
+]{
+  L {circle} {square} {square} ,
+  L {circle} {circle} {square} ,
+  L    L     {circle} {circle}
+}
+\end{tikzpicture}
+\end{codeexample}
+\end{key}
+\begin{key}{/polyomino/row sep=\marg{token list} (initially ,)}
+The \meta{token list} in the \meta{polyomino specification} will start a new row.
+\end{key}
+\begin{stylekey}{/polyomino/p\_2/style=\marg{options} (initially \normalfont empty)}
+This key determines the style of the polyomino.
+\end{stylekey}
+\begin{thebibliography}{9}
+\bibitem{TtTaPGFp}
+Till Tantau,
+\emph{The \tikzname{} and {\upshape\pgfname} Packages},
+Manual for version 3.1.10,
+\url{https://ctan.org/pkg/pgf},
+2023.
+\end{thebibliography}
+\printindex
+\newgeometry{left=2.25cm,right=2.25cm,top=2.25cm,bottom=2.25cm}
+\pagestyle{plain}
+\appendix
+\begin{landscape}
+\section{The source code}\label{Thesourcecode}
+\dochighinput[language=latex/latex3]{polyomino.sty}
+\end{landscape}
+\end{document}
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/polyomino/polyomino.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/polyomino/polyomino.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/polyomino/polyomino.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/polyomino/polyomino.sty	2024-08-01 19:58:26 UTC (rev 71947)
@@ -0,0 +1,286 @@
+%% polyomino.sty
+%% Copyright 2024 Matthias Floré
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% 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.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+% 
+% The Current Maintainer of this work is Matthias Floré.
+%
+% This work consists of the files polyomino.pdf, polyomino.sty,
+% polyomino.tex and README.md.
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{tikz}
+\ProvidesExplPackage{polyomino}{2024/08/01}{1.0}{Polyominoes using TikZ and LaTeX3}
+
+%%> \subsection{Variables and variants}
+
+\bool_new:N \l__polyomino_grid_bool
+\bool_new:N \l__polyomino_pic_bool
+
+\int_new:N \l__polyomino_col_int
+\int_new:N \l__polyomino_dir_int
+\int_new:N \l__polyomino_max_int
+\int_new:N \l__polyomino_row_int
+\int_new:N \l__polyomino_x_int
+\int_new:N \l__polyomino_y_int
+
+\seq_new:N \l__polyomino_add_seq
+\seq_new:N \l__polyomino_cols_seq
+
+\tl_new:N \l__polyomino_path_tl
+\tl_new:N \l__polyomino_pic_tl
+
+\cs_generate_variant:Nn \tl_map_inline:nn { en }
+
+%%> \subsection{Pgfkeys}
+
+\pgfkeys
+  {
+    / polyomino /. is~family ,
+    / polyomino /. search~also = / polyomino / p_2 ,
+    / polyomino ,
+    at /. initial = { ( 0 , 0 ) } ,
+    empty~cell /. initial = . ,
+    grid /. code = \bool_set:Nn \l__polyomino_grid_bool { \cs:w c_#1_bool \cs_end: } ,
+    grid /. default = true ,
+    grid = false ,
+    grid~style /. style = { grid_style /. style = {#1} } ,
+    grid_style /. style = {} ,
+    row~sep /. initial = { , } ,
+  }
+
+\pgfkeys
+  {%a separate key family so that the second argument of the key p only accepts keys which apply to a separate polyomino
+    / polyomino / p_2 /. is~family ,
+    / polyomino / p_2 ,
+    connected /. code = \bool_set_false:N \l__polyomino_pic_bool ,
+    connected /. value~forbidden ,
+    discrete /. code = \bool_set_true:N \l__polyomino_pic_bool ,
+    discrete /. value~forbidden ,
+    p /. style~2~args = { #1__style /. style = {#2} } ,%2 underscores to avoid the same name as for example the key style_style
+    pic /. code =
+      {
+        \bool_set_true:N \l__polyomino_pic_bool
+        \tl_set:Nn \l__polyomino_pic_tl {#1}
+      } ,
+    style /. style = { style_style /. style = {#1} } ,
+    style_style /. style = {} ,
+  }
+
+%%> \subsection{The command \textbackslash polyomino}
+
+\NewDocumentCommand \polyomino { O {} m }
+  {
+    {%note the double braces {{...}} so that the contents is in a group and in particular, \pgfkeys is applied locally
+      \pgfkeys { / polyomino , #1 }
+      \int_zero:N \l__polyomino_col_int
+      \int_set:Nn \l__polyomino_row_int { 1 }
+      \seq_clear:N \l__polyomino_cols_seq
+      \tl_map_inline:en {#2}
+      %it is convenient that this ignores spaces in #2
+      %e argument specifier for the case that #2 is given by a command or contains a command
+        {
+          \tl_if_eq:neTF {##1} { \pgfkeysvalueof { / polyomino / row~sep } }
+            {
+              \seq_put_right:NV \l__polyomino_cols_seq \l__polyomino_col_int
+              \int_incr:N \l__polyomino_row_int
+              \int_zero:N \l__polyomino_col_int
+            }
+            {
+              \int_incr:N \l__polyomino_col_int
+              \tl_clear_new:c { l__polyomino_\int_use:N \l__polyomino_row_int _\int_use:N \l__polyomino_col_int _tl }
+              \tl_if_eq:neF {##1} { \pgfkeysvalueof { / polyomino / empty~cell } }
+                { \tl_set:cn { l__polyomino_\int_use:N \l__polyomino_row_int _\int_use:N \l__polyomino_col_int _tl } {##1} }
+              \tl_gclear_new:c { g__polyomino_\int_use:N \l__polyomino_row_int _\int_use:N \l__polyomino_col_int _tl }
+            }
+        }
+      \seq_put_right:NV \l__polyomino_cols_seq \l__polyomino_col_int
+      \int_set:Nn \l__polyomino_max_int { \fp_eval:n { max ( \seq_use:Nn \l__polyomino_cols_seq { , } ) } }
+      \seq_map_indexed_inline:Nn \l__polyomino_cols_seq
+        {
+          \tl_clear_new:c { l__polyomino_##1_0_tl }
+          \int_step_inline:nnn { ##2 + 1 } { \l__polyomino_max_int + 1 }
+            { \tl_clear_new:c { l__polyomino_##1_####1_tl } }
+        }
+      \int_step_inline:nnn { 0 } { \l__polyomino_max_int + 1 }
+        {
+          \tl_clear_new:c { l__polyomino_0_##1_tl }
+          \tl_clear_new:c { l__polyomino_\int_eval:n { \l__polyomino_row_int + 1 }_##1_tl }
+        }
+      \pgfkeys
+        {
+          / tikz ,
+          shift /. expanded = { \pgfkeysvalueof { / polyomino / at } } ,
+          shift = { ( 0 , \seq_count:N \l__polyomino_cols_seq ) }
+        }
+      \seq_map_indexed_inline:Nn \l__polyomino_cols_seq
+        {
+          \int_step_inline:nn {##2}
+            {
+              \tl_if_empty:cF { l__polyomino_##1_####1_tl }
+                {
+                  {%note the double braces {{...}} so that \pgfkeys is applied locally
+                    \pgfkeys { / polyomino / p_2 , \cs:w l__polyomino_##1_####1_tl \cs_end: __style }
+                    \bool_if:NTF \l__polyomino_pic_bool
+                      { \pic [ / polyomino / p_2 / style_style ] at ( ####1 - 0.5 , 0.5 - ##1 ) { code = { \l__polyomino_pic_tl } } ; }
+                      {
+                        \seq_clear:N \l__polyomino_add_seq
+                        \tl_if_eq:ccF { l__polyomino_##1_####1_tl } { l__polyomino_##1_\int_eval:n { ####1 - 1 }_tl }
+                          {
+                            \tl_if_empty:cT { g__polyomino_##1_####1_tl }
+                              {
+                                \int_set:Nn \l__polyomino_dir_int { 1 }
+                                \int_set:Nn \l__polyomino_col_int {####1}
+                                \int_set:Nn \l__polyomino_row_int {##1}
+                                \int_set:Nn \l__polyomino_x_int {####1}
+                                \int_set:Nn \l__polyomino_y_int { 1 - ##1 }
+                                \tl_build_begin:N \l__polyomino_path_tl
+                                \fp_do_until:nn { ####1 - 1 = \l__polyomino_x_int && 1 - ##1 = \l__polyomino_y_int }
+                                  {
+                                    %concerning \tl_build_put_right:Ne \l__polyomino_path_tl,
+                                    %for example (0,0)--(0,1)--(0,2) results in a larger file size than (0,0)--(0,2)
+                                    \tl_if_eq:ccTF
+                                      { l__polyomino_##1_####1_tl }
+                                      {
+                                        l__polyomino
+                                        _\int_eval:n
+                                          { \l__polyomino_row_int + \clist_item:nn { 0 , 1 , 0 , -1 } { \l__polyomino_dir_int } }
+                                        _\int_eval:n
+                                          { \l__polyomino_col_int + \clist_item:nn { 1 , 0 , -1 , 0 } { \l__polyomino_dir_int } }
+                                        _tl
+                                      }
+                                      {
+                                        \tl_if_eq:ccTF
+                                          { l__polyomino_##1_####1_tl }
+                                          {
+                                            l__polyomino
+                                            _\int_eval:n
+                                              { \l__polyomino_row_int + \clist_item:nn { -1 , 1 , 1 , -1 } { \l__polyomino_dir_int } }
+                                            _\int_eval:n
+                                              { \l__polyomino_col_int + \clist_item:nn { 1 , 1 , -1 , -1 } { \l__polyomino_dir_int } }
+                                            _tl
+                                          }
+                                          {
+                                            \tl_build_put_right:Ne \l__polyomino_path_tl
+                                              { -- ( \int_use:N \l__polyomino_x_int , \int_use:N \l__polyomino_y_int ) }
+                                            \int_add:Nn \l__polyomino_row_int
+                                              { \clist_item:nn { -1 , 1 , 1 , -1 } { \l__polyomino_dir_int } }
+                                            \int_add:Nn \l__polyomino_col_int
+                                              { \clist_item:nn { 1 , 1 , -1 , -1 } { \l__polyomino_dir_int } }
+                                            \int_compare:nNnTF { \l__polyomino_dir_int } = { 1 }
+                                              { \int_set:Nn \l__polyomino_dir_int { 4 } }
+                                              { \int_decr:N \l__polyomino_dir_int }
+                                          }
+                                          {
+                                            \int_add:Nn \l__polyomino_row_int
+                                              { \clist_item:nn { 0 , 1 , 0 , -1 } { \l__polyomino_dir_int } }
+                                            \int_add:Nn \l__polyomino_col_int
+                                              { \clist_item:nn { 1 , 0 , -1 , 0 } { \l__polyomino_dir_int } }
+                                          }
+                                        \tl_if_empty:cTF
+                                          { g__polyomino_\int_use:N \l__polyomino_row_int _\int_use:N \l__polyomino_col_int _tl }
+                                          {
+                                            \seq_put_right:Ne \l__polyomino_add_seq
+                                              { \int_use:N \l__polyomino_row_int _\int_use:N \l__polyomino_col_int }
+                                          }
+                                          {
+                                            \bool_set_true:N \l__polyomino_pic_bool
+                                            \int_set:Nn \l__polyomino_x_int { ####1 - 1 }
+                                            \int_set:Nn \l__polyomino_y_int { 1 - ##1 }
+                                          }
+                                      }
+                                      {
+                                        \tl_build_put_right:Ne \l__polyomino_path_tl
+                                          { -- ( \int_use:N \l__polyomino_x_int , \int_use:N \l__polyomino_y_int ) }
+                                        \int_compare:nNnTF { \l__polyomino_dir_int } = { 4 }
+                                          { \int_set:Nn \l__polyomino_dir_int { 1 } }
+                                          { \int_incr:N \l__polyomino_dir_int }
+                                      }
+                                    \bool_if:NF \l__polyomino_pic_bool
+                                      {
+                                        \int_add:Nn \l__polyomino_x_int { \clist_item:nn { 1 , 0 , -1 , 0 } { \l__polyomino_dir_int } }
+                                        \int_add:Nn \l__polyomino_y_int { \clist_item:nn { 0 , -1 , 0 , 1 } { \l__polyomino_dir_int } }
+                                      }
+                                  }
+                                \tl_build_end:N \l__polyomino_path_tl
+                                \bool_if:NF \l__polyomino_pic_bool
+                                  { \fill [ / polyomino / p_2 / style_style ] ( ####1 - 1 , 1 - ##1 ) \l__polyomino_path_tl -- cycle ; }
+                              }
+                          }
+                        \tl_gset:cn { g__polyomino_##1_####1_tl } { c }
+                        \seq_map_inline:Nn \l__polyomino_add_seq
+                          { \tl_gset:cn { g__polyomino_########1_tl } { c } }
+                      }
+                  }
+                }
+            }
+        }
+      \bool_if:NT \l__polyomino_grid_bool
+        {
+          \int_step_inline:nn { \seq_count:N \l__polyomino_cols_seq - 1 }
+            {
+              \int_zero:N \l__polyomino_col_int
+              \int_zero:N \l__polyomino_x_int
+              \int_set:Nn \l__polyomino_y_int
+                { \int_min:nn { \seq_item:Nn \l__polyomino_cols_seq {##1} } { \seq_item:Nn \l__polyomino_cols_seq { ##1 + 1 } } }
+              \int_while_do:nNnn { \l__polyomino_x_int } < { \l__polyomino_y_int }
+                {
+                  \bool_do_while:nn
+                    {
+                      \tl_if_eq_p:cc
+                        { l__polyomino_##1_\int_use:N \l__polyomino_x_int _tl }
+                        { l__polyomino_\int_eval:n { ##1 + 1 }_\int_use:N \l__polyomino_x_int _tl }
+                      &&
+                      ! \tl_if_empty_p:c { g__polyomino_##1_\int_use:N \l__polyomino_x_int _tl }
+                      &&
+                      \int_compare_p:nNn { \l__polyomino_x_int } < { \l__polyomino_y_int + 1 }
+                    }
+                    { \int_incr:N \l__polyomino_x_int }
+                  \int_compare:nNnT { \l__polyomino_x_int } > { \l__polyomino_col_int + 1 }
+                    {
+                      \draw [ / polyomino / grid_style ]
+                        ( \int_use:N \l__polyomino_col_int , -##1 ) -- ( \int_use:N \l__polyomino_x_int - 1 , -##1 ) ;
+                    }
+                  \int_set_eq:NN \l__polyomino_col_int \l__polyomino_x_int
+                }
+            }
+          \int_set:Nn \l__polyomino_x_int { \seq_count:N \l__polyomino_cols_seq }
+          \int_step_inline:nn { \l__polyomino_max_int - 1 }
+            {
+              \int_zero:N \l__polyomino_row_int
+              \int_zero:N \l__polyomino_y_int
+              \int_while_do:nNnn { \l__polyomino_y_int } < { \l__polyomino_x_int }
+                {
+                  \bool_do_while:nn
+                    {
+                      \tl_if_eq_p:cc
+                        { l__polyomino_\int_use:N \l__polyomino_y_int _##1_tl }
+                        { l__polyomino_\int_use:N \l__polyomino_y_int _\int_eval:n { ##1 + 1 }_tl }
+                      &&
+                      ! \tl_if_empty_p:c { g__polyomino_\int_use:N \l__polyomino_y_int _##1_tl }
+                      &&
+                      \int_compare_p:nNn { \l__polyomino_y_int } < { \l__polyomino_x_int + 1 }
+                      &&
+                      \int_compare_p:nNn {##1} < { \seq_item:Nn \l__polyomino_cols_seq { \l__polyomino_y_int } + 0 }
+                    }
+                    { \int_incr:N \l__polyomino_y_int }
+                  \int_compare:nNnT { \l__polyomino_y_int } > { \l__polyomino_row_int + 1 }
+                    {
+                      \draw [ / polyomino / grid_style ]
+                        ( ##1 , -\int_use:N \l__polyomino_row_int ) -- ( ##1 , 1 - \int_use:N \l__polyomino_y_int ) ;
+                    }
+                  \int_set_eq:NN \l__polyomino_row_int \l__polyomino_y_int
+                }
+            }
+        }
+    }
+  }
+
+\endinput
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/polyomino/polyomino.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2024-08-01 19:57:32 UTC (rev 71946)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2024-08-01 19:58:26 UTC (rev 71947)
@@ -678,7 +678,7 @@
     plnfss plstmary plweb pm-isomath
     pmboxdraw pmdraw pmgraph pmhanguljamo pmx pmxchords pnas2009
     poemscol poetry poetrytex poiretone polexpr polski poltawski
-    polyglossia polyhedra polynom polynomial
+    polyglossia polyhedra polynom polynomial polyomino
     polytable poormanlog postage postcards poster-mac postit postnotes
     powerdot powerdot-fuberlin powerdot-tuliplab
     ppmcheckpdf ppr-prv ppt-slides pracjourn practicalreports

Modified: trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2024-08-01 19:57:32 UTC (rev 71946)
+++ trunk/Master/tlpkg/tlpsrc/collection-pictures.tlpsrc	2024-08-01 19:58:26 UTC (rev 71947)
@@ -138,6 +138,7 @@
 depend pixelarttikz
 depend pmgraph
 depend polyhedra
+depend polyomino
 depend postage
 depend postit
 depend prerex

Added: trunk/Master/tlpkg/tlpsrc/polyomino.tlpsrc
===================================================================


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