Debian Codegraph @

texmf-dist/doc/latex/chinesechess/README.md

raw
1 Chinese chess manual writing package based on l3draw
2 =======
3
4 `chinesechess` is a LaTeX3 package developed based on l3draw, which provides macros and environment for Chinese chess manual writing.
5
6 You can read the manual (in Chinese) for more details and examples.
7
8 Contributing
9 ------------
10
11 1. github repository:
12 1. repository: [chinesechess](https://github.com/registor/chinesechess)
13 2. Issues and pull requests are welcome. [issue](https://github.com/registor/chinesechess/issues) or [pull request](https://github.com/registor/chinesechess/pulls).
14
15 2. gitee repository:
16 1. repository: [chinesechess](https://gitee.com/nwafu_nan/chinesechess)
17 2. Issues and pull requests are welcome. [issue](https://gitee.com/nwafu_nan/chinesechess/issues) or [pull request](https://gitee.com/nwafu_nan/chinesechess/pulls).
18
19 基于l3draw的中国象棋棋谱排版宏包
20 =======
21
22 `chinesechess`是一个基于l3draw用LaTeX3开发的中国象棋棋谱排版宏包,它提供了用于排版中国象棋棋谱的命令和环境。
23
24 可以通过阅读宏包手册以了解该宏包更多的使用细节和使用样例。
25
26 ## 排版示例
27
28 ```latex
29 % 由于fandol字体无红棋的砲字,因此请选用合适的字体
30 % K=帅,A=仕,E=相,R=车,C=砲,H=马,P=兵, k=将,a=士,e=象,r=車,c=炮,h=馬,p=卒
31 % 水平定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8)
32 % 垂直定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8),j(9)
33 % 棋子定位时,可以混合使用字母和数字,以下示例使用混合输入
34 % 强烈建议在实际使用中使用纯字母或纯数字定位
35
36 % 输出带所有棋子的棋盘命令
37 \cchessboard
38 % 若仅需要输出不带棋子的棋盘,请使用带星命令
39 \cchessboard*
40
41 % 排版棋谱命令
42 \cchessman{ {{4,0}{K}}, {{2,2}{p}}, {{1,7}{C}}, {{4,9}{k}} }
43
44 % 排版打谱过程的环境
45 \begin{setcchessman}[boardtype=x+tn]
46 % 残局初始化
47 \init{ {{4,0}{K}}, {{2,2}{p}},
48 {{1,7}{C}}, {{4,9}{k}} }
49 % 添加棋子
50 \set{e,d}{P} \set{8,g}{h}
51 % 删除棋子
52 \del{4,3}
53 % 移动棋子
54 \mov{C}{b,h}{b,b}
55 \mov{p}{2,2}{3,2}
56 \end{setcchessman}
57
58 % 可以使用带星号的打谱环境,
59 % 此时可以用label标签标记该打谱环境。
60 % 然后在需要的位置用`\printman{label}`输出打谱结果
61 \begin{setcchessman*}[boardtype=x+tn, label=test]
62 % 残局初始化
63 \init{ {{4,0}{K}}, {{2,2}{p}},
64 {{1,7}{C}}, {{4,9}{k}} }
65 % 添加棋子
66 \set{e,d}{P} \set{8,g}{h}
67 % 删除棋子
68 \del{4,3}
69 % 移动棋子
70 \mov{C}{b,h}{b,b}
71 \mov{p}{2,2}{3,2}
72 \mov{K}{4,0}{4,1}
73 \mov{h}{8,6}{6,7}
74 \mov{K}{4,1}{3,1}
75 \mov{h}{6,7}{5,5}
76 \end{setcchessman*}
77
78 \printman{test}
79 ```
80 ## 使用方法
81
82 宏包中可以设置棋谱外观。
83
84 ```tex
85 \cchessset{
86 boardtype = x+tn
87 }
88 ```
89
90 宏包可用选项有:
91 - `gridsize` 棋盘单元格尺寸(需有长度单位)
92 - `boardtype` 棋盘类型,可以有x--简约型,x+--带兵、炮位标记和九宫线,x+t--带兵、炮位和九宫线及楚河汉界,x+tn--带兵、炮位、九宫线、楚河汉界及数字线位,x+Xtn--带兵、炮位、九宫线、象位线及楚河汉界
93 - `boardlinewd` 棋盘线条宽度
94 - `boardlinecolor` 棋盘线条颜色
95 - `boardbg` 棋盘背景图片路径及文件名
96 - `resize` 缩放类型,可以有none(默认)--无缩放,real--按指定实际尺寸或比例缩放(需要同时指定width/height/xscale/yscale参数值)
97 - `piecechar` 棋子字符
98 - `piecefont` 棋子字符字体
99 - `piecetype` 棋子类型,可以有o--简约型,oo--带双线边框无阴影型,ooo--立体型
100 - `boxlinewd` 棋子边框线线宽
101 - `boxcolor` 棋子边框颜色
102 - `redpiece` 红棋文字颜色
103 - `blkpiece` 黑棋文字颜色
104 - `lower` 棋子背景颜色
105 - `donut` 棋子环带颜色
106 - `redupper` 红棋棋子颜色
107 - `blkupper` 黑棋棋子颜色
108 - `shadow` 棋子阴影颜色
109 - `charstroke` 棋子文字笔划类型,可以有none,solid--实线轮廓,whide--白色填充,bold--加粗选择(默认),invisible-—隐藏笔划。
110
111 注意:`\init`、`\set`、`\del`和`\mov`这四个命令只能用于`setcchessman`环境及其星号环境中。
112
113 ## 参与贡献
114 ---------------------
115
116 1. github仓库:
117 (1). 仓库地址: [chinesechess](https://github.com/registor/chinesechess)
118 (2). Issues和PR: [issue](https://github.com/registor/chinesechess/issues) or [pull request](https://github.com/registor/chinesechess/pulls).
119
120 2. gitee仓库:
121 (1). 仓库地址: [chinesechess](https://gitee.com/nwafu_nan/chinesechess)
122 (2). Issues and PR: [issue](https://gitee.com/nwafu_nan/chinesechess/issues) or [pull request](https://gitee.com/nwafu_nan/chinesechess/pulls).
123
124 Copyright and Licence
125 ---------------------
126
127 Copyright (C) 2020-2022 by Nan Geng <[email protected]>
128 ----------------------------------------------------------------------
129
130 This work may be distributed and/or modified under the
131 conditions of the LaTeX Project Public License, either
132 version 1.3c of this license or (at your option) any later
133 version. This version of this license is in
134 http://www.latex-project.org/lppl/lppl-1-3c.txt
135 and the latest version of this license is in
136 http://www.latex-project.org/lppl.txt
137 and version 1.3 or later is part of all distributions of
138 LaTeX version 2005/12/01 or later.
139
140 This work has the LPPL maintenance status "maintained".
141
142 The Current Maintainer of this work is Nan Geng.
143
144 This package consists of chinesechess.sty, chinesechess.tex and README.md(this file),
145 and the derived files chinesechess.pdf.
146