Hello everyone. I would like to show a package I recently published, dedicated to rendering nonogram boards: nonodraw.
Given typst capabilities and the visual appeal of these puzzles, the match was perfect. The package offers deep customization capabilities so that pretty much any kind of standard board (that is, excluding things like hex boards etc) is supported: with or without colors, with custom shapes, custom style and so on.
Here is how the minimal use looks like:
// 5x10 board
#classical-board(
(
(0, 0, 1, 1, 0, 1, 1, 1, 1, 0),
(0, 0, 1, 1, 0, 1, 1, 1, 1, 0),
(0, 1, 0, 0, 0, 0, 0, 0, 0, 0),
(1, 1, 0, 0, 0, 0, 0, 1, 1, 0),
),
show-solution: true,
)
Producing the following:
However, quite deep customization is allowed through the system where the drawing of normal cells, and clue cells is performed through callbacks. Two implementations (classical and modern) are provided with the packages, though these also offer many customization options. Here are some more advanced examples included in the rerpository examples file:
The last example shows how clues can be customized to make numbers with more than 1 digit narrower, and also how some guides can be added to the borders to make counting easier.
The creation of the board can be done through:
- A matrix
- Text that is transformed into a matrix with an included helper function
- Only the clues, if the solution is not known or it is easier to just input the clue numbers
The system allows to attach content and color to each possible content in the matrix (by default, 0 for empty cells, 1 for filled ones, and some characters for colors: “r” → red, “g” → green and so on).
I hope you like it. Let me know if there are features that could be interesting for future versions.




