summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/xq/xqexample.tex
blob: ecf221df1d7b7c7c092f0a90f45d8fbe77b42063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
%example file for demonstrating the usage of xq.sty. 
\documentclass[twocolumn,11pt]{article}
\usepackage{xq}

\parindent 0pt
\setlength{\columnsep}{5mm}
\setlength{\textheight}{220mm}
\setlength{\headheight}{13.6pt}
\setlength{\hoffset}{-3.0mm}
\setlength{\voffset}{-6.0mm}

\begin{document}

\texttt{The xq package is made for writing about xiangqi or chinese chess. This file demonstrates what the package can do.}

\mylanguage english
%i ve tried to enable input of the language typical letters for the different pieces. By now there 
%are letters defined for: 
%
%"german" (King=F, Advisor/Guard=M, Elephant=E, Chariot=W, Cannon=K, Horse=P, Soldier=S - for red pieces
% and corresponding lower cases for black pieces) 
%"english" (K,A,E,R,C,H,P); 
%"spanish" (R,O,E,T,B,C,P); 
%"italian" (R,M,E,T,B,C,P); 
%"french" (R,M,E,T,B,C,P);  
%"czech" (K,R,S,V,D,J,P) and 
%"dutch" (G,A,O,T,K,P,S)
%
%If you want to add your language or do not like the letters I used goto xq.sty and use the pattern 
%to define the letter definitions according to your preferences. Please rename the style file, if you 
%make any changes. 
%This selection affects on the one hand the letters for the pieces when setting up a position in the 
%input file and on the other hand the letters for pieces shown in the move blocks in the output file. 

\bigskip
\texttt{First we write down a complete game.}
\newgame
%defines the board with the start position, the movecount, shown in the move blocks, is set to 0.

\begin{center}
{\bf\large{Player\,1\,--\,Player\,2}}
\end{center}

\move f1e2 h8e8 
%note that there is absolutely no check for legal moves - this means, that on the one hand any piece can move to any place, even to the place it comes from and on the other hand a piece moved from/to a place that does not exist on the board will not be shown, selecting an empty square as start square produces an error - so everything has to be correct here
\bigskip
\texttt{Moves are input like this: "f1e2 h8e8", the letter for the piece that is moved is generated automatically and also, whether it is a capture or not. The piece letters shown depend on the language, you choose at the beginning of the tex file, in this case it is "english". By now there are letters defined for english, spanish, french, italian, czech, dutch and my mother tongue german. I created a pattern in the style file, where you can add your language typical letters, if the ones already defined do not match your preferences.} \\
\bigskip

\move h1g3 h0g8
\move b1c3 i0h0
\move i1h1 h0h6
\move h3h5 b0a8
\move c4c5 b8c8
\move c1e3 c7c6
\move c3b5 c6c5
\move e3c5 h6c6
\move c5e3 g7g6
\move b5a7 c6c3
\move b3b6 c3c7
\move h5h7 e7e6
\cr ! 
%shows the comment you input here after the next red move 
\move b6g6 xxxx 
%shows a move only of red, actually, only the first letter of the side, that does not move, has to be a "x", but it have to be 4 letters

\newpage

\showboard 
%shows the board in a size fitted to twocolumn on a4paper according to my personal preference, the position shown should be the one the moves input are leading to
\texttt{The board is shown with a single command. The style finds the correct position depending on the moves you input.}
\bigskip
\cb ? 
%the same for next black move
\move xxxx c7a7 
%move only of black
Black wins a major piece, but more important is that Red gets a strong attack on the right wing of the board.
\cr + 
\move g6g0 f0e9
\cr +
\move h7h0 xxxx 

It is not better for Red to play \bv 16.Ci0, for after 16|Kf0 17.Chh0+ Kf9 18.Rh9+ Kf8 19.Rg9 Hh6 20.Rg6 \ev Red gets back the major  piece only\dots %between \bv and \ev  "|" produces \ldots, "*" produces \times (the capturing symbol), if you need these to be output, use \makevisible*\makeactive

