| 1 |
# mahjong-tex |
| 2 |
|
| 3 |
[](https://ctan.org/pkg/mahjong) |
| 4 |
|
| 5 |
A LaTeX 3 package for typesetting mahjong hands using MPSZ algebraic notation. |
| 6 |
This package provides an interface for LaTeX 2e, so you can use it without any experience in LaTeX 3. |
| 7 |
|
| 8 |
 |
| 9 |
|
| 10 |
This package focuses on Riichi (a.k.a. Japanese) Mahjong but can be used to typeset any style. |
| 11 |
However, flower tiles are currently missing. |
| 12 |
|
| 13 |
## Usage |
| 14 |
``` |
| 15 |
\usepackage{mahjong} |
| 16 |
\mahjong{<tiles>} |
| 17 |
``` |
| 18 |
Insert mahjong tiles as specified by `<tiles>`. For instance, |
| 19 |
``` |
| 20 |
\mahjong{119p 19s 19m 1234567z} |
| 21 |
``` |
| 22 |
produces an image of the "Thirteen Orphans" hand with a pair of 1 dots. |
| 23 |
|
| 24 |
 |
| 25 |
|
| 26 |
Additional supported features are: |
| 27 |
|
| 28 |
* Red fives |
| 29 |
* Concealed tiles |
| 30 |
* Spaces |
| 31 |
* Blank tiles |
| 32 |
* Rotated tiles (90° counter-clockwise) |
| 33 |
* Stacked, rotated tiles |
| 34 |
|
| 35 |
``` |
| 36 |
\mahjong{X44Xp-123's-50"5m-33?z} |
| 37 |
``` |
| 38 |
 |
| 43 |
|
| 44 |
The size of the typeset hand can be changed. |
| 45 |
Either locally as an optional argument to `\mahjong` or as a package option. |
| 46 |
|
| 47 |
## Prerequisites |
| 48 |
You need a sufficiently recent version of LaTeX which ships with the L3 programming layer. |
| 49 |
This applies to all version released after October 2019. |
| 50 |
|
| 51 |
mahjong depends on stackengine, which is included in all major TeX distributions. |
| 52 |
|
| 53 |
## Building |
| 54 |
A simple invocation of make is enough to produce a zip file in `out/` which can be submitted to CTAN. |
| 55 |
``` |
| 56 |
make |
| 57 |
``` |
| 58 |
|
| 59 |
## Installation |
| 60 |
Run |
| 61 |
``` |
| 62 |
make install |
| 63 |
``` |
| 64 |
|
| 65 |
to install the package to your local texmf directory. |
| 66 |
It should be available for use in your documents. |
| 67 |
|
| 68 |
Run |
| 69 |
``` |
| 70 |
texdoc mahjong |
| 71 |
``` |
| 72 |
to get an introduction to the package, including the extended flavor of MPSZ notation this package uses. |
| 73 |
|
| 74 |
## Attribution |
| 75 |
The mahjong tiles used in this package were created by [@FluffyStuff](https://github.com/FluffyStuff). |
| 76 |
The original repository is [FluffyStuff/riichi-mahjong-tiles](https://github.com/FluffyStuff/riichi-mahjong-tiles), used under CC-BY. |