Debian Codegraph @

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

raw
1 \documentclass[onedown-examples]{subfiles}
2
3 \begin{document}
4 \vfill
5 In this section we will investigate how we can add certain annotations to
6 card diagrams. We start with |\newgame| and |\resetfonts| in order to
7 `forget the past'.
8
9 With |\dealer| one can denote which player is the dealer and
10 with |\vulner| which side is vulnerable. This data is stored and with
11 |\dealertext| (or |\vulnertext|) one can retrieve it. The macros
12 |\leftupper| (and also the |right-| and the |lower-| versions) puts its 3
13 arguments, each on its own line, in the diagram. If you wonder why we use
14 the command |\by| instead the text |by| in |\rightupper|: |\by| gets
15 automatically translated into the active language.\par\noindent
16 If you look at the diagram, you will notice that the \emph{left}- and \emph{right}-annotations can
17 extend to the left of the \west hand and the right of the \east hand.
18 \vfill
19 \begin{HBox}{Annotations\hfill File: \FileName}
20 \newgame\resetfonts
21 \northhand{AK43}{AJ98}{AQJ}{54}
22 \southhand{87}{QT5}{8432}{K986}
23 \easthand{JT6}{764}{KT9}{JT32}
24 \westhand{Q952}{K32}{765}{AQ7}
25 \dealer[\east]\vulner[\eastwest]
26 \leftupper{\dealertext}{}{\vulnertext}
27 \rightlower{}{\lead: \Di 7}{}
28 \rightupper{\contract: 3\,\NT}{\by \south}{}
29 \showAll
30 \end{HBox}
31 \vfill
32 In the next example we show all possible annotations. Here you can see that
33 the |\upper-|versions align the text with the topline, whereas the
34 |\lower-|versions align with the bottomline. Because the legendfont
35 can differ from the gamefont and the rows in a hand get some extra space,
36 the legend lines will normally not align with the rows of a hand.
37
38 We can add an offset (as shown in section showAll) to the \west hand in order to make the hand align to
39 the left with the left-upper legend. But this enlarges the gap between the
40 \west hand and the compass. It is perhaps better to have only very short
41 legends. But it is up to you to decide that.
42 \vfill
43 \begin{HBox}{Legends: full overview\hfill File: \FileName}
44 \leftupper{LUp:Line 1}{and line2}{last Line}
45 \rightupper{RUp:Line 1}{and line2}{last Line}
46 \leftlower{LLo:Line 1}{and line2}{last Line}
47 \rightlower{RLo:Line 1}{and line2}{last Line}
48 \headlinetext{Here you put some headtext\ldots\par on 2 lines}
49 \footlinetext{\ldots here goes foottext}
50 \showAll
51 \end{HBox}
52 \needspace{8\baselineskip}
53 \vfill
54 The next examples show wich legends are output/suppressed for the other
55 card diagrams. Note also that the \emph{head/foot}-linetext does not extend beyond the
56 width of the diagram, and can get real narrow when only the
57 \NorthSouth*!-hands are shown. In that case it might be better to put a |\raggedright|
58 in. If you do so, then don't forget to |\protect| it.
59 \vfill
60 \begin{HBox}{{Legends for: \northsouth: may need \emph{raggedright}\hfill File: \FileName}}
61 \showNS
62
63 \hrulefill
64
65 \headlinetext{\protect\raggedright Here you put some headtext\ldots\par on 2 lines}
66 \footlinetext{\protect\raggedright \ldots here goes foottext}
67 \showNS
68 \end{HBox}
69 \vfill
70 \begin{HBox}{{Legends: \north-\east, \north-\west, \east-\west\hfill File: \FileName}}
71
72 \showNE
73
74 \hrulefill
75
76 \showNW
77
78 \hrulefill
79
80 \showEW
81 \end{HBox}
82 \vfill
83 \end{document}
84 \endinput