summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/onedown/Examples/showAll.tex
blob: e7571f6d3cf09c16efbbb2435e24bb673fab6e71 (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
\documentclass[onedown-examples]{subfiles}

\begin{document}
\vfill
|\showAll| displays a card diagram with the 4 hands. Here the \east hand is
empty and is skipped completely from the diagram. If you want to show an
empty suit explicitly (which is a good thing), just use a single hyphen.
\OneDown will make an en-dash out of it. We added the dealer and
vulnerability to the diagram, the value of which was calculated
automatically from the given boardnumber(18). Please note that the
vulnerable side is printed in red and that the dealer is underlined in the
compass. With |\setdefaults{compmid=\boardtext}| we write the board number
as mid text in the compass. If given this way, it will always print the
\emph{actual} board number, as you can see in the following examples.
\vfill
% due to the grouping of the HBox, we must set |compmid| here.
% Otherwise it would not be in effect in the next HBox!
\setdefaults{compmid=\boardtext}
\begin{HBox}{showBoardNr\hfill File: \FileName}
\setdefaults{compmid=\boardtext}
\northhand{AJ}{K}{-}{-}
\southhand{32}{-}{A}{-}
\easthand{}{}{}{}
\westhand{KQ}{A}{-}{-}
\boardnr{18}
\leftupper{\dealertext}{}{\vulnertext}
\showAll
\end{HBox}
\vfill
This example shows how to add several conditions, such as declarer, lead
etc.\ to a diagram. |\boardtext| just prints the plain board number and was
called in |\setdefault{compmid=\boardtext}| (rather than using the
hard-coded number) to set it in the middle of the compass. In |\leftupper|
we use |\boardtext*| to print the boardnumber behind an additional text.

You will have noticed that the right upper text does not fit well in the
diagram: it collides with the \north hand\ldots
\vfill
\begin{HBox}{Board Number\hfill File: \FileName}
\boardnr{19}
\northhand{AK43}{AQJ83}{AJ98}{-}
\southhand{87}{T5}{QT5}{K98654}
\easthand{JT6}{764}{K43}{JT32}
\westhand{Q952}{K92}{762}{AQ7}
\leftupper{\boardtext*}%
  {\dealertext}{\vulnertext}
\rightupper{\contract: 3\,\NT}{\declarer \south}{}
\rightlower{\lead: \Di 7}{}{}
\showAll*
\end{HBox}
%
\vfill
 \needspace{8\baselineskip}
 \ldots so we add some (here 2ex) offset, to shift the text a bit to the
right. One can shift the upper/lower and left/right texts independently. A
positive offset shifts away from the compass, a negative offset would shift
the text towards the compass.
\vfill
\begin{HBox}{Board Number\hfill File: \FileName}
\boardnr{20}
\northhand{AK43}{AQJ83}{AJ98}{-}
\southhand{87}{T5}{QT5}{K98654}
\easthand{JT6}{764}{K43}{JT32}
\westhand{Q952}{K92}{762}{AQ7}
\leftupper{\boardtext*}%
  {\dealertext}{\vulnertext}
\rightupper[2ex]{\contract: 3\,\NT}{\declarer \south}{}
\rightlower{\lead: \Di 7}{}{}
\showAll*
\end{HBox}
%
\vfill
Please note that the board number in the middle of the compass has been
updated each time that we called |\boardnr|. More important however, is to
see that the very long suit of the \north hand collides massively with the
right upper condition text. Shifting the text wouldn't help here.
\vfill
\begin{HBox}{Very long suits 1\hfill File: \FileName}
\boardnr{21}
\northhand{AKQJT98765432}{-}{-}{-}
\southhand{-}{2}{2}{AKQJT987654}
\easthand{-}{876543}{876543}{3}
\westhand{-}{AKQJT9}{AKQJT9}{2}
\showAll
\end{HBox}
\vfill
\needspace{8\baselineskip}
A simple way to  'correct' this is by lowering the text: leave the first
line of the right-upper text empty.
\vfill
\begin{HBox}{Correction by lowering the text\hfill File: \FileName}
\rightupper{}{\contract: 3\,\NT}{\declarer \south}
\northhand{AKQJT98765432}{-}{-}{-}
\southhand{-}{2}{2}{AKQJT987654}
\easthand{-}{876543}{876543}{3}
\westhand{-}{AKQJT9}{AKQJT9}{2}
\showAll
\end{HBox}
\vfill
Another problem with (very) long suits, is that the \eastwest hands can
seem too close to a \northsouth hand, as can be seen in next example. Of
course the hands are not any closer to each other as before, but the long
suit in the unfavourable position make it clearly look so.
\vfill
\begin{HBox}{Very long suits 2\hfill File: \FileName}
\rightupper{\contract: 3\,\NT}{\declarer \south}{}
\northhand{-}{2}{2}{AKQJT987654}
\southhand{AKQJT98765432}{-}{-}{-}
\easthand{-}{876543}{876543}{3}
\westhand{-}{AKQJT9}{AKQJT9}{2}
\rightlower{}{\lead: \Di 7}{}
\showAll
\end{HBox}
\vfill
\needspace{8\baselineskip}
The solution is to add some offset. In a previous example we already showed
how to use an offset with an annotation. Here we add an offset to the
apropriate \emph{hand}. This
is done with the optional parameter in the \north and the \south hand. The
\north hand shifts upwards, the \south hand downwards. As a little
demonstration, we also shifted the \east hand a bit to the right and the
\west hand a bit to the left. Negative offset values reverse the shift
direction.
\vfill
\begin{HBox}{Very long suits 3 with extra offset\hfill File: \FileName}
\northhand[1em]{-}{2}{2}%
    {AKQJT987654}
\southhand[1em]{AKQJT98765432}%
    {-}{-}{-}
\easthand[1em]{-}{876543}%
    {876543}{3}
\westhand[1em]{-}{AKQJT9}%
    {AKQJT9}{2}
\showAll
\end{HBox}
\vfill
\end{document}
\endinput