7

I want to build a showcase to demonstrate to my friends how powerful Tikz is. LOL But I am still new to Tikz, not sure how to handle this.

I want to draw a Chinese chess (Xiangqi) with latex and tikz. See links on wiki or google image or this link, http://history.chess.free.fr/xiangqi-figures.htm enter image description here

It could be simplified to this:

enter image description here

with Chinese character circled.

You see, this is a 5*9 grids on each side. And there a seven characters on each side. By using latex, I hope it can easily handle the game notations, for instance, if a Chariot (Che) is on the third row, seventh column, then I could simply do some macro programming to have something like "che{3,7}", which will give me great advantage in quickly generating high quality images during the gameplay.

Any ideas where should I start? And any suggestions? Thanks

Daniel
  • 1,816

2 Answers2

6

Are you aware there are already 2 LaTeX packages for chinese chess? The cchess package is covered in "The LaTeX Graphics Companion". A PDF with excerpts is here; chinese chess is on page 61. If you download the zip file at the CTAN link above there's sample code for the board, too (cchessboard.tex file). Likewise there is an xq package which (unlike cchess) might already be installed on your computer. The "example of use" link shows it in action. It records the moves using letters but the cchess package has moves with a picture of the piece.

DJP
  • 12,451
3

Here's an option using the customizable chinesechess package. Compile with lualatex or xelatex.

\documentclass{article}
\usepackage{ctex}
\usepackage{chinesechess}

\cchessset{resize/type=real,resize/width=0.5\textwidth}

\begin{document} Default:

\cchessboard

With some options:

\cchessboard[ boardtype=x, piecetype=o, blkupper=black, blkpiece=white, redupper=black!10, ] \end{document}

chinesechess

See the documentation for more options and how to place individual pieces.

mbert
  • 4,171
  • It works but the red canons not display the correct symbol: instead shows a F inside a square. Do you know what problem it could be? – Rafael Bluhm Nov 09 '23 at 13:30
  • @RafaelBluhm I don't understand your question. You should ask a new question on the site with a complete non-working example – mbert Nov 09 '23 at 17:45