tikz-minesweeper
Draw a minesweeper board in LaTeX.
Installation
Compliation
-
Clone this repository
-
Change the directory to target folder
-
Compile
tikz-minesweeper.dtx
with XeLaTeX once (this step will generatetikz-minesweeper.sty
,tikz-minesweeper.glo
and many auxiliary files)
xelatex tikz-minesweeper.dtx
- Compile
tikz-minesweeper.glo
withmakeindex
(this step will generatetikz-minesweeper.gls
)
makeindex -s gglo.ist -o tikz-minesweeper.gls tikz-minesweeper.glo
- Compile
tikz-minesweeper.dtx
with XeLaTeX twice (this step will generatetikz-minesweeper.pdf
)
xelatex tikz-minesweeper.dtx (twice)
- Move
tikz-minesweeper.sty
to your project folder
Compliation (shortcut)
-
Clone this repository
-
Install
VSCode
andLaTeX Workshop
extension (at leastv8.29.0
) -
Compile
tikz-minesweeper.dtx
inVSCode
, and all of the steps will be done in one click!
Install globally on your disk
-
Move
tikz-minesweeper.sty
toTEXMF/tex/latex/tikz-minesweeper
-
Move
tikz-minesweeper.pdf
toTEXMF/doc/latex/tikz-minesweeper
-
Refresh local database with
texhash
ormktexlsr
(with texlive)
Usage
-
\flag
: draw a flag -
\mine
: draw a mine -
\cellup
: draw an untouched cell -
\celldown
: draw a pressed cell -
\cellnum{num}
: draw a cell with a centered number (0-8) -
\border[-tlbr]
: draw a border with edge options -
\cell{r}{c}{info}
: drawinfo
at (r
,c
), see #1 for detailed command discussions -
\row{r}{seq: info}
: draw a row with a sequence ofinfo
according to\cell
-
\col{c}{seq: info}
: draw a column with a sequence ofinfo
according to\cell
-
\board[-tlbr]{r}{c}
: draw a board with border -
\colorcell{color}{seq: pos}
: fill an area with a certain color
Contribution
-
Issues and PRs are welcomed.
-
LaTeX3 is preferred.
Copyright and License
-
Copyright (C) 2021-2022 by Tian-Yi Pu, Fei-Yu Xiang and Yao-Yu Zhu
-
This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 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.3 or later is part of all distributions of LaTeX version 2005/12/01 or later.
Other notes
tikz-minesweeper.pdf
is fully in Chinese, and we don't have the efforts to translate it into other languages now.