From 1497b86192848950669e33be4a1a916199d768e0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 2 Nov 2018 20:53:02 +0000 Subject: onedown (2nov18) git-svn-id: svn://tug.org/texlive/trunk@49053 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/onedown/onedown.dtx | 411 ++++++++++++--------- 1 file changed, 245 insertions(+), 166 deletions(-) (limited to 'Master/texmf-dist/source/latex/onedown') diff --git a/Master/texmf-dist/source/latex/onedown/onedown.dtx b/Master/texmf-dist/source/latex/onedown/onedown.dtx index d1c53a674cc..bd640cec8c2 100644 --- a/Master/texmf-dist/source/latex/onedown/onedown.dtx +++ b/Master/texmf-dist/source/latex/onedown/onedown.dtx @@ -24,7 +24,7 @@ \ProvidesFile{onedown.dtx} % %\NeedsTeXFormat{LaTeX2e}[2014/05/01] -%\def\ODwstyleversion{1.1}\def\ODwstyledate{2018/09/23} +%\def\ODwstyleversion{1.2}\def\ODwstyledate{2018/10/31} %\ProvidesPackage{onedown} % [\ODwstyledate\space v\ODwstyleversion\space % Typeset Bridge Diagrams - Jacob Wiersma (C) 2016-2018] @@ -37,7 +37,7 @@ % \usepackage[T1]{fontenc} \usepackage[german,dutch,french,swedish,english,shorthands=]{babel} -\usepackage{onedown}[2018/09/23] +\usepackage{onedown}[2018/10/31] \usepackage[normalem]{ulem}% for strikeout todos that are done \usepackage{needspace}% keep contiguous lines on one page \usepackage[inline]{enumitem}% Control various parameters of lists @@ -62,20 +62,23 @@ \AtBeginDocument{% \ifNoColor - \setdefaults{colors=1} + \setdefaults{colors=b+w} \hypersetup{linkcolor=black,urlcolor=black} \def\ODwcolor{black} \definecolor{defbackgr}{rgb}{1,1,1} + \definecolor{optbackgr}{named}{lightgray} \else \def\ODwcolor{red} \definecolor{defbackgr}{rgb}{1,1,0.75} + \definecolor{optbackgr}{named}{lime} \fi }% % \newlength\defwidth % % We need to typeset optional args without \meta too! -\newcommand\Oarg[1]{{\ttfamily[}#1{\ttfamily]}} +%\newcommand\Oarg[1]{{\ttfamily[}#1{\ttfamily]}} +\newcommand\Oarg[1]{\colorbox{optbackgr}{\textbf{#1}}} % \NewDocumentCommand\MacroDef{st+mO{}}{% % \MacroDef* + {macroname}[args] @@ -206,8 +209,8 @@ % % \fi % -% ^^A \CheckSum{3693} -% \CheckSum{3693} +% ^^A \CheckSum{3733} +% \CheckSum{3723} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -235,82 +238,126 @@ % % ^^A We are onedown now with new versioning! % -% \changes{v0.1}{2018/01/28}{Reorganized the bzr versioning. bzr will -% contain only onedown, the former bidnplay stuff is archived. The ToDo and -% Known-Bugs lists are cleaned. We are version 0.1 now, trying to keep the -% bzr version number equal to the changes minor number.} -% -% \changes{v0.2}{2018/02/12}{We finally have a List of User Commands. In -% the compass we can print vulner in red and mark the dealer. We have a -% hook \cmd{\CompassMid} to write something in the middle of the compass. -% Added several macros to auto-translate common stuff like 'lead'. Added -% the danish language. Corrected a bug in \cmd{\dealer} and \cmd{\vulner}. -% Removed pgf-key 'lang': we now load the needed languages on the fly. -% Finally we revised the documentation.} -% -% \changes{v0.4}{2018/03/09}{Major change in playtricks: the winner is now -% determined by the cards played, and code is added to check consistency. -% Dirty coded macros like \cmd{\ODw@symbol} and \cmd{\ODw@(@)Card(s)} are -% displaced by neat expl3 code. We load necesary dictionaries automatically -% on the fly and enhanced the colors options. Corrected some minor bugs and -% reorganized the documentation. One can now generate the documentation -% without the list of user commands} -% -% \changes{v0.5}{2018/03/14}{Associated the names and bidders in a fixed -% way. Added checks to onesuitNS/EW. Made ODw@OtherFont local where -% necessary. Redefine columntypes. Made 'T' a code for '10'. Adapted the -% translate macro to enable both 1H and 1\cmd{\He} etc. Enhanced the -% documentation.} -% -% \changes{v0.6}{2018/03/14}{Made all internal names hidden by adding -% 'ODw@' to it. Changed \cmd{\ODw@AccTricksN} in \cmd{\ODw@AccTricks}. Some -% minor adaptions of the documentation} -% -% \changes{v0.7}{2018/03/20}{Final edits of the documentation: Consequent -% use of 'card diagram', 'bidding' diagram and 'play diagram'. Corrected -% some minor bugs. Changed the name of the 'playtricks' environment into -% 'play'. Can disable all colors in the manual for monochrome printing. -% Changed signature of \cmd{\expertquiz} and \cmd{\boardtext}.} -% -% \changes{v0.7a}{2018/03/24}{Major change: Removed all \cmd{\bidXX} an -% \cmd{\bidXXpair} commands. The biddings can now be shown with the -% \cmd{\showXX+} (with token '+'). The macros \cmd{\hand-} and the bidding -% environments suppress their output with token '-'} -% -% \changes{v0.8}{2018/04/11}{Added package \packname{verbatimbox} to adjust -% verbatim font easily. Added \cmd{\setdefaults} with keys for fonts, -% compass and bidding diagram. Made \cmd{\FirstBidCol} internally hidden. -% Removed \cmd{longcalls}, \cmd{\CompassMid}, added \cmd{compassfont}. -% Changed the order of the hands in \cmd{\onesuitAll}. Renewed the -% implementation of the compass and add extra features.} -% -% \changes{v0.9}{2018/04/15}{Adapted \cmd{\ODwset} and \cmd{\setdefaults}. -% Separated key \emph{messages} into keys \emph{warn} and \emph{err}. -% Adapted \cmd{\ODw@Compass}. Removed legends from \cmd{\showNS}. Added -% \cmd{\sbox1} to all \cmd{\showXX} macros with a N-hand. Changed -% ODw@[No]Warnings and ODw@[No]Errors. Corrected some minor bugs and -% adapted the documentation accordingly.} -% -% \changes{v1.0}{2018/05/23}{Adapted the urls, the directories and some -% filenames to conform to the CTAN-standard and made the bundle ready for -% upload. Corrected a small bug in \cmd{\ODw@Compass} that was introduced -% in v0.9. Made all relevant text writing macros in 4 versions with/without -% tokens * and ^^21. Corrected a sizing/font bug. Added 4 variants of many -% text macros, onesuit-NE/NW/. Adapted \cmd{\handskip}. Added code to work -% around a \packname{babel}-\packname{translations} inconsistency w.r.t. -% norsk/norwegian.} -% -% \changes{v1.1}{2018/09/22}{% -% - Corrected onedown-ref.tex -% Added the missing rows in lines 419-422. -% and the explanational text on line 457. -% - Changed in all ODw+.trsl files: -% Translation of 'pass!' into 'p' and 'Pass!' into 'P'. -% - Corrected some typos in ShowAll.tex: -% \cmd{\contract*} into \cmd{\contract}, -% \cmd{\declarer*} into \cmd{\declarer} and -% \cmd{\lead*} into \cmd{\lead}. -% - Removed some illegal chars from changes entries } +% \changes{v0.1}{2018/01/28}{\\ +% - Reorganized the bzr versioning. bzr will contain only onedown, the +% former bidnplay stuff is archived. The ToDo and Known-Bugs lists are +% cleaned. \\ +% - We are version 0.1 now, trying to keep the bzr version number equal to +% the changes minor number.} +% +% \changes{v0.2}{2018/02/12}{\\ +% - We finally have a List of User Commands. \\ +% - In the compass we can print vulner in red and mark the dealer. We have +% a hook \cmd{\CompassMid} to write something in the middle of the +% compass.\\ +% - Added several macros to auto-translate common stuff like 'lead' etc.\\ +% - Added the danish language. \\ +% - Corrected a bug in \cmd{\dealer} and \cmd{\vulner}.\\ +% - Removed pgf-key 'lang': we now load the needed languages on the fly.\\ +% - Finally we revised the documentation.} +% +% \changes{v0.4}{2018/03/09}{\\ +% - Major change in playtricks: the winner is now determined by the cards +% played, and code is added to check consistency.\\ +% - Dirty coded macros like \cmd{\ODw@symbol} and \cmd{\ODw@(@)Card(s)} are +% replaced by neat expl3 code.\\ +% - We load necesary dictionaries automatically on the fly and enhanced the +% colors options.\\ +% - Corrected some minor bugs and reorganized the documentation. \\ +% - One can now also generate the documentation without the list of user +% commands} +% +% \changes{v0.5}{2018/03/14}{\\ +% - Associated the names and bidders in a fixed way.\\ +% - Added checks to onesuitNS/EW.\\ +% - Made ODw@OtherFont local where necessary.\\ +% - Redefined columntypes.\\ +% - Made 'T' a code for '10'.\\ +% - Adapted the translate macro to enable both 1H and 1\cmd{\He} etc. \\ +% - Enhanced the documentation.} +% +% \changes{v0.6}{2018/03/14}{\\ +% - Made all internal names hidden by adding 'ODw@' to it.\\ +% - Changed \cmd{\ODw@AccTricksN} in \cmd{\ODw@AccTricks}.\\ +% - Some minor adaptions of the documentation} +% +% \changes{v0.7}{2018/03/20}{\\ +% - Final(?) edits of the documentation: Consequent use of 'card diagram', +% 'bidding' diagram and 'play diagram'. \\ +% - Corrected some minor bugs. \\ +% - Changed the name of the 'playtricks' environment into 'play'.\\ +% - Can now disable all colors in the manual for monochrome printing.\\ +% - Changed signature of \cmd{\expertquiz} and \cmd{\boardtext}.} +% +% \changes{v0.7a}{2018/03/24}{\\ +% - Major change: Removed all \cmd{\bidXX} and \cmd{\bidXXpair} commands.\\ +% - The biddings can now be shown with \cmd{\showXX+} (with token '+').\\ +% - The macros \cmd{\hand-} and the bidding environments suppress their +% output with token '-'} +% +% \changes{v0.8}{2018/04/11}{\\ +% - Added package \packname{verbatimbox} to adjust verbatim font easily.\\ +% - Added \cmd{\setdefaults} with keys for fonts, compass and bidding +% diagrams.\\ +% - Made \cmd{\FirstBidCol} internally hidden.\\ +% - Removed \cmd{\longcalls}, \cmd{\CompassMid}, added \cmd{\compassfont}.\\ +% - Changed the order of the hands in \cmd{\onesuitAll}.\\ +% - Renewed the implementation of the compass and added extra features.} +% +% \changes{v0.9}{2018/04/15}{\\ +% - Adapted \cmd{\ODwset} and \cmd{\setdefaults}.\\ +% - Separated key \emph{messages} into keys \emph{warn} and \emph{err}.\\ +% - Adapted \cmd{\ODw@Compass}. \\ +% - Removed legends from \cmd{\showNS}.\\ +% - Added \cmd{\sbox1} to all \cmd{\showXX} macros with a N-hand.\\ +% - Changed ODw@[No]Warnings and ODw@[No]Errors.\\ +% - Corrected some minor bugs and adapted the documentation accordingly.} +% +% \changes{v1.0}{2018/05/23}{\\ +% - Adapted the urls, the directories and some filenames to conform to the +% CTAN-standard and made the bundle ready for upload. \\ +% - Corrected a small bug in \cmd{\ODw@Compass} that was introduced in +% v0.9.\\ +% - Made all relevant text-writing macros in 4 versions with/without tokens +% '*' and '^^21'.\\ +% - Corrected a sizing/font bug.\\ +% - Added 4 variants of many other text-writing macros, onesuit-NE/NW/.\\ +% - Adapted \cmd{\handskip}. \\ +% - Added code to work-around a \packname{babel}-\packname{translations} +% inconsistency w.r.t. norsk/norwegian.} +% +% \changes{v1.1}{2018/09/22}{\\ +% - Corrected onedown-ref.tex\\ +% . Added the missing rows in lines 419-422.\\ +% . and the explanational text on line 457.\\ +% - Changed in all ODw*.trsl files: The translation of 'pass!' into 'p' and +% 'Pass!' into 'P'.\\ +% - Corrected some typos in ShowAll.tex:\\ +% . \cmd{\contract*} into \cmd{\contract},\\ +% . \cmd{\declarer*} into \cmd{\declarer} and\\ +% . \cmd{\lead*} into \cmd{\lead}.\\ +% - Removed some illegal chars from changes entries.} +% \changes{v1.2a}{2018/10/10}{\\ +% - Enhanced the documention (both onedown.dtx and onedown-ref.tex: The +% command tokens are no longer shown as '[*^^21]', but as '*^^21' with a +% different background color.\\ +% - Added a thinspace ('\cmd{\,}') before all points counts (HCP, LP, DP +% and TP)\\ +% - Improved \cmd{\alert} by using \cmd{\textasteriskcentered} rather than +% just a '*'\\ +% - The changes history has a better layout now \\ +% - \cmd{\showNS} and \cmd{\showEW} now can selectively display only the N- +% or S-hand, resp the E- or W-hand.} +% \changes{v1.2b}{2018/10/31}{\\ +% - Corrected a bug: Added \cmd{\ODw@monochromefalse} in all +% initializations of multi colors in \cmd{\ODw@set}\\ +% - Made all relevant setdefaults settings (like bidfirst) non-global\\ +% - Made all \cmd{\ODw@BidderX} and \cmd{\ODw@NameX} non-global\\ +% - Removed '\cmd{\global}' from \cmd{\ODw@CompShow} (false and true), +% \cmd{\ODw@CompTurn}, \cmd{\ODw@Bidders}, \cmd{\ODw@BidLine} and +% \cmd{\ODw@LongCalls}\\ +% - In command \cmd{\suit} changed 'JW \cmd{\ODw@GameSize}' into +% '\cmd{\ODw@GameSize}'} % % ^^A Note: ^^21 denotes the exclamation mark (!) % @@ -734,8 +781,10 @@ pdflatex --shell-escape onedown.dtx % giving us \textcolor{black}{black} and \textcolor{red}{red}. Furthermore, % when we descibe macros, we use a colored frame that also shows the output % of the commend. Some commands have optional tokens that produce an output -% that differs from the naked version. The output of tokenized calls in the -% command overview is shown in parenthesis. +% that differs from the naked version. These optional tokens appear in a +% different background color like \Oarg{*!}. If an output of a macro is +% shown, then the output of tokenized calls is shown in parenthesis to +% demonstrate the difference. % % \subsubsection{The Compass} % @@ -960,9 +1009,11 @@ pdflatex --shell-escape onedown.dtx % \noindent % \DescribeMacro{\showAll}\MacroDef+{showAll}[\Oarg{*+}\oarg{pos}] % \par\noindent -% \DescribeMacro{\showNS}\MacroDef+{showNS}[\Oarg{*+}\oarg{pos}] +% \DeleteShortVerb{\|} +% \DescribeMacro{\showNS}\MacroDef+{showNS}[\Oarg{*+}\oarg{pos}\parg{N|S}] % \par\noindent -% \DescribeMacro{\showEW}\MacroDef+{showEW}[\Oarg{*+}\oarg{pos}] +% \DescribeMacro{\showEW}\MacroDef+{showEW}[\Oarg{*+}\oarg{pos}\parg{E|W}] +% \MakeShortVerb{\|} % \par\noindent % \DescribeMacro{\showNE}\MacroDef+{showNE}[\Oarg{*+}\oarg{pos}] % \par\noindent @@ -987,6 +1038,10 @@ pdflatex --shell-escape onedown.dtx % The other commands are similar to |\showAll| but typeset only the hands % of the players that are represented in the name of the command: % \NorthSouth*!, \EastWest*!, \North*!--\East*! and \North*!--\West*!. +% +% The commands |\showNS| and |\showEW| have an extra optional argument with +% which selectively only one of the two hands can be displayed. E.g.\ +% |\showNS(S)| will display only the \South*-hand. % \needspace{6\baselineskip}\noindent % % \subsubsection{Showing Card Diagrams with Bidding}\label{PlayCommands} @@ -2117,12 +2172,8 @@ pdflatex --shell-escape onedown.dtx % define the suits with a |renewrobustcommand|. So we must |\def| them % first. % -% \changes{v0.6a}{2018/03/15}{In order to test which suit (\cmd{\Cl},\ldots) -% was encountered in \cmd{\ODw@translate} (see page \pageref{Translate}) we -% \emph{must} define the suits as a \emph{renewrobustcommand}. So we -% \cmd{\def}ine them first! The idea was given on LaTeX StackExchange by -% egreg, see -% \url{https://tex.stackexchange.com/questions/420257/test-which-macro-is-called-in-tabular/420258#420258} +% \changes{v0.6a}{2018/03/15}{\\ +% - In order to test which suit (\cmd{\Cl},\ldots) was encountered in \cmd{\ODw@translate} (see page \pageref{Translate}) we \emph{must} define the suits as a \emph{renewrobustcommand}. So we \cmd{\def}ine them first! The idea was given on LaTeX StackExchange by egreg, see \url{https://tex.stackexchange.com/questions/420257/test-which-macro-is-called-in-tabular/420258#420258} % } % % \begin{macrocode} @@ -2159,6 +2210,7 @@ pdflatex --shell-escape onedown.dtx % \ODw@set{% colors/2/.code={% + \ODw@monochromefalse% \renewrobustcmd\Cl{\textcolor{black}% {\,[0.3]\ensuremath{\ODw@clubsuit}}\xspace}% \renewrobustcmd\Di{\textcolor{red}% @@ -2173,6 +2225,7 @@ pdflatex --shell-escape onedown.dtx % \ODw@set{% colors/4A/.code={% + \ODw@monochromefalse% \renewrobustcmd\Cl{\textcolor{green}% {\,[0.3]\ensuremath{\ODw@clubsuit}}\xspace}% \renewrobustcmd\Di{\textcolor{orange}% @@ -2188,6 +2241,7 @@ pdflatex --shell-escape onedown.dtx % \ODw@set{% colors/4B/.code={% + \ODw@monochromefalse% \renewrobustcmd\Cl{\textcolor{black}% {\,[0.3]\ensuremath{\ODw@clubsuit}}\xspace}% \renewrobustcmd\Di{\textcolor{orange}% @@ -2202,11 +2256,6 @@ pdflatex --shell-escape onedown.dtx \ODw@set{colors/4b/.code={\pgfkeys{/ODw/colors=4B}}} % \end{macrocode} % -% Set default coloring to black and red -% \begin{macrocode} -\ODw@set{colors=2} -% \end{macrocode} -% % \begin{macro}{\nt} % \begin{macro}{\NT} % Because some languages use a different symbol for \NT{} (\nt*) we must @@ -2812,44 +2861,44 @@ pdflatex --shell-escape onedown.dtx \newcommand\ODw@FirstBidCol[1]{% \IfEqCase{#1}{% {N}{% - \gdef\ODw@BidderI{\@ifstar{\ODw@North*}{\ODw@N*}}% - \gdef\ODw@BidderII{\@ifstar{\ODw@East*}{\ODw@E*}}% - \gdef\ODw@BidderIII{\@ifstar{\ODw@South*}{\ODw@S*}}% - \gdef\ODw@BidderIV{\@ifstar{\ODw@West*}{\ODw@W*}}% - \gdef\ODw@NameI{\ODw@North@Name}% - \gdef\ODw@NameII{\ODw@East@Name}% - \gdef\ODw@NameIII{\ODw@South@Name}% - \gdef\ODw@NameIV{\ODw@West@Name}% + \def\ODw@BidderI{\@ifstar{\ODw@North*}{\ODw@N*}}% + \def\ODw@BidderII{\@ifstar{\ODw@East*}{\ODw@E*}}% + \def\ODw@BidderIII{\@ifstar{\ODw@South*}{\ODw@S*}}% + \def\ODw@BidderIV{\@ifstar{\ODw@West*}{\ODw@W*}}% + \def\ODw@NameI{\ODw@North@Name}% + \def\ODw@NameII{\ODw@East@Name}% + \def\ODw@NameIII{\ODw@South@Name}% + \def\ODw@NameIV{\ODw@West@Name}% }% {E}{% - \gdef\ODw@BidderI{\@ifstar{\ODw@East*}{\ODw@E*}}% - \gdef\ODw@BidderII{\@ifstar{\ODw@South*}{\ODw@S*}}% - \gdef\ODw@BidderIII{\@ifstar{\ODw@West*}{\ODw@W*}}% - \gdef\ODw@BidderIV{\@ifstar{\ODw@North*}{\ODw@N*}}% - \gdef\ODw@NameI{\ODw@East@Name}% - \gdef\ODw@NameII{\ODw@South@Name}% - \gdef\ODw@NameIII{\ODw@West@Name}% - \gdef\ODw@NameIV{\ODw@North@Name}% + \def\ODw@BidderI{\@ifstar{\ODw@East*}{\ODw@E*}}% + \def\ODw@BidderII{\@ifstar{\ODw@South*}{\ODw@S*}}% + \def\ODw@BidderIII{\@ifstar{\ODw@West*}{\ODw@W*}}% + \def\ODw@BidderIV{\@ifstar{\ODw@North*}{\ODw@N*}}% + \def\ODw@NameI{\ODw@East@Name}% + \def\ODw@NameII{\ODw@South@Name}% + \def\ODw@NameIII{\ODw@West@Name}% + \def\ODw@NameIV{\ODw@North@Name}% }% {S}{% - \gdef\ODw@BidderI{\@ifstar{\ODw@South*}{\ODw@S*}}% - \gdef\ODw@BidderII{\@ifstar{\ODw@West*}{\ODw@W*}}% - \gdef\ODw@BidderIII{\@ifstar{\ODw@North*}{\ODw@N*}}% - \gdef\ODw@BidderIV{\@ifstar{\ODw@East*}{\ODw@E*}}% - \gdef\ODw@NameI{\ODw@South@Name}% - \gdef\ODw@NameII{\ODw@West@Name}% - \gdef\ODw@NameIII{\ODw@North@Name}% - \gdef\ODw@NameIV{\ODw@East@Name}% + \def\ODw@BidderI{\@ifstar{\ODw@South*}{\ODw@S*}}% + \def\ODw@BidderII{\@ifstar{\ODw@West*}{\ODw@W*}}% + \def\ODw@BidderIII{\@ifstar{\ODw@North*}{\ODw@N*}}% + \def\ODw@BidderIV{\@ifstar{\ODw@East*}{\ODw@E*}}% + \def\ODw@NameI{\ODw@South@Name}% + \def\ODw@NameII{\ODw@West@Name}% + \def\ODw@NameIII{\ODw@North@Name}% + \def\ODw@NameIV{\ODw@East@Name}% }% {W}{% - \gdef\ODw@BidderI{\@ifstar{\ODw@West*}{\ODw@W*}}% - \gdef\ODw@BidderII{\@ifstar{\ODw@North*}{\ODw@N*}}% - \gdef\ODw@BidderIII{\@ifstar{\ODw@East*}{\ODw@E*}}% - \gdef\ODw@BidderIV{\@ifstar{\ODw@South*}{\ODw@S*}}% - \gdef\ODw@NameI{\ODw@West@Name}% - \gdef\ODw@NameII{\ODw@North@Name}% - \gdef\ODw@NameIII{\ODw@East@Name}% - \gdef\ODw@NameIV{\ODw@South@Name}% + \def\ODw@BidderI{\@ifstar{\ODw@West*}{\ODw@W*}}% + \def\ODw@BidderII{\@ifstar{\ODw@North*}{\ODw@N*}}% + \def\ODw@BidderIII{\@ifstar{\ODw@East*}{\ODw@E*}}% + \def\ODw@BidderIV{\@ifstar{\ODw@South*}{\ODw@S*}}% + \def\ODw@NameI{\ODw@West@Name}% + \def\ODw@NameII{\ODw@North@Name}% + \def\ODw@NameIII{\ODw@East@Name}% + \def\ODw@NameIV{\ODw@South@Name}% }% }% IfEqCase }% ODw@FirstBidCol @@ -3273,7 +3322,8 @@ pdflatex --shell-escape onedown.dtx \ODw@ChkNrOfCards{#2}{suit}% \ODw@ChkSameCards{#2}{#1}% \bgroup% keep font change local -%JW \ODw@GameSize% +%JW + \ODw@GameSize% #1\ODw@Cards{#2}% \egroup% \xspace% @@ -3391,18 +3441,21 @@ pdflatex --shell-escape onedown.dtx % \end{macrocode} % \end{macro} % -% \begin{macro}{\showNS}\MacroDef{showNS}[\Oarg{*+}\oarg{pos}] +% \DeleteShortVerb{\|} +% \begin{macro}{\showNS}\MacroDef{showNS}[\Oarg{*+}\oarg{pos}\parg{N|S}] +% \MakeShortVerb{\|} % Define the diagram, showing the cards for the \NorthSouth*! hands. % % \begin{macrocode} -\NewDocumentCommand\showNS{s t+ O{c}}{% +\NewDocumentCommand\showNS{s t+ O{c} d()}{% % \end{macrocode} -% |showNS* +[pos]|\\ -% | 1 2 3|\\ +% |showNS* +[pos] (N/S)|\\ +% | 1 2 3 4|\\ % |Display the NS diagram, defined by \northhand, etc|\\ % |* Version: Display the diagram centered|\\ % |+ Version: Also display a bidding diagram|\\ % |pos: aligning, default c|\\ +% |N/S: only N-hand (or S-hand) is to be displayed|\\ % \par\noindent % Description: similar to |\showAll| % \begin{macrocode} @@ -3429,17 +3482,21 @@ pdflatex --shell-escape onedown.dtx \sbox1{\ODw@Compass}% \sbox0{% \begin{tabular}[#3]{@{}r@{}c@{}l@{}}% - & \ODw@Nhand & \\ +% Display the N-hand only with token 'N', or no token at all + & \IfNoValueTF{#4}{\ODw@Nhand}{\ifthenelse{\equal{#4}{N}}{\ODw@Nhand}{}} & \\ & \usebox{1} & \\ - & \ODw@Shand & \\ +% Display the S-hand only with token 'S', or no token at all + & \IfNoValueTF{#4}{\ODw@Shand}{\ifthenelse{\equal{#4}{S}}{\ODw@Shand}{}} & \\ \end{tabular}% }% sbox0 \ODw@gsetlength\ODw@Diagram@Width{\wd0}% \begin{tabular}[#3]{@{}r@{}c@{}l@{}}% \ODw@ProcessHeader{3}% span 3 columns - & \ODw@Nhand & \\ +% Display the N-hand only with token 'N', or no token at all + & \IfNoValueTF{#4}{\ODw@Nhand}{\ifthenelse{\equal{#4}{N}}{\ODw@Nhand}{}} & \\ & \usebox{1} & \\ - & \ODw@Shand & \\ +% Display the S-hand only with token 'S', or no token at all + & \IfNoValueTF{#4}{\ODw@Shand}{\ifthenelse{\equal{#4}{S}}{\ODw@Shand}{}} & \\ \ODw@ProcessFooter{3}% span 3 columns \end{tabular}% \IfBooleanTF#2{% @@ -3454,17 +3511,20 @@ pdflatex --shell-escape onedown.dtx % \end{macrocode} % \end{macro} % -% \begin{macro}{\showEW}\MacroDef{showEW}[\Oarg{*+}\oarg{pos}] +% \DeleteShortVerb{\|} +% \begin{macro}{\showEW}\MacroDef{showEW}[\Oarg{*+}\oarg{pos}\parg{E|W}] +% \MakeShortVerb{\|} % Define the diagram, showing the cards for the \EastWest*! hands. % \begin{macrocode} -\NewDocumentCommand\showEW{s t+ O{c}}{% +\NewDocumentCommand\showEW{s t+ O{c} d()}{% % \end{macrocode} -% |showEW* + [pos]|\\ -% | 1 2 3|\\ +% |showEW* + [pos] (E/W)|\\ +% | 1 2 3 4|\\ % |Display the EW diagram, defined by \easthand, etc|\\ % |* Version: Display the diagram centered|\\ % |+ Version: Also display a bidding diagram|\\ % |pos: aligning, default c|\\ +% |E/W: only E-hand (or W-hand) is to be displayed|\\ % \par\noindent % Description: similar to |\showAll| % \begin{macrocode} @@ -3485,14 +3545,22 @@ pdflatex --shell-escape onedown.dtx \ODw@TestIfEmpty{\ODw@FooterText}{ODw@EmptyFooter}% \sbox0{% \begin{tabular}[#3]{@{}r@{}c@{}l@{}}% - \ODw@Whand & \ODw@Compass & \ODw@Ehand \\ +% Display the W-hand only with token 'W', or no token at all + \IfNoValueTF{#4}{\ODw@Whand}{\ifthenelse{\equal{#4}{W}}{\ODw@Whand}{}} + & \ODw@Compass & +% Display the E-hand only with token 'E', or no token at all + \IfNoValueTF{#4}{\ODw@Ehand}{\ifthenelse{\equal{#4}{E}}{\ODw@Ehand}{}} \\ \end{tabular}% }% sbox \ODw@gsetlength{\ODw@Diagram@Width}{\wd0}% \begin{tabular}[#3]{@{}r@{}c@{}l@{}}% \ODw@ProcessHeader{3}% span 3 columns - & & \\ - \ODw@Whand & \ODw@Compass & \ODw@Ehand \\ + & & \\ +% Display the W-hand only with token 'W', or no token at all + \IfNoValueTF{#4}{\ODw@Whand}{\ifthenelse{\equal{#4}{W}}{\ODw@Whand}{}} + & \ODw@Compass & +% Display the E-hand only with token 'E', or no token at all + \IfNoValueTF{#4}{\ODw@Ehand}{\ifthenelse{\equal{#4}{E}}{\ODw@Ehand}{}} \\ \ODw@ProcessFooter{3}% span 3 columns \end{tabular}% \IfBooleanTF#2{% @@ -4230,7 +4298,7 @@ pdflatex --shell-escape onedown.dtx % % \begin{macro}{\alert} % \begin{macrocode} -\newcommand{\alert}{{}\ensuremath{^\textbf{*}}} +\newcommand{\alert}{{}\ensuremath{^\textbf{\textasteriskcentered}}} % \end{macrocode} % \end{macro} % @@ -4665,12 +4733,13 @@ pdflatex --shell-escape onedown.dtx % % \begin{environment}{play}\EnvDef{play}[*\marg{Lead}\oarg{Trump}] % \label{Play} -% \changes{v0.3}{2018/02/24}{In order to avoid empty columns in environment -% \texttt{playtricks} we reorganized it. Rather than just 1 table we use 3 -% tables. The middle one typesets the relevant tricks, stored in an -% \texttt{lrbox}, while generating on the fly a string with the winning -% tricks. Finally we put the running trick-number in TableI, we 'use' -% TableII and contruct TableIII from the string with the winning tricks.} +% \changes{v0.3}{2018/02/24}{\\ +% - In order to avoid empty columns in environment \texttt{playtricks} we +% reorganized it. Rather than just 1 table we use 3 tables. The middle one +% typesets the relevant tricks, stored in an \texttt{lrbox}, while +% generating on the fly a string with the winning tricks. Finally we put +% the running trick-number in TableI, we 'use' TableII and contruct +% TableIII from the string with the winning tricks.} % % Finally we define environment |play|. It consists primarily of % these 3 tables, the middle one with the special newcolumntype @@ -4890,26 +4959,26 @@ pdflatex --shell-escape onedown.dtx } % compass \ODw@set{compshow/.is choice} - \ODw@set{compshow/off/.code={\global\ODw@CompShowfalse}} - \ODw@set{compshow/on/.code={\global\ODw@CompShowtrue}} + \ODw@set{compshow/off/.code={\ODw@CompShowfalse}} + \ODw@set{compshow/on/.code={\ODw@CompShowtrue}} \ODw@set{compturn/.is choice} - \ODw@set{compturn/off/.code={\global\ODw@CompTurnfalse}} - \ODw@set{compturn/on/.code={\global\ODw@CompTurntrue}} + \ODw@set{compturn/off/.code={\ODw@CompTurnfalse}} + \ODw@set{compturn/on/.code={\ODw@CompTurntrue}} % bídding \ODw@set{bidders/.is choice} - \ODw@set{bidders/off/.code={\global\ODw@Biddersfalse}} - \ODw@set{bidders/on/.code={\global\ODw@Bidderstrue}} + \ODw@set{bidders/off/.code={\ODw@Biddersfalse}} + \ODw@set{bidders/on/.code={\ODw@Bidderstrue}} \ODw@set{bidfirst/.is choice} \ODw@set{bidfirst/N/.code=\ODw@FirstBidCol{N}} \ODw@set{bidfirst/E/.code=\ODw@FirstBidCol{E}} \ODw@set{bidfirst/S/.code=\ODw@FirstBidCol{S}} \ODw@set{bidfirst/W/.code=\ODw@FirstBidCol{W}} \ODw@set{bidline/.is choice} - \ODw@set{bidline/off/.code={\global\ODw@BidLinefalse}} - \ODw@set{bidline/on/.code={\global\ODw@BidLinetrue}} + \ODw@set{bidline/off/.code={\ODw@BidLinefalse}} + \ODw@set{bidline/on/.code={\ODw@BidLinetrue}} \ODw@set{bidlong/.is choice} - \ODw@set{bidlong/off/.code={\global\ODw@LongCallsfalse}} - \ODw@set{bidlong/on/.code={\global\ODw@LongCallstrue}} + \ODw@set{bidlong/off/.code={\ODw@LongCallsfalse}} + \ODw@set{bidlong/on/.code={\ODw@LongCallstrue}} % synonyms \ODw@set{compshow/1/.code={\pgfkeys{/ODw/compshow=on}}} \ODw@set{compshow/true/.code={\pgfkeys{/ODw/compshow=on}}} @@ -4964,6 +5033,10 @@ pdflatex --shell-escape onedown.dtx % bidder appears in the first column, draw a |\hline| below the header and % showing long calls. % +% Furthermore defined elsewhere are the keys to control errors |err| and +% warnings |warn|, as well as the key to control the color e.g. of the +% symbols |colors|. Refer to section~\ref{Options} +% % \begin{macrocode} \NewDocumentCommand\setdefaults{s m}{% \pgfkeys{/ODw,#2}% @@ -5505,7 +5578,7 @@ pdflatex --shell-escape onedown.dtx \xspace% }% High Card Points % -\def\HCP{\hpts*!} +\def\HCP{\,\hpts*!} % \end{macrocode} % \end{macro} % \end{macro} @@ -5529,7 +5602,7 @@ pdflatex --shell-escape onedown.dtx \xspace% }% Length Points % -\def\LP{\lpts*!} +\def\LP{\,\lpts*!} % \end{macrocode} % \end{macro} % \end{macro} @@ -5553,7 +5626,7 @@ pdflatex --shell-escape onedown.dtx \xspace% }% Distribution Points % -\def\DP{\dpts*!} +\def\DP{\,\dpts*!} % \end{macrocode} % \end{macro} % \end{macro} @@ -5577,7 +5650,7 @@ pdflatex --shell-escape onedown.dtx \xspace% }% Total Points % -\def\TP{\tpts*!} +\def\TP{\,\tpts*!} % \end{macrocode} % \end{macro} % \end{macro} @@ -5722,6 +5795,12 @@ pdflatex --shell-escape onedown.dtx \setdefaults{name=\mdseries\slshape} \setdefaults*{other=\bfseries\sffamily} % \end{macrocode} +% +% Set default coloring to black and red +% \begin{macrocode} +\setdefaults{colors=b+r} +% \end{macrocode} +% % Set the compass % \begin{macrocode} \setdefaults{compshow=on,compturn=off} -- cgit v1.2.3