| 1 |
%% |
| 2 |
%% onedown-examples.tex |
| 3 |
%% Dec 06, 2023 Added example Fancy Colors and language italian |
| 4 |
%% Oct 04, 2019 Initial version |
| 5 |
%% Requires the onedown bundle |
| 6 |
%% Part of the OneDown bundle (mirror.ctan.org/onedown) |
| 7 |
%% author: J. Wiersma |
| 8 |
%%--------NOTE------------------------------------------- |
| 9 |
%% USAGE: (pdf)latex onedown-examples.tex |
| 10 |
%%------------------------------------------------------- |
| 11 |
|
| 12 |
|
| 13 |
\PassOptionsToPackage{shorthands=off}{babel} |
| 14 |
\documentclass[a4paper,fontsize=11pt,% |
| 15 |
danish,% |
| 16 |
dutch,% |
| 17 |
french,% |
| 18 |
german,% |
| 19 |
ngerman,% |
| 20 |
italian,% |
| 21 |
norsk,% |
| 22 |
spanish,% |
| 23 |
swedish,% |
| 24 |
turkish,% |
| 25 |
english,% this is the default language |
| 26 |
]{scrartcl} |
| 27 |
|
| 28 |
\usepackage{scrlayer-scrpage} |
| 29 |
% |
| 30 |
\usepackage[utf8]{inputenc} |
| 31 |
\usepackage[T1]{fontenc} |
| 32 |
% |
| 33 |
\usepackage{subfiles}% can compile stand-alone/combined |
| 34 |
\usepackage{babel}% |
| 35 |
|
| 36 |
\usepackage{onedown}% our own style to set bridge stuff |
| 37 |
\usepackage[most]{tcolorbox}% show examples with code |
| 38 |
%\usepackage{tcolorbox}% show examples with code |
| 39 |
\usepackage{enumitem}% |
| 40 |
\usepackage{wrapfig}% |
| 41 |
\usepackage{ragged2e} |
| 42 |
\usepackage{multicol} |
| 43 |
\usepackage{blindtext}% to show wrapping |
| 44 |
\usepackage{forloop}% for Compass |
| 45 |
\usepackage{needspace}% keep lines on one page |
| 46 |
\usepackage{scalefnt}% to enlarge even more |
| 47 |
\usepackage[a4paper, total={185mm, 257mm},left=12mm,top=20mm]{geometry} |
| 48 |
|
| 49 |
|
| 50 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 51 |
% To get a PDF for printing on a monochrome printer |
| 52 |
% comment out these commands |
| 53 |
% |
| 54 |
%\setdefaults{colors=mono} |
| 55 |
%------------- |
| 56 |
% set the look of the example boxes |
| 57 |
% |
| 58 |
\tcbset{% |
| 59 |
colback=red!5!white,colframe=red!75!black, |
| 60 |
colbacklower=white, |
| 61 |
fonttitle=\bfseries, |
| 62 |
} |
| 63 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 64 |
% To get a PDF for viewing on a screen |
| 65 |
% comment out these commands |
| 66 |
% |
| 67 |
%\tcbset{% |
| 68 |
% colback=white,colbacktitle=white,coltitle=black, |
| 69 |
% colbacklower=white, |
| 70 |
% fonttitle=\bfseries, |
| 71 |
%} |
| 72 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 73 |
% |
| 74 |
% Due to a bug (?) in tcolorbox we cannot return to the default |
| 75 |
% "listing and text" after setting "listing side text" globally |
| 76 |
% within \tcbset. % So we define HBox and VBox to set this locally. |
| 77 |
% We need the VBox for showing 16 boardnrs in Compass.tex |
| 78 |
% |
| 79 |
\newtcblisting{HBox}[1]{listing side text,title=#1} |
| 80 |
\newtcblisting{VBox}[1]{listing and text,title=#1} |
| 81 |
|
| 82 |
\usepackage{shortvrb} |
| 83 |
\MakeShortVerb{\|} |
| 84 |
% hack to make verbatim stuff more clear |
| 85 |
% adapted from verbatim.sty |
| 86 |
\makeatletter |
| 87 |
\def\verbatim@font{\ttfamily\bfseries\large |
| 88 |
\hyphenchar\font\m@ne |
| 89 |
\@noligs} |
| 90 |
|
| 91 |
\def\Xfer#1{\ODw@Xfer{#1}} |
| 92 |
\makeatother |
| 93 |
% |
| 94 |
% Define macro FancyColors, that set the colors to green, orange, red and blue |
| 95 |
% for the card symbols ♣, ♦, ♥ and ♠ resp. as used in example Fancy Colors. |
| 96 |
% |
| 97 |
\makeatletter |
| 98 |
\def\FancyColors{% |
| 99 |
\renewrobustcmd\Cl{\textcolor{green}% |
| 100 |
{\,[0.3]\ensuremath{\ODw@clubsuit}}\xspace}% |
| 101 |
\renewrobustcmd\Di{\textcolor{orange}% |
| 102 |
{\,[0.3]\ensuremath{\ODw@vardiamond}}\xspace}% |
| 103 |
\renewrobustcmd\He{\textcolor{red}% |
| 104 |
{\,[0.3]\ensuremath{\ODw@varheart}}\xspace}% |
| 105 |
\renewrobustcmd\Sp{\textcolor{blue}% |
| 106 |
{\,[0.3]\ensuremath{\ODw@spadesuit}}\xspace}% |
| 107 |
}%FancyColors |
| 108 |
\makeatother |
| 109 |
|
| 110 |
\usepackage[pdfencoding=auto]{hyperref} |
| 111 |
\hypersetup{% |
| 112 |
pdftitle={onedown-examples.pdf}, |
| 113 |
pdfsubject={Bridge Diagrams, OneDown bundle}, |
| 114 |
pdfkeywords={OneDown Bridge LaTeX}, |
| 115 |
colorlinks, |
| 116 |
linkcolor=red, |
| 117 |
} |
| 118 |
|
| 119 |
\newcommand\OneDown{\textcolor{red}{\smaller\bfseries\textsc{OneDown}}\xspace} |
| 120 |
|
| 121 |
%------------- |
| 122 |
\pagestyle{scrheadings} |
| 123 |
\clearscrheadfoot |
| 124 |
\ihead{\texttt{onedown-examples.pdf} |
| 125 |
(\OneDown v\ODwstyleversion, \ODwstyledate)\hfill \pagemark} |
| 126 |
%----------- |
| 127 |
|
| 128 |
\def\FileName{\jobname} |
| 129 |
\def\SubFile#1{\def\FileName{#1}\newpage\section{#1}\subfile{#1}} |
| 130 |
|
| 131 |
\addtolength{\textheight}{1.5cm} |
| 132 |
\def\ExLang{english} |
| 133 |
\begin{document} |
| 134 |
% when compiled with: |
| 135 |
% pdflatex '\AtBeginDocument{\def\ExLang{YourLanguage}}\input{onedown-ref.tex}' |
| 136 |
% you'll get the onedown commands expansions in YourLanguage |
| 137 |
% YourLanguage can be any language out of: |
| 138 |
% danish, dutch, english, french, (n)german, italian, norsk, spanish, swedish, |
| 139 |
% turkish |
| 140 |
% |
| 141 |
\expandafter\selectlanguage\expandafter{\ExLang} |
| 142 |
\pdfbookmark[1]{Title}{Title} |
| 143 |
\title{Examples for the\\\OneDown package% |
| 144 |
\footnote{This file is part of the \OneDown bundle. To generate this file, |
| 145 |
use the following command: \newline \texttt{\$ pdflatex \jobname.tex}} |
| 146 |
\\[1em] |
| 147 |
\normalsize\url{www.ctan.org/pkg/onedown} |
| 148 |
} |
| 149 |
\author{J.\,Wiersma\footnote{email: \textsf{[email protected]}}} |
| 150 |
\date{07 December 2023 (v0.6)} |
| 151 |
\maketitle |
| 152 |
|
| 153 |
\section*{Introduction} |
| 154 |
This file (\jobname) contains (well, sort of includes) all the example |
| 155 |
files from the bundle. We use the 'include' mechanism of the package |
| 156 |
|subfiles|. This means that you can compile each example file as |
| 157 |
stand-alone, but they also form one document. |
| 158 |
The advantage is that you can copy one example file and edit it to your |
| 159 |
taste i.e.\ to experiment a little, and you can compile it without changing |
| 160 |
the preamble, provided the \OneDown bundle is in your \TeX-path. |
| 161 |
|
| 162 |
For questions not covered in these examples or any further documentation, |
| 163 |
read the \OneDown package manual named onedown.pdf. |
| 164 |
|
| 165 |
If you encounter difficulties in compiling adapted files, then please read |
| 166 |
the section about active characters in the manual. |
| 167 |
|
| 168 |
To make it easy for you to decide which file to experiment with, all |
| 169 |
sections bear the file name, which can also be found in the list below. The |
| 170 |
examples are produced using the \textsf{tcolorbox} package. This enables us |
| 171 |
to show the code and the output of it side by side. |
| 172 |
|
| 173 |
The explanatory text is always in the English language. But you can show the |
| 174 |
output of all commands in any of the supported languages.\\ |
| 175 |
These are: danish, dutch, english, french, (n)german, italian, norsk, spanish, |
| 176 |
swedish, turkish. \\ |
| 177 |
You obtain this output in \emph{YourLanguage} by compiling onedown-examples.tex with: \\[0.2em] |
| 178 |
|
| 179 |
\verb|pdflatex '\AtBeginDocument{\def\ExLang{YourLanguage}}\input{onedown-examples.tex}'|\\ |
| 180 |
Beware: Copy\&Paste may use wrong quotes! Replace them by the right ones from your keybord. |
| 181 |
\\[0.7em] |
| 182 |
\centerline{\textbf{This document shows the commands for the \emph{\languagename}\ language}} |
| 183 |
\par\vspace{1\baselineskip} |
| 184 |
\setlength\columnseprule{.8pt}% rule between cols |
| 185 |
\begin{multicols}{3}[{\centering \textbf{\Large List of Examples}}] |
| 186 |
% Use \tableofcontents to create a hyperref'ed list of examples |
| 187 |
% by stripping all stuff except the toclist itself, |
| 188 |
% Change \addvspace too, to keep things tight . |
| 189 |
\makeatletter |
| 190 |
\renewcommand\tableofcontents{\@starttoc{toc}} |
| 191 |
\makeatother |
| 192 |
\renewcommand*{\addvspace}[1]{} |
| 193 |
\tableofcontents |
| 194 |
\end{multicols} |
| 195 |
\SubFile{Hands} |
| 196 |
\SubFile{Suits} |
| 197 |
\SubFile{showNS-warn-I} |
| 198 |
\SubFile{showNS-warn-II} |
| 199 |
\SubFile{showNS-align} |
| 200 |
\SubFile{showAll} |
| 201 |
\SubFile{Select-Hands} |
| 202 |
\SubFile{Bidding} |
| 203 |
\SubFile{bidAll} |
| 204 |
\SubFile{bidNS} |
| 205 |
\SubFile{bidEW} |
| 206 |
\SubFile{bidNE} |
| 207 |
\SubFile{bidNW} |
| 208 |
\SubFile{Legends} |
| 209 |
\SubFile{Wrapping} |
| 210 |
\SubFile{Play} |
| 211 |
\SubFile{ExpertQuiz} |
| 212 |
\SubFile{Languages} |
| 213 |
\SubFile{Compass} |
| 214 |
\SubFile{FancyColors} |
| 215 |
\SubFile{CardSymbols} |
| 216 |
\end{document} |
| 217 |
|