2

I want to reproduce this image but I cant' find any information about these characters. I also don't know Chinese.

cchess, xq are outdated. (I think so)

So, I want to know whether there is a package to do type them in LaTeX as

\documentclass[12pt]{article}
\usepackage{ ??? }

\begin{document}
 ...
\end{document}

enter image description here

3
  • Do you want to reproduce only this image or do you also want to draw different board positions? If it's just this image then maybe you can just use the file from Wikipedia, there is a high-quality SVG with the characters included at commons.wikimedia.org/wiki/… (licensed CC-BY-SA).
    – Marijn
    Sep 22 at 9:31
  • Note that this is a special kind of Xiangqi, so even if you find a package with which you can input the symbols used for classical Xiangqi (that has only two players), it may not contain all the symbols used here. For example this one uses special symbols for the generals that are not part of the traditional set of Xiangqi symbols. Sep 27 at 16:05
  • The reputation bounty + acceptance will be awarded for the answer which get the most votes! Thanks all. Sep 27 at 16:09
7
+100

Although the OP doesn't want to have the image drawn, I still tried and came up with the following, which only uses the calc library with TikZ and provides an easy way to input the diagram and symbols:

\documentclass[border=1mm]{standalone}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc}

\usepackage{xeCJK}
\setCJKmainfont{AR PL UKai TW}

\newenvironment{threekingdoms}{
  \begin{tikzpicture}
    \foreach \i in {1,...,3} {
      \begin{scope}[rotate around={{120*(\i-1)}:(0:0)}]
        \foreach \j in {0,...,4} {
          \coordinate (p\i0\j) at ([shift={(240:5)}]120:{\j*5/9});
          \coordinate (p\i8\j) at ([shift={(300:5)}]60:{\j*5/9});
          \coordinate (p\i4\j) at (270:{cos(30)*5-cos(30)*10/9*\j});
          \coordinate (p\i2\j) at ($(p\i0\j)!0.5!(p\i4\j)$);
          \coordinate (p\i1\j) at ($(p\i0\j)!0.5!(p\i2\j)$);
          \coordinate (p\i3\j) at ($(p\i2\j)!0.5!(p\i4\j)$);
          \coordinate (p\i6\j) at ($(p\i4\j)!0.5!(p\i8\j)$);
          \coordinate (p\i5\j) at ($(p\i4\j)!0.5!(p\i6\j)$);
          \coordinate (p\i7\j) at ($(p\i6\j)!0.5!(p\i8\j)$);
        }
      \end{scope}
    }
}{
  \end{tikzpicture}
}

