summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/onedown/Examples/showAll.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/onedown/Examples/showAll.tex')
-rw-r--r--macros/latex/contrib/onedown/Examples/showAll.tex140
1 files changed, 140 insertions, 0 deletions
diff --git a/macros/latex/contrib/onedown/Examples/showAll.tex b/macros/latex/contrib/onedown/Examples/showAll.tex
new file mode 100644
index 0000000000..e7571f6d3c
--- /dev/null
+++ b/macros/latex/contrib/onedown/Examples/showAll.tex
@@ -0,0 +1,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
+
+