% mahjong-tiles-example.tex -- example and smoke-test document for mahjong-tiles.
% Compile from the package root with: make example

\documentclass{article}
\usepackage[
  height=1.5\baselineskip,
  scale=0.75,
  color=blue!70!black
]{mahjong-tiles}
\usepackage[a4paper,margin=22mm]{geometry}
\setlength\parindent{0pt}
\setlength\parskip{10pt}

\begin{document}

Basic hands:

\mahjong{111m456s111p11122z}

\mahjong{1112345678999p}

\mahjong{19m19s19p1234567z}

Rotated/open meld marker syntax:

\mahjong{111m111s111p22z2-3*333z}

Concealed-kong shorthand:

\mahjong{555m555s22z2-55555p1-33333z}

Red fives are enabled by default:

\mahjong{0m0p0s55555m}

Local \texttt{no-aka=1} removes red fives while keeping the same notation:

\mahjong[1.5\baselineskip][0.75][blue!70!black][no-aka=1]{0m0p0s55555m}

A compact key-value optional argument is also supported:

\mahjong[no-aka=1]{0m0p0s55555p}

Original shorthand markers:

\mahjong{123m-xx?4p'5p"0s}

Inline back tile colour argument \texttt{[height][scale][color]}:

\mahjong[1.5\baselineskip][0.75][blue!70!black]{x x x}

\mahjong[1.5\baselineskip][0.75][teal!65!black]{x x x}

Inline \texttt{none} restores the embedded back artwork for one call only:

\mahjong[1.5\baselineskip][0.75][none]{x x x}

The global package colour is still active after inline overrides:

\mahjong{x x x}

The global \texttt{color} key:

\mahjongtilessetup{color=purple!70!black}
\mahjong{x x x}

\mahjongtilessetup{color=none}
\mahjong{x x x}

Global \texttt{no-aka} can be changed with setup:

\mahjongtilessetup{no-aka=1}
\mahjong{0m0p0s55555s}

\mahjongtilessetup{no-aka=0}
\mahjong{0m0p0s}

Full local key-value form:

\mahjong[height=1.5\baselineskip,scale=0.75,color=teal!65!black,no-aka=1]{x 0m0p0s}

\mahjongriver{1m9m2z5z3s6s1s1m8p4z87m}

Discard river with a sideways riichi tile:

\mahjongriver[river-cols=6]{1m9m2z5z3s6s1s*1m8p4z87m}

Discard river with local color and no-aka:

\mahjongriver[1.5\baselineskip][0.75][teal!65!black][river-cols=5,no-aka=1]{0m1m2m3m4m5m6m7m8m9m}

Expl3 function:

\ExplSyntaxOn
\mahjongtiles:n {111m456s111p11122z}
\\
\mahjongtilesriver:n {1m2m3m4m5m6m7m8m9m}
\ExplSyntaxOff

\end{document}