\newcommand{\board}[1][none]{
  \fill[#1] (p100) -- (p180) -- (p200) -- (p280) -- (p300) -- (p380) -- cycle;
  \foreach \i in {1,...,3} {
    \draw (p\i00) -- (p\i04) -- (p\i44) -- (p\i84) -- (p\i80) -- cycle;
    \foreach \j in {1,...,7} {
        \draw (p\i\j0) -- (p\i\j4);
    }
    \foreach \j in {1,...,3} {
        \draw (p\i0\j) -- (p\i4\j) -- (p\i8\j);
    }
    \draw (p\i30) -- (p\i41) -- (p\i52)
          (p\i50) -- (p\i41) -- (p\i32);
  }
  \draw (p384) -- (p104) 
        (p184) -- (p204)
        (p284) -- (p304)
        (p344) -- (p144) -- (p244) -- cycle;
}

\newcommand{\piece}[3]{
  \def\fieldcolor{\ifcase#1\relax\or BrickRed\or PineGreen\or RoyalBlue\else black\fi}
  \def\markadv{A}
  \def\markcan{C}
  \def\markchr{R}
  \def\markele{E}
  \def\markgen{G}
  \def\markhrs{H}
  \def\marksol{S}
  \def\markban{B}
  \def\fieldfigure{
    \if#2\markadv\ifnum#1=1 仕\else 士\fi\else
    \if#2\markcan\ifnum#1=1 炮\else\ifnum#1=2 礮\else 砲\fi\fi\else
    \if#2\markchr 車\else
    \if#2\markele\ifnum#1=1 相\else\ifnum#1=2 向\else 象\fi\fi\else
    \if#2\markgen\ifnum#1=1 蜀\else\ifnum#1=2 吳\else 魏\fi\fi\else
    \if#2\markhrs 馬\else
    \if#2\marksol\ifnum#1=1 兵\else\ifnum#1=2 勇\else 卒\fi\fi\else
    \if#2\markban\ifnum#1=1 火\else\ifnum#1=2 風\else 旗\fi\fi\else
    \fi\fi\fi\fi\fi\fi\fi\fi
  }
  \node[circle, draw, double, \fieldcolor, fill=white, inner sep=0pt] at (p#3) {\fieldfigure};
}

\begin{document}

    \begin{threekingdoms}
        \board[Apricot!10]
        
        % first argument: player 
        %   1 = Shu 
        %   2 = Wei
        %   3 = Wu
        % second argument: figure 
        %   A = advisory 
        %   C = cannon 
        %   R = chariot
        %   E = elephant
        %   G = general
        %   H = horse
        %   S = soldier
        %   B = banner
        % third argument: position
        %   first digit: field (1 = bottom, 2 = left, 3 = right)
        %   second digit: column (0 to 8, 0 being the leftmost line)
        %   third digit: row (0 to 4, 0 being the outermost line)
        
        \piece{1}{S}{103}
        \piece{1}{S}{123}
        \piece{1}{S}{143}
        \piece{1}{S}{163}
        \piece{1}{S}{183}
        
        \piece{1}{C}{112}
        \piece{1}{B}{132}
        \piece{1}{B}{152}
        \piece{1}{C}{172}
        
        \piece{1}{R}{100}
        \piece{1}{H}{110}
        \piece{1}{E}{120}
        \piece{1}{A}{130}
        \piece{1}{G}{140}
        \piece{1}{A}{150}
        \piece{1}{E}{160}
        \piece{1}{H}{170}
        \piece{1}{R}{180}
        

        \piece{2}{S}{203}
        \piece{2}{S}{223}
        \piece{2}{S}{243}
        \piece{2}{S}{263}
        \piece{2}{S}{283}
        
        \piece{2}{C}{212}
        \piece{2}{B}{232}
        \piece{2}{B}{252}
        \piece{2}{C}{272}
        
        \piece{2}{R}{200}
        \piece{2}{H}{210}
        \piece{2}{E}{220}
        \piece{2}{A}{230}
        \piece{2}{G}{240}
        \piece{2}{A}{250}
        \piece{2}{E}{260}
        \piece{2}{H}{270}
        \piece{2}{R}{280}


        \piece{3}{S}{303}
        \piece{3}{S}{323}
        \piece{3}{S}{343}
        \piece{3}{S}{363}
        \piece{3}{S}{383}
        
        \piece{3}{C}{312}
        \piece{3}{B}{332}
        \piece{3}{B}{352}
        \piece{3}{C}{372}
        
        \piece{3}{R}{300}
        \piece{3}{H}{310}
        \piece{3}{E}{320}
        \piece{3}{A}{330}
        \piece{3}{G}{340}
        \piece{3}{A}{350}
        \piece{3}{E}{360}
        \piece{3}{H}{370}
        \piece{3}{R}{380}
    \end{threekingdoms}

\end{document}

If the question is only about how to input (certain) Chinese characters in LaTeX, there are several answers on this page that deal with how to set up LaTeX for typesetting Chinese. In order to type Chinese on your computer in general, you need an input method and at least some knowledge of Chinese, since most input methods can only be used if you know the writing order or pronunciation of the character. Best would indeed be just to copy the characters (for example from below).

Advisory:  士 or 仕
Cannon:    砲 or 炮 or 礮 (last one not used in traditional Xiangqi)
Chariot:   車 (traditional Xiangqi also uses 俥 as red variant)
Elephant:  象 or 相 or 向 (last one not used in traditional Xiangqi)
General:   魏 or 蜀 or 吳 (將 or 帥 in traditional Xiangqi)
Horse:     馬 (traditional Xiangqi also uses 傌 as red variant)
Soldier:   卒 or 兵 or 勇 (last one not used in traditional Xiangqi)
Bannermen: 旗 or 火 or 風 (not used in traditional Xiangqi)

This game is a special variant of the traditional Xiangqi that only features two players. Therefore, there are some special symbols used that will probably not be included in a package designed for typesetting Chinese chess, nor are they encoded in Unicode (yet). So, the best way really would be to draw these symbols on your own using the relevant Chinese characters.

enter image description here

1
  • 1
    Wow! Very nicely done.
    – sgmoye
    Sep 27 at 19:09
3

This image is definitely something you can do with tikz. As for the fonts, there are a couple of packages for type-setting chinese, japanese, or korean characters out there.

Here is an example of how you could (possibly) achieve this:

\documentclass{standalone}
\usepackage{tikz}
\usepackage{fontspec}
\usetikzlibrary{shapes.geometric,calc,intersections}
\usepackage{xeCJK}
\setCJKmainfont{SimSun}

\begin{document}
    \begin{tikzpicture}[thick,piece/.style={circle,inner sep=1pt,fill=white,double},
        shu/.style={piece,draw=red,text=red},
        wu/.style={piece,draw=green,text=green},
        wei/.style={piece,draw=blue,text=blue}]
        %Board outline (and anchors)
        \node[regular polygon,regular polygon sides=6,draw,thick,minimum width=12cm] (b) {};
        
        %Center triangle
        \path[name path=tri1] ($(b.corner 1)!.0555!(b.corner 6)$) -- ($(b.corner 4)!.0555!(b.corner 5)$);
        \path[name path=tri2] ($(b.corner 5)!.0555!(b.corner 4)$) -- ($(b.corner 2)!.0555!(b.corner 3)$);
        \path[name path=tri3] ($(b.corner 6)!.0555!(b.corner 1)$) -- ($(b.corner 3)!.0555!(b.corner 2)$);
        \path[name intersections={of=tri1 and tri2,by=A}];
        \path[name intersections={of=tri1 and tri3,by=B}];
        \path[name intersections={of=tri2 and tri3,by=C}];
        \draw (A) -- (B) -- (C) -- cycle;       
        
        %% Shu field (red)
        \foreach \n [count=\i] in {1,...,9}
            \coordinate (rA\i) at ($(b.corner 4)!{(\n-1)*.125}!(b.corner 5)$);  

        \coordinate (rE1) at ($(b.corner 4)!.444!(b.corner 3)$);
        \path ($(b.corner 3)!.555!(b.corner 4)$) -- (A) coordinate[pos=.25] (rE2);
        \path ($(b.corner 3)!.555!(b.corner 4)$) -- (A) coordinate[pos=.50] (rE3);
        \path ($(b.corner 3)!.555!(b.corner 4)$) -- (A) coordinate[pos=.75] (rE4);
        \path ($(b.corner 3)!.555!(b.corner 4)$) -- (A) coordinate (rE5);
        \path ($(b.corner 5)!.444!(b.corner 6)$) -- (A) coordinate[pos=.75] (rE6);
        \path ($(b.corner 5)!.444!(b.corner 6)$) -- (A) coordinate[pos=.50] (rE7);
        \path ($(b.corner 5)!.444!(b.corner 6)$) -- (A) coordinate[pos=.25] (rE8);
        \coordinate (rE9) at ($(b.corner 5)!.444!(b.corner 6)$);
        
        \foreach \i in {2,...,8}
            \draw (rA\i) -- (rE\i) coordinate[pos=.25] (rB\i) coordinate[pos=.50] (rC\i) coordinate[pos=.75](rD\i);
        \foreach \n [count=\i] in {rB,rC,rD}{
            \coordinate (\n1) at ($(b.corner 4)!{\i*.111}!(b.corner 3)$);
            \coordinate (\n9) at ($(b.corner 5)!{\i*.111}!(b.corner 6)$);
            \draw (\n1) -- (\n5) -- (\n9);
        }
        \draw (rE1) -- (rE5) -- (rE9) (rC4) -- (rB5) -- (rA6) (rA4) -- (rB5) -- (rC6);
        
        \node[shu] at (rA1){車};
        \node[shu] at (rA2){馬};
        \node[shu] at (rA3){相};
        \node[shu] at (rA4){仕};
        \node[shu] at (rA5){蜀};
        \node[shu] at (rA6){仕};
        \node[shu] at (rA7){相};
        \node[shu] at (rA8){馬};
        \node[shu] at (rA9){車};
        \node[shu] at (rD1){兵};
        \node[shu] at (rD3){兵};
        \node[shu] at (rD5){兵};
        \node[shu] at (rD7){兵};
        \node[shu] at (rD9){兵};
        \node[shu] at (rC4){火};
        \node[shu] at (rC6){火};
        \node[shu] at (rC2){焙};
        \node[shu] at (rC8){焙};

        %% Wei field (blue)
        \draw ($(b.corner 1)!.555!(b.corner 2)$) -- (C) -- ($(b.corner 3)!.444!(b.corner 4)$);
        
        \node[wei] at (b.corner 2) {車};
        \node[wei] at ($(b.corner 2)!.125!(b.corner 3)$){馬};
        \node[wei] at ($(b.corner 2)!.250!(b.corner 3)$){象};
        \node[wei] at ($(b.corner 2)!.375!(b.corner 3)$){士};
        \node[wei] at (b.side 2) {魏};
        \node[wei] at ($(b.corner 2)!.625!(b.corner 3)$){士};
        \node[wei] at ($(b.corner 2)!.750!(b.corner 3)$){象};
        \node[wei] at ($(b.corner 2)!.875!(b.corner 3)$){馬};
        \node[wei] at (b.corner 3) {車};
        
        %% Wu field (green)
        \draw ($(b.corner 1)!.444!(b.corner 2)$) -- (B) --($(b.corner 5)!.555!(b.corner 6)$);
                
        \node[wu] at (b.corner 6) {車};
        \node[wu] at ($(b.corner 6)!.125!(b.corner 1)$){馬};
        \node[wu] at ($(b.corner 6)!.250!(b.corner 1)$){向};
        \node[wu] at ($(b.corner 6)!.375!(b.corner 1)$){士};
        \node[wu] at (b.side 6) {吳};
        \node[wu] at ($(b.corner 6)!.625!(b.corner 1)$){士};
        \node[wu] at ($(b.corner 6)!.750!(b.corner 1)$){向};
        \node[wu] at ($(b.corner 6)!.875!(b.corner 1)$){馬};
        \node[wu] at (b.corner 1) {車};
        
        
    \end{tikzpicture}
\end{document}

enter image description here

(I'm not sure, I got the geometry 100% right, but it should be close enough)

9
  • You maybe misunderstand my question: I only need chess fonts, not for drawing all. I need an answer which looks like this. Only characters, characters and characters. Sep 27 at 15:05
  • 1
    Yes, your question is quite unclear. Your main question says you want to re-create the image, that is probably why people would misunderstand. Concerning the font I think you can just use whichever chinese font you like, as there is no specific font to these pieces (as far as I can tell).
    – Markus G.
    Sep 27 at 15:12
  • I don't know chinese, so I cannot get that characters. I don't know how to type them in my document because I am not familiar to chinese. Sep 27 at 15:16
  • For example: 車 馬 相 仕 蜀, ... I cannot type them because I am not familiar to chinese. You only need to type them as in the above link, done! Sep 27 at 15:21
  • If it is just about typing the characters (which has nothing to do with the font) then you can bascially copy-paste them from anywhere that explains this type of xiangqi. Or am I missing something?
    – Markus G.
    Sep 27 at 15:25
2

Xiangqi pieces were added to the Unicode Standard in June 2018 with the release of version 11.0.

They appear in the Chess Symbols Unicode block, which is U+1FA00–U+1FA6F, but few fonts actually contain these characters (none of the fonts on my Mac include them).

There is a free font, however, that does contain the characters (designed by the person who initiated the request for the characters to be added to Unicode) available at https://www.babelstone.co.uk/Fonts/Xiangqi.html

As for the remainder of the diagram, this would be done with TiKZ.

2
  • +1 you may want to point out how to use the font, i.e., requires LuaTeX or XeTeX for compilation.
    – Alan Munn
    Sep 27 at 15:37
  • 1
    This encoding, however, does not contain the special symbols used for this varant of Xianqi (for example the symbols for the generals 魏, 蜀, and 吳). Sep 27 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.