summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/onedown/examples/onedown-ref.tex
blob: 44930e12e065dc615b2a66ce4b94a5299778f6ad (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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
\documentclass[onedown-examples]{subfiles}
\usepackage[Q=yes]{examplep}
\makeatletter
\def\verbatim@font{\ttfamily\bfseries
                   \hyphenchar\font\m@ne
                   \@noligs}
\makeatother
%
\newcommand\bs{%
  \texttt{%
    \upshape% the itshape of meta screws the backslash
    \textbackslash%
  }%
}% bs
%
\let\olditem\item
\renewcommand\item[1][\relax]{\olditem\textbf{\bs#1}}
%\def\Item{\olditem[\bs]}
%
\definecolor{optbackgr}{named}{lightgray}
\newcommand\Oarg[1]{\colorbox{optbackgr}{\texttt{#1}}}

\begin{document}

\larger
\newgeometry{total={150mm, 265mm},left=25mm,top=15mm}
\pagestyle{empty}
%\iffalse
\centerline{\larger\larger\textbf{\OneDown Reference Guide}}
\par\vspace{1\baselineskip}\noindent
Here we show all user commands of the package |onedown| in alphabetical
order. If we only show the ouput that a command produces, then this output
is shown directly behind the command on the same line. If a description of
the command is given, then this description starts on a new line. Optional
parameters of a command appear in brackets |[...]|, parenthesis |(...)| or
angles |<...>|. Optional tokens of a command appear with a different
background color, like \Oarg{*!}. Output of a tokenized |\macro*!| is shown
as:
\quad|\macro|\Oarg{*!}|: \macro, \macro*, \macro!, \macro*!|\\
All output is shown for the English language.

\begin{description}[itemsep=-0.3em]
\item[ace]: \ace
\item[Ace\Oarg{*!}]: \Ace, \Ace*, \Ace!, \Ace*!

\item[alert]: |2\NT\alert| typesets 2\NT\alert and |2\Cl\alert| typesets
2\Cl\alert

\item[all]: \all
\item[All\Oarg{*!}]: \All, \All*, \All!, \All*! 

\item[allpass]: \allpass 
\item[Allpass\Oarg{*!}]: \Allpass, \Allpass*, \Allpass!, \Allpass*! 

\item[announce]: |2\He\announce| typesets 2\He\announce

\item[bidderfont\Q{{font} }]\\
Defines the font for the names in
bidding diagrams. The mandatory parameter for all font commands is a font
description like |\sffamily\bfseries\HUGE| or |\mdseries\slshape\smaller|
or |\sffamily\scalefont{3}|.

\item[board]: \board
\item[Board\Oarg{*!}]: \Board, \Board*, \Board!, \Board*! 

\item[boardnr\Q{{Nr} }]\\
Calculates (and stores) the dealership and vulnerability if |Nr|
is a number. If it is just a text it is stored to be used instead of a
board number.

\item[boardtext\Oarg{*}]\\
Typesets the value that is stored with |\boardnr|.
The star version writes the text \textbf{\boardtext*} in front of it.

\item[by]: \by

\item[Cl]: \Cl

\item[compassfont\Q{{font} }]\\
Defines the font for the compass.

\item[contract]: \contract
\item[Contract\Oarg{*!}]: \Contract, \Contract*, \Contract!, \Contract*!

\item[deal]: \deal
\item[Deal\Oarg{*!}]: \Deal, \Deal*, \Deal!, \Deal*! 

\item[dealer\Q{[text]}]\\
Typeset the defined dealer. With the optional
parameter one can define the dealer.

\item[dealertext\Q{[text]}]\\
Typeset the user-defined value for the |\dealer|,
e.g.\ \mbox{\dealertext[\east]}. With the optional parameter one can define
the |text| to be printed \emph{as is}.

\item[declarer]: \declarer
\item[Declarer\Oarg{*!}]: \Declarer, \Declarer*, \Declarer!, \Declarer*! 

\item[Di]: \Di

\item[double]: \double
\item[Double\Oarg{*!}]: \Double, \Double*, \Double!, \Double*!

\item[DP]: \DP
\item[dpts\Oarg{*!}]: \dpts, \dpts*, \dpts!, \dpts*!

\item[east]: \east
\item[East\Oarg{*!}]: \East, \East*, \East!, \East*!

\item[easthand\Q{[h-offset]{Sp}{He}{Di}{Cl}}]\\
Defines the cards for the
\East*!-player. With the optional parameter |h-offset| one can adapt the
(\emph{horizontal}) distance between hand and compass (default
\textbf{0pt}). The 4 mandatory parameters define the cards for the 4 suits.
To denote the rank \suit{T}, one has to use the uppercase letter |T|.

\item[eastwest]: \eastwest
\item[Eastwest\Oarg{*!}]: \EastWest, \EastWest*, \EastWest!, \EastWest*!

\item[expertquiz\Oarg{*!}\Q{[comment]}{award}]\\
Typesets a quiz, showing a
predefined hand and a predefined bidding diagram. The star version centers
the output. The token |!| forces a newline between hand and bidding
diagram. With the optional parameter one can add some comments. The
mandatory parameter defines the award for the different solutions.

\item[explainit\Q{{expl} }]\\
writes \emph{expl} below the bidding diagram in a footnote like way.

\item[footlinetext\Q{{text} }]\\
Typeset the text below the card diagram.

\item[FSF]: \FSF
\item[fsforce\Oarg{*!}]: \fsforce, \fsforce*, \fsforce!, \fsforce*!

\item[gamefont\Q{{font} }]\\
Defines the font for card diagrams, hands and suits.

\item[GF]: \GF
\item[gforce\Oarg{*!}]: \gforce, \gforce*, \gforce!, \gforce*!

\item[hand\Oarg{*!-}\Q{[pos]{Sp}{He}{Di}{Cl}}]\\
Typesets the cards of 1 single hand,
normally horizontally, left aligned. The star version centers the output.
The token |!| typesets the hand vertically, left aligned. With both |*!|
the hand is typeset vertically, centered. The optional argument |pos|
(default \textbf{c}), controls the horizontal alignment. 
The third token |-| suppresses all output, which is then only saved for
later use (in e.g.\ |\expertquiz|). The 4
mandatory parameters define the cards for the 4 suits. To denote the rank
\suit{T}, one has to use the uppercase letter |T|.

\item[handskip\Q{{length description} }]\\
Adds |length| to the distance (default |1em|) between the rightmost hand
and the bidding diagram.

\item[HCP]: \HCP

\item[headlinetext\Q{{text} }]\\
Typeset the text above the card diagram.

\item[He]: \He

\item[HLP]: \HLP

\item[hpts\Oarg{*!}]: \hpts, \hpts*, \hpts!, \hpts*!

\item[jack]: \jack
\item[Jack\Oarg{*!}]: \Jack. \Jack*, \Jack!, \Jack*!
 
\item[king]: \king
\item[King\Oarg{*!}]: \King, \King*, \King!, \King*!

\item[lead]: \lead
\item[Lead\Oarg{*!}]: \Lead, \Lead*, \Lead!, \Lead*!

\item[leftlower\Q{[h-offset]{line1}{line2}{line3}}]

\item[leftupper\Q{[h-offset]{line1}{line2}{line3}}]\\
Typesets an annotation of 3 lines in the left lower/upper corner of the
card diagram. With the optional parameter one can add some extra horizontal
space between hand and annotation.

\item[legendfont\Q{{font} }]\\
Defines the font for annotations in card diagrams.

\item[LP]: \LP
\item[lpts\Oarg{*!}]: \lpts, \lpts*, \lpts!, \lpts*!

\item[markit]\\
sets a footnote-like marker in a bidding diagram.

\item[namefont\Q{{font} }]\\
Defines the font for the real world names in bidding diagrams.

\item[namesEW\Q{{E-name}{W-name}}]\\
Defines the real world names for the \eastwest players, that will appear
in the bidding diagram.

\item[namesNS\Q{{N-name}{S-name}}]\\
Defines the real world names for the \northsouth players, that will appear
in the bidding diagram.


\item[newgame]\\
Resets some stored data 

\item[NMF]: \NMF
\item[nmforce\Oarg{*!}]: \nmforce, \nmforce*, \nmforce!, \nmforce*!

\item[none]: \none
\item[None\Oarg{*!}]: \None, \None*, \None!, \None*! 

\item[north]: \north 
\item[North\Oarg{*!}]: \North, \North*, \North!, \North*! 

\item[northhand\Q{[v-offset]{Sp}{He}{Di}{Cl}}]\\
Defines the cards for the
\North*!-player. With the optional parameter |v-offset| one can adapt the
(\emph{vertical}) distance between hand and compass (default \textbf{0pt}).
The 4 mandatory parameters define the cards for the 4 suits. To denote the
rank \suit{T}, one has to use the uppercase letter |T|.

\item[northsouth]: \northsouth 
\item[NorthSouth\Oarg{*!}]: \NorthSouth, \NorthSouth*, \NorthSouth!, \NorthSouth*! 

\item[nt\Oarg{*!}]: \nt, \nt*, \nt!, \nt*! 
\item[NT]: \NT 

\item[onesuitAll\Oarg{*!}\Q{{N}{S}{E}{W}}]\\
Typesets the cards of 1 suit for all
players. The star version centers the output. The token |!| prints a small
box rather than the compass. The 4 mandatory parameters denote the cards
for the \North*!-, the \South*!-, the \East*!- and the \West*!-player.

\item[onesuitEW\Oarg{*!}\Q{{E}{W}}]\\
Same as |onesuitAll|, but only for the \East*!- and the \West*!-player.

\item[onesuitNE\Oarg{*!}\Q{{N}{E}}]\\
Same as |onesuitAll|, but only for the \North*!- and the \East*!-player.

\item[onesuitNS\Oarg{*!}\Q{{N}{S}}]\\
Same as |onesuitAll|, but only for the \North*!- and the \South*!-player.

\item[onesuitNW\Oarg{*!}\Q{{N}{W}}]\\
Same as |onesuitAll|, but only for the \North*!- and the \West*!-player.

\item[otherfont\Q{{font} }]\\
Defines the font for other items.

\item[pass]: \pass 
\item[Pass\Oarg{*!}]: \Pass, \Pass*, \Pass!, \Pass*! 

\item[queen]: \queen
\item[Queen\Oarg{*!}]: \Queen, \Queen*, \Queen!, \Queen*!

\item[redouble]: \redouble 
\item[Redouble\Oarg{*!}]: \Redouble, \Redouble*, \Redouble!, \Redouble*! 

\item[resetfonts]\\
Sets all fonts back to their default value.

\item[rightlower\Q{[h-offset]{line1}{line2}{line3}}]
\item[rightupper\Q{[h-offset]{line1}{line2}{line3}}]\\
Typesets an annotation of 3 lines in the right lower/upper corner of the
card diagram. With the optional parameter one can add some extra horizontal
space between hand and annotation.

\item[setdefaults\Oarg{*}\string{key1=val1,key2=val2,\ldots\string}]\\
With the keys |bidder|, |compass|, |game|, |legend|, |name| or |other| one
can set the default font for the respective items. With the keys
|compline|, |compmid|, |compshow|, |compsize| or |compturn| on can set the
look of the compass. With the keys |bidders|, |bidfirst|, |bidline| or
|bidlong| one can fine-tune the bidding diagram. The keys that can be used
as package options (|colors|, |err| and |warn|) can also be set here.
The star form also calls |\resetfonts| which effectuates any font change
immediately.

\item[SF]: \SF
\item[sforce\Oarg{*!}]: \sforce, \sforce*, \sforce!, \sforce*!

\item[showAll\Oarg{*+}\Q{[pos]}]\\
Typesets a card diagram with 4 (previously
defined, i.e.\ with |\northhand| etc.) hands. The star version centers the
output. The token |+| adds a bidding table to the diagram, that has to be
previously defined, i.e.\ with e.g:\\
|\begin{bidding}-|\ldots|\end{bidding}|. The optional parameter |pos|
(default~\textbf{c}) aligns the diagram.

\DeleteShortVerb{\|}
\item[showEW\Oarg{*+}\Q{[pos]}(E|W)]\\
\MakeShortVerb{\|}
Same as |\showAll|, but for the \East*!- and the \West*!-hand. |\showEW(E)|
prints only the \East*!-hand

\item[showNE\Oarg{*+}\Q{[pos]}]\\
Same as |\showAll|, but for the \North*!- and the \East*!-hand.

\DeleteShortVerb{\|}
\item[showNS\Oarg{*+}\Q{[pos]}(N|S)]\\
\MakeShortVerb{\|}
Same as |\showAll|, but for the \North*!- and the \South*!-hand. |\showNS(S)|
prints only the \South*!-hand
\item[showNW\Oarg{*+}\Q{[pos]}]\\
Same as |\showAll|, but for the \North*!- and the \West*!-hand.

\item[south]: \south
\item[South\Oarg{*!}]: \South, \South*, \South!, \South*!

\item[southhand\Q{[v-offset]{Sp}{He}{Di}{Cl}}]\\
Defines the cards for the
\South*!-player. With the optional parameter |v-offset| one can adapt the
(\emph{vertical}) distance between hand and compass (default \textbf{0pt}).
The 4 mandatory parameters define the cards for the 4 suits. To denote the
rank \suit{T}, one has to use the uppercase letter |T|.

\item[Sp]: \Sp

\item[suit\Q{[suit symbol]{cards}}]\\
Typesets the cards of 1 single suit.
With the optional parameter one can add a suit symbol (e.g.\ \He) in front
of the cards. The mandatory parameter defines the cards for the suit. To
denote the rank \suit{T}, one has to use the letter |T|.

\item[TP]: \TP
\item[tpts\Oarg{*!}]: \tpts, \tpts*, \tpts!, \tpts*!

\item[TSF]: \TSF
\item[tsforce\Oarg{*!}]: \tsforce, \tsforce*, \tsforce!, \tsforce*!

\item[vulner\Q{[text]}]\\
Typeset the user-defined vulnerability. With the optional parameter one can
define the vulnerability.

\item[vulnertext\Q{[text]}]\\
Typeset the defined value for the |\vulner|, e.g.\
\mbox{\vulnertext[\NorthSouth*]}.  With the optional parameter one can
define the |text| to be printed \emph{as is}.

\item[west]: \west 
\item[West\Oarg{*!}]: \West, \West*, \West!, \West*! 

\item[westhand\Q{[h-offset]{Sp}{He}{Di}{Cl}}]\\
Defines the cards for the
\West*!-player. With the optional parameter |h-offset| one can adapt the
(\emph{horizontal}) distance between hand and compass (default
\textbf{0pt}). The 4 mandatory parameters define the cards for the 4 suits.
To denote the rank \suit{T}, one has to use the uppercase letter |T|.

\olditem[\string\begin\string{bidding\string}\Oarg{*!-}\Q{[pos](description)}\ldots\string\end\string{bidding\string}]~\\
Typesets a bidding diagram. The star version centers the output. The
token~|!| forces a short form (\North*!) rather than the long form
(\North*) in the table header. The token~|-| suppresses all output, but the
saved data can be used elsewhere. The optional paramater |pos| (default
\textbf{c}) controls the alignment of the diagram. With the 2nd optional
parameter |description| one can add annotations (see also |\markit| and
|\explainit|) below the diagram. The bids in the bidding can both be
shorthands like |3S| as well as |3\Sp|. The same goes for calls: both |p|
and |\pass| are possible. For an overview of all possible shorthands, refer
to the last page of this document.
\par
The command |\setdefaults| has some keys to fine tune the
look of the bidding diagram. If the real world names of the players are
defined (e.g.\ with |\namesNS|, then they also appear in the table header.

\olditem[\string\begin\string{biddingpair\string}\Oarg{*!-}\Q{[pos](description)}\ldots\string\end\string{biddingpair\string}]~\\
Same as environment |bidding| but with only 2 columns.

\olditem[\string\begin\string{play\string}\Oarg{*}\Q{{lead}[trump]}\ldots\string\end\string{play\string}]~\\
Typesets a diagram with the playing tricks. The star version centers the
output. The mandatory parameter defines the player who had the opening
lead. The optional parameter defines the trump suit, the default is \NT.
This environment produces a table with 8 columns: the running number; the
player who had had the lead; the 4 cards played in this trick and finally
the 2 columns that show how many tricks \northsouth{} and \eastwest{} have
won so far. The user has only to enter the 4 colums that denote the 4 cards
played in each trick. The rest is handled by \OneDown.
%
\end{description}
%
% reset \item
%\fi
\let\item\olditem
%
\newpage
\centerline{\larger\textbf{Shorthands/Specials in bidding diagrams}}
\par\vspace{1\baselineskip}\noindent
%
\begin{minipage}{6cm}
\begin{verbatim}
\begin{bidding}
p & X & R & P \\
\end{bidding}
\end{verbatim}
\end{minipage}
%
\begin{minipage}{7cm}
\begin{bidding}
p & X & R & P \\
\end{bidding}
\end{minipage}
%
\\[1\baselineskip]
%
\begin{minipage}{6cm}
\begin{verbatim}
\setdefaults{bidlong=off}
\begin{bidding}
p & X & R & P \\
{\frame{2H}} & 
{\frame{2\He}} & 
{\textit{R}} & 
{\textit{\redouble}} \\
\end{bidding}
\end{verbatim}
\end{minipage}
%
\begin{minipage}{6cm}
\setdefaults{bidlong=off}
\begin{bidding}
p & X & R & P \\
{\frame{2H}} & {\frame{2\He}} & {\textit{R}} & {\textit{\redouble}} \\
\end{bidding}
\end{minipage}
%
\\[1\baselineskip]
%
\centerline{\larger\textbf{Macros in bidding diagrams}}
\par\vspace{0.3\baselineskip}\noindent
These macros, called in a bidding table\ldots
\par\vspace{0.5\baselineskip}\noindent
%
\begin{verbatim}
\begin{bidding}
1 \Pass     & \Double     & \Redouble     & \Allpass \\
2 \Pass*    & \Double*    & \Redouble*    & \Allpass* \\
3 \Pass!    & \Double!    & \Redouble!    & \Allpass! \\
4 \Pass*!   & \Double*!   & \Redouble*!   & \Allpass*! \\
5 \pass     & \double     & \redouble     & \allpass \\
6 {\Pass*}  & {\Double*}  & {\Redouble*}  & {\Allpass*} \\
7 {\Pass!}  & {\Double!}  & {\Redouble!}  & {\Allpass!} \\
8 {\Pass*!} & {\Double*!} & {\Redouble*!} & {\Allpass*!} \\
9 {\pass}   & {\double}   & {\redouble}   & {\allpass} \\
\end{bidding}
\end{verbatim}
%

\ldots produce this output. Please note that line 2--5 are peculiar.
\par\vspace{0.3\baselineskip}\noindent
\begin{tabular}{lBBBB}
  & {\west}   & {\north}    & {\east}       & {\south} \\
1 & \Pass     & \Double     & \Redouble     & \Allpass \\
2 & \Pass*    & \Double*    & \Redouble*    & \Allpass* \\
3 & \Pass!    & \Double!    & \Redouble!    & \Allpass! \\
4 & \Pass*!   & \Double*!   & \Redouble*!   & \Allpass*! \\
5 & \pass     & \double     & \redouble     & \allpass \\
6 & {\Pass*}  & {\Double*}  & {\Redouble*}  & {\Allpass*} \\
7 & {\Pass!}  & {\Double!}  & {\Redouble!}  & {\Allpass!} \\
8 & {\Pass*!} & {\Double*!} & {\Redouble*!} & {\Allpass*!} \\
9 & {\pass}   & {\double}   & {\redouble}   & {\allpass} \\
\end{tabular}\\
\end{document}
\endinput