Directory macros/latex/contrib/maze
The maze package
The maze package can generate random square mazes of a specified size.
Basic Usage
The package provides one generator command and two storage commands.
\maze {⟨size⟩}[⟨seed⟩]
\mazesave {⟨name⟩} {⟨size⟩}[⟨seed⟩]
\mazeuse [⟨view⟩] {⟨name⟩}
Use \mazesave to generate a maze once and store the rendered result under a name, together with a solved version of the same maze. Later, use \mazeuse with the same name to typeset that exact maze again, or use \mazeuse[solution]{...} to show the stored solution overlay.
You can read the package manual for some explanations.
Copyright and License
Copyright (C) 2026 by Sicheng Du <siddsc@foxmail.com> -----------------------------------------------------------------
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. This version of this license is in http://www.latex-project.org/lppl/lppl-1-3c.txt and the latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3 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 Sicheng Du.
This package consists of the files maze.tex,
maze.pdf,
maze.sty and
README.md (this file).
Download the contents of this package in one zip archive (50.2k).
maze – Generate random mazes
This package can generate random square mazes of a specified size. The mazes generated by this package are natural and their solution is not too obvious. The output it based on the picture environment.
| Package | maze |
| Bug tracker | https://github.com/Quantum-Phantom/expl3maze/issues |
| Repository | https://github.com/Quantum-Phantom/expl3maze |
| Developers | https://github.com/Quantum-Phantom |
| Version | 1.3 2026-05-25 |
| Licenses | The LaTeX Project Public License 1.3c |
| Copyright | 2026 Sicheng Du |
| Maintainer | Sicheng Du |
| Contained in | TeX Live as maze MiKTeX as maze |
| Topics | Games |