Git Product home page Git Product logo

mahjong-tex's Introduction

mahjong-tex

CTAN

A LaTeX 3 package for typesetting mahjong hands using MPSZ algebraic notation. This package provides an interface for LaTeX 2e, so you can use it without any experience in LaTeX 3.

A display of all tiles used for Riichi Mahjong

This package focuses on Riichi (a.k.a. Japanese) Mahjong but can be used to typeset any style. However, flower tiles are currently missing.

Usage

\usepackage{mahjong}
\mahjong{<tiles>}

Insert mahjong tiles as specified by <tiles>. For instance,

\mahjong{119p 19s 19m 1234567z}

produces an image of the "Thirteen Orphans" hand with a pair of 1 dots.

A row of mahjong tiles: 1 dots, 1 dots, 9 dots, 1 bamboo, 9 bamboo, 1 character, 9 character, east wind, south wind, west wind, north wind, white dragon, green dragon, and red dragon

Additional supported features are:

  • Red fives
  • Concealed tiles
  • Spaces
  • Blank tiles
  • Rotated tiles (90° counter-clockwise)
  • Stacked, rotated tiles
\mahjong{X44Xp-123's-50"5m-33?z}

4 groups of mahjong tiles separated by spaces. Group 1: A concealed tile, showing its red backside, 4 dots, 4 dots, concealed tile. Group 2: 1 bamboo, 2 bamboo, 3 bamboo, rotated 90° counter-clockwise. Group 3: 5 character, two red 5 character, rotated 90° counter-clockwise and stacked, 5 character. Group 4: south wind, south wind, a tile with a question mark.

The size of the typeset hand can be changed. Either locally as an optional argument to \mahjong or as a package option.

Prerequisites

You need a sufficiently recent version of LaTeX which ships with the L3 programming layer. This applies to all version released after October 2019.

mahjong depends on stackengine, which is included in all major TeX distributions.

Building

A simple invocation of make is enough to produce a zip file in out/ which can be submitted to CTAN.

make

Installation

Run

make install

to install the package to your local texmf directory. It should be available for use in your documents.

Run

texdoc mahjong

to get an introduction to the package, including the extended flavor of MPSZ notation this package uses.

Attribution

The mahjong tiles used in this package were created by @FluffyStuff. The original repository is FluffyStuff/riichi-mahjong-tiles, used under CC-BY.

mahjong-tex's People

Contributors

schmytzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

vg-mjg xzgxp

mahjong-tex's Issues

`tiles` directory missing

Hi, I just stumbled upon this cool project and wanted to give it a try. However, in the repository, the tiles folder seems to be missing, probably because .pdf files are excluded in the gitignore. Could you add the missing folder?

Fix tile alignment

Currently, the bottom of the tiles is aligned with the text baseline.
This should be adjusted so the symbol is aligned with the baseline.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.