-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtikz-backgammon.tex
102 lines (88 loc) · 3.76 KB
/
tikz-backgammon.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
% !TEX TS-program = pdfLaTeX
\documentclass[11pt]{article}
\title{\textbf{The \pkg{tikz-backgammon} package}}
\author{\textbf{Alan Munn}\\Department of Linguistics and Languages\\\texttt{\href{mailto:[email protected]}{[email protected]}}}
\date{Version 0.9\\January 20, 2024}
\usepackage[T1]{fontenc}
\usepackage[margin=1in]{geometry}
\usepackage{titling}
\usepackage{array, booktabs, multicol, fancyhdr, xspace,tabularx}
\usepackage{enumitem}
\usepackage{fancyvrb,listings,url}
\usepackage[sf]{titlesec}
\usepackage{tikz-backgammon}
\usepackage[colorlinks=true]{hyperref}
\DefineShortVerb{\|}
\newcommand*\bs{\textbackslash}
\IfFileExists{luximono.sty}%
{%
\usepackage[scaled]{luximono}%
}
{%
\IfFileExists{beramono.sty}%
{%
\usepackage[scaled]{beramono}%
}{}
}
\lstset{%
basicstyle=\ttfamily\small,
commentstyle=\itshape\ttfamily\small,
showspaces=false,
showstringspaces=false,
breaklines=true,
breakautoindent=true,
frame=single
captionpos=t
language=TeX
}
\newcommand*{\pkg}[1]{\texttt{#1}\xspace}
\setitemize[1]{label={}}
\setitemize[2]{label={}}
\setdescription{font={\normalfont}}
\setlength{\droptitle}{-1in}
\lhead{}
\chead{}
\rhead{}
\lfoot{\emph{}}
\cfoot{\thepage}
\rfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\pagestyle{fancy}
\begin{document}
\maketitle
\thispagestyle{empty}
\renewcommand{\abstractname}{\sffamily Abstract}
\abstract{The |tikz-backgammon| package is designed to make annotating and representing backgammon board states easy. Arbitrary boards may be set, or a whole game can be input with the current state of the game output as a board at any point. The doubling cube is also represented.}
\section{Summary of User Commands}
{\centering
\begin{tabular}{ll}
\toprule
\multicolumn{1}{>{\bfseries}c}{Command} & \multicolumn{1}{>{\bfseries}c}{Description}\\
\midrule
|\newgame| & set the pieces for a new game without drawing the board\\
% |\newpieces| & set up the pieces for a new game without drawing the board\\
|\blankboard| & draw a blank board \\
|\clearboard| & clear the board state without drawing anything\\
|\blackboard| & display the current state of the game: black's view\\
|\whiteboard| & display the current state of the game: white's view\\
|\onbar{number}| & add stones to the bar\\
|\double{owner}{value}| & set doubling cube and possession \\
|\blackmove{from}{to}{from}{to}| & move for black\\
|\whitemove{from}{to}{from}{to}| & move for white\\
|\blkmove{nm:from/to,from/to}| & black move in standard notation\\
|\whtmove{nm:from/to,from/to}| & white move in standard notation\\
\midrule
|\blackpoint{point}{number}| & add black stones to a point\\
|\whitepoint{point}{number}| & add white stones to a point\\
|\placedouble{value}| & command to place the double (only for manual setup)\\
|\roll{nm}| & set the dice to a particular value n-m for white or black\\
|\boardcaption{}| & set a caption for the board\\
|\boardcaptionformat{}| & format for the captions\\
\bottomrule
\end{tabular}}
\section{Updates}
Due to increased recent interest in the package, it's likely that it will be revised and updated in the Summer of 2024.
\section{Acknowledgements}
This package was created as a response to the following question on TeX Stackexchange: \href{http://tex.stackexchange.com/q/48591/2693}{Typesetting boardgame positions using ttf font}. The dice code, due to Seamus Bradley was posted in another question \href{http://tex.stackexchange.com/a/41628/2693}{epsdice does not respect beamer overlay}. Thanks to Andrew Stacey for helping me understand scaling nodes in TikZ, Enrico Gregorio and David Carlisle for understanding everything, and being happy to teach us all and the entire site for being a wealth of useful information and friendly people.
\end{document}