Debian Codegraph @

texmf-dist/doc/latex/onedown/Examples/showAll.tex

raw
1 \documentclass[onedown-examples]{subfiles}
2
3 \begin{document}
4 \vfill
5 |\showAll| displays a card diagram with the 4 hands. Here the \east hand is
6 empty and is skipped completely from the diagram. If you want to show an
7 empty suit explicitly (which is a good thing), just use a single hyphen.
8 \OneDown will make an en-dash out of it. We added the dealer and
9 vulnerability to the diagram, the value of which was calculated
10 automatically from the given boardnumber(18). Please note that the
11 vulnerable side is printed in red and that the dealer is underlined in the
12 compass. With |\setdefaults{compmid=\boardtext}| we write the board number
13 as mid text in the compass. If given this way, it will always print the
14 \emph{actual} board number, as you can see in the following examples.
15 \vfill
16 % due to the grouping of the HBox, we must set |compmid| here.
17 % Otherwise it would not be in effect in the next HBox!
18 \setdefaults{compmid=\boardtext}
19 \begin{HBox}{showBoardNr\hfill File: \FileName}
20 \setdefaults{compmid=\boardtext}
21 \northhand{AJ}{K}{-}{-}
22 \southhand{32}{-}{A}{-}
23 \easthand{}{}{}{}
24 \westhand{KQ}{A}{-}{-}
25 \boardnr{18}
26 \leftupper{\dealertext}{}{\vulnertext}
27 \showAll
28 \end{HBox}
29 \vfill
30 This example shows how to add several conditions, such as declarer, lead
31 etc.\ to a diagram. |\boardtext| just prints the plain board number and was
32 called in |\setdefault{compmid=\boardtext}| (rather than using the
33 hard-coded number) to set it in the middle of the compass. In |\leftupper|
34 we use |\boardtext*| to print the boardnumber behind an additional text.
35
36 You will have noticed that the right upper text does not fit well in the
37 diagram: it collides with the \north hand\ldots
38 \vfill
39 \begin{HBox}{Board Number\hfill File: \FileName}
40 \boardnr{19}
41 \northhand{AK43}{AQJ83}{AJ98}{-}
42 \southhand{87}{T5}{QT5}{K98654}
43 \easthand{JT6}{764}{K43}{JT32}
44 \westhand{Q952}{K92}{762}{AQ7}
45 \leftupper{\boardtext*}%
46 {\dealertext}{\vulnertext}
47 \rightupper{\contract: 3\,\NT}{\declarer \south}{}
48 \rightlower{\lead: \Di 7}{}{}
49 \showAll*
50 \end{HBox}
51 %
52 \vfill
53 \needspace{8\baselineskip}
54 \ldots so we add some (here 2ex) offset, to shift the text a bit to the
55 right. One can shift the upper/lower and left/right texts independently. A
56 positive offset shifts away from the compass, a negative offset would shift
57 the text towards the compass.
58 \vfill
59 \begin{HBox}{Board Number\hfill File: \FileName}
60 \boardnr{20}
61 \northhand{AK43}{AQJ83}{AJ98}{-}
62 \southhand{87}{T5}{QT5}{K98654}
63 \easthand{JT6}{764}{K43}{JT32}
64 \westhand{Q952}{K92}{762}{AQ7}
65 \leftupper{\boardtext*}%
66 {\dealertext}{\vulnertext}
67 \rightupper[2ex]{\contract: 3\,\NT}{\declarer \south}{}
68 \rightlower{\lead: \Di 7}{}{}
69 \showAll*
70 \end{HBox}
71 %
72 \vfill
73 Please note that the board number in the middle of the compass has been
74 updated each time that we called |\boardnr|. More important however, is to
75 see that the very long suit of the \north hand collides massively with the
76 right upper condition text. Shifting the text wouldn't help here.
77 \vfill
78 \begin{HBox}{Very long suits 1\hfill File: \FileName}
79 \boardnr{21}
80 \northhand{AKQJT98765432}{-}{-}{-}
81 \southhand{-}{2}{2}{AKQJT987654}
82 \easthand{-}{876543}{876543}{3}
83 \westhand{-}{AKQJT9}{AKQJT9}{2}
84 \showAll
85 \end{HBox}
86 \vfill
87 \needspace{8\baselineskip}
88 A simple way to 'correct' this is by lowering the text: leave the first
89 line of the right-upper text empty.
90 \vfill
91 \begin{HBox}{Correction by lowering the text\hfill File: \FileName}
92 \rightupper{}{\contract: 3\,\NT}{\declarer \south}
93 \northhand{AKQJT98765432}{-}{-}{-}
94 \southhand{-}{2}{2}{AKQJT987654}
95 \easthand{-}{876543}{876543}{3}
96 \westhand{-}{AKQJT9}{AKQJT9}{2}
97 \showAll
98 \end{HBox}
99 \vfill
100 Another problem with (very) long suits, is that the \eastwest hands can
101 seem too close to a \northsouth hand, as can be seen in next example. Of
102 course the hands are not any closer to each other as before, but the long
103 suit in the unfavourable position make it clearly look so.
104 \vfill
105 \begin{HBox}{Very long suits 2\hfill File: \FileName}
106 \rightupper{\contract: 3\,\NT}{\declarer \south}{}
107 \northhand{-}{2}{2}{AKQJT987654}
108 \southhand{AKQJT98765432}{-}{-}{-}
109 \easthand{-}{876543}{876543}{3}
110 \westhand{-}{AKQJT9}{AKQJT9}{2}
111 \rightlower{}{\lead: \Di 7}{}
112 \showAll
113 \end{HBox}
114 \vfill
115 \needspace{8\baselineskip}
116 The solution is to add some offset. In a previous example we already showed
117 how to use an offset with an annotation. Here we add an offset to the
118 apropriate \emph{hand}. This
119 is done with the optional parameter in the \north and the \south hand. The
120 \north hand shifts upwards, the \south hand downwards. As a little
121 demonstration, we also shifted the \east hand a bit to the right and the
122 \west hand a bit to the left. Negative offset values reverse the shift
123 direction.
124 \vfill
125 \begin{HBox}{Very long suits 3 with extra offset\hfill File: \FileName}
126 \northhand[1em]{-}{2}{2}%
127 {AKQJT987654}
128 \southhand[1em]{AKQJT98765432}%
129 {-}{-}{-}
130 \easthand[1em]{-}{876543}%
131 {876543}{3}
132 \westhand[1em]{-}{AKQJT9}%
133 {AKQJT9}{2}
134 \showAll
135 \end{HBox}
136 \vfill
137 \end{document}
138 \endinput
139
140