\move xxxx g8h0
\move h1h0 a0a9
\cr +
\move g0d0 e9f0
\move d0f0 a9f9
\cr +
\move f0c0 xxxx 
but in the game Red takes the whole defense of Black\dots 
\move xxxx e0e9
\move a1b1 a7f7
\cr + 
\move b1b9 c8c9
\move c0a0 e8d8

\newpage

\showwesternboard

\texttt{You can also show the board with western pieces.}
\bigskip

\move b9a9 d8d2
\move a0a8 xxxx
\dots and the major piece.
\move xxxx e9e8
\cr +
\move h0h8 f7f8
\move a9c9 xxxx
Black resigned the game.
\begin{center}
{\bf{\large{1\,:\,0}}}
\end{center}

\newpage
\newpage

\texttt{Now we start playing from a special position, that is input in the tex file.}

\begin{center}
{\bf{\large{Exercise}}}
\end{center}
In the diagram shown below both sides can checkmate the opponent, depending only on who is to move.

\resetboard 
%makes the board to show an empty one, recommended before setting up a position

\piece Ec1
%by now positions have to be input piece by piece which is not so cool, sorry :-) 
\piece Ke1
\piece Af1
\piece Rh1
\piece Ae2
\piece Ha3
\piece Ee3
\piece Pc4
\piece Pg4
\piece Pi4
\piece Pa5
\piece ce5
\piece Ci5
\piece pc6
\piece rd6
\piece pg6
\piece pa7
\piece pe7
\piece Cg7
\piece hc8
\piece ee8
\piece hg8
\piece ae9
\piece ec0
\piece ke0
\piece af0

\showboard

1.\,Red to move checkmates in 3 moves\\
2.\,Black to move checkmates in 4 moves\\

\textit{Solution}\\

1.\,Red to move
\movecount=0
\cr +
\move i5i0 g8h0
\cr +
\move g7g0 e8g0
\cr \#
\move i0g0 xxxx

\resetboard

\piece Ec1
\piece Ke1
\piece Af1
\piece Rh1
\piece Ae2
\piece Ha3
\piece Ee3
\piece Pc4
\piece Pg4
\piece Pi4
\piece Pa5
\piece ce5
\piece Ci5
\piece pc6
\piece rd6
\piece pg6
\piece pa7
\piece pe7
\piece Cg7
\piece hc8
\piece ee8
\piece hg8
\piece ae9
\piece ec0
\piece ke0
\piece af0

\bigskip
2.\,Black to move

\movecount=1
\move xxxx e0d0
\cr +
\move i5i0 d0d9
\cr +
\move i0i9 d9d8
\move i9i6 xxxx
\dots or any other move
\cb \#
\move xxxx d6d1 

\newpage

\texttt{I added a small font with some additional signs, f.e. to demonstrate legal moves of pieces. But by now this is not more than a first draft with only the four extra signs shown in the diagram} 

\resetboard

\piece Ke1
\addsign Ld1
\addsign Lf1
\addsign Le2

\piece ng8
\piece pg7
\addsign Uf6
\addsign Uh6
\addsign Li7
\addsign Li9
\addsign Lh0
\addsign Lf0
\addsign Le9
\addsign Le7

\addsign Ra1
\addsign Ba0

\showboard
%pieces in running text
\newpage

\texttt{pieces in running text}
\bigskip

\textpiece K \textpiece k 
the kings 

\vspace{2pt}

\textpiece A \textpiece a 
the advisors/guards

\makebox[21pt][c]{\vdots}

\vspace{4pt}
\westerntextpiece H \westerntextpiece h 
the knights/horses

\vspace{2pt}

\westerntextpiece P \westerntextpiece p 
the pawns/soldiers
\vspace{2pt}

%finally a large board
\newpage
\onecolumn

\newgame
\texttt{I also included a large board.}
\showlargeboard 
%shows a board in a size fitted to onecolumn on a4paper according to my personal preference. For western pieces input \showlargewesternboard

\texttt{Thats all! Hopefully everything works like it should!}

\end{document}

%Stephan Weinhold 09.2006
%stewei@surfeu.de