Debian Codegraph @

texmf-dist/source/latex/contracard/contracard.dtx

raw
1 % \iffalse
2 %
3 %<*driver>
4 \ProvidesFile{contracard.dtx}
5 %</driver>
6 %
7 %<*contracard-pkg>
8 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
9 \ProvidesPackage{contracard}[2019/03/03 Package for typesetting called dances]
10 %</contracard-pkg>
11 %<*contracard-cls>
12 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
13 \ProvidesClass{contracard}[2019/03/03 Class for creating dance calling cards]
14 \AtEndOfClass{\LoadClass{article}}
15 %</contracard-cls>
16 %
17 %<*driver>
18 \documentclass[a4paper]{ltxdoc}
19 \usepackage{ifxetex,ifluatex}
20 \usepackage{fancyvrb,hologo,framed,multicol,url,graphicx,cclicenses,pifont}
21 \usepackage[enableidx]{contracard}
22 \ifxetex
23 \usepackage{unicode-math}
24 \else
25 \ifluatex
26 \usepackage{unicode-math}
27 \else
28 \usepackage[utf8x]{inputenc}
29 \fi
30 \fi
31 \usepackage[pdfborder=0, bookmarks, colorlinks=false, hidelinks]{hyperref}
32 \usepackage[parfill]{parskip}
33 \usepackage{bookmark}
34 \usepackage[page,toc]{appendix}
35
36 \fvset{gobble=2}
37
38 \newenvironment*{exampledance}{%
39 \vspace{3em}
40 \begin{framed}
41 \begin{minipage}[t][76.2mm][t]{\textwidth}
42 }{%
43 \end{minipage}
44 \end{framed}
45 }
46
47 \newcommand*{\gittag}{%
48 \immediate\write18{%
49 rm gittag.tex 2> /dev/null; (git describe --tags --dirty || echo "v0.0") 2> /dev/null > gittag.tex
50 }%
51 \InputIfFileExists{gittag.tex}{}{}\unskip%
52 \immediate\write18{%
53 rm gittag.tex 2> /dev/null
54 }%
55 }
56
57 \newcommand*\name[1]{\textsc{#1}}
58 \newcommand*\fname[1]{\textsf{#1}}
59 \newcommand*\pkg[1]{\textsf{#1}}
60 \newcommand*\code[1]{\texttt{#1}}
61 \newcommand*\regexp[1]{\texttt{#1}}
62 \newcommand*\word[1]{\textit{#1}}
63 \newcommand*{\XeLaTeX}{\hologo{XeLaTeX}}
64 \newcommand*{\LuaLaTeX}{\hologo{LuaLaTeX}}
65 \EnableCrossrefs
66 \CodelineIndex
67 \RecordChanges
68 \begin{document}
69 \DocInput{\jobname.dtx}
70 \end{document}
71 %</driver>
72 %
73 % \fi
74 %
75 % \GetFileInfo{contracard.dtx}
76 % \makeatletter
77 % \errorcontextlines=999
78 %
79 % \title{The Contra Card Project}
80 % \author{
81 % \name{Sam Whited}\\*
82 % \texttt{[email protected]}
83 % }
84 % \date{\today\\*\gittag}
85 %
86 % \maketitle
87 % \begin{exampledance}
88 % \begin{contra}{Monarch Grove}{Martha Wild}{Duple becket}
89 % \move{Slide left and circle left \textthreequarters\moveindex{Circle Left}\moveindex{Slide Left}}
90 % \swing*[Neighbor]{8}
91 % \longlines
92 % \dosido*[Men]{8}
93 % \allemande*[Men]{8}{left 1\textonehalf}
94 % \move{Partner star promenade and butterfly whirl\moveindex{Star Promenade}\moveindex{Butterfly Whirl}}
95 % \dosido*[Women]{8}
96 % \swing[partner]{8}
97 % \end{contra}
98 % \end{exampledance}
99 % \tableofcontents
100 % \phantomsection
101 % \addcontentsline{toc}{section}{\lodtitle}
102 % \hypertarget{CC:LOD}{}
103 % \listofdances
104 %
105 % \section{Introduction}
106 %
107 % The \textbf{Contra Card} project is designed to aid in the formatting and
108 % typesetting of caller cards for traditional square and line dances.
109 %
110 % The project comprises a \LaTeX\ package (\fname{contracard.sty}) and a
111 % \LaTeX\ class (\fname{contracard.cls}). The package provides the core
112 % functionality of Contra Card while the class file acts as a convenience
113 % wrapper for making calling cards.
114 %
115 % \subsection{About the source}
116 %
117 % Contributions are welcome, and the latest development version of the project
118 % can always be found at \url{https://git.sr.ht/~samwhited/contracard}.
119 %
120 % \subsection{License}
121 %
122 % This project may be distributed and/or modified under the conditions of the
123 % \LaTeX\ Project Public License, either version 1.3c of this license or (at
124 % your opinion) any later version. The latest version of this license is in:
125 %
126 % \url{http://www.latex-project.org/lppl.txt}
127 %
128 % and version 1.3c or later is part of all distributions of \LaTeX\ version
129 % 2008/05/04 or later.
130 %
131 % \subsection{Special thanks}
132 %
133 % \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
134 % \addtocounter{footnote}{1}%
135 % Several people deserve a special thanks for their contributions to this
136 % package. Most notably the various callers and dancers who responded to my
137 % queries on the \href{http://www.sharedweight.net/}{Shared Weight},
138 % \href{http://groups.yahoo.com/neo/groups/trad-dance-callers/info}{Traditional
139 % Dance Callers}, and \href{http://www.contradance.org/}{Chatahoochee Country
140 % Dancers}, mailing lists. These comprise Andrea Nettleton, Bill Baritompa, Seth
141 % Tepfer, Richard Hopkins, Chris Page, James Saxe, Mark Goodwin, Rob Harper,
142 % Eric Black, Kalia Kliban, John Sweeney, Martha Wild\footnote{Dances by Martha
143 % Wild used in this publication are reproduced from \textit{Calls of the Wild}
144 % by special arrangement with the author.}, and Linda Leslie (in no particular
145 % order). Also to Sarah Snyder, and all of my other favorite dance partners from
146 % the Atlanta dance community.
147 %
148 % \begin{exampledance}
149 % \begin{contra}{Lament To Sarah}{Sam Whited}{Duple improper}
150 % \lines*[In your set, short]
151 % \move[4]{open up across}
152 % \rollawaysashay
153 % \move[4]{Neighbor two hand turn}\unskip\moveindex{Two hand turn}%
154 %
155 % \move[8]{Cont.\ two hand turn}\unskip\moveindex{Two hand turn}%
156 % \swing*[Melt into a]{8}
157 %
158 % \balanceand\petronella
159 % \balanceand\petronella
160 % \balanceand\petronella
161 % \move[8]{Balance with your partner and two hand turn while rotating to the
162 % right to end facing new neighbors}\unskip\moveindex{Balance}\moveindex{Two hand turn}
163 % \notes{%
164 % Open up with your neighbor in four steps, facing across with leads on the
165 % right.%
166 % }
167 % \end{contra}
168 % \end{exampledance}
169 %
170 % \StopEventually{}
171 % \changes{0.1}{2013/02/09}{Created boilerplate for class}
172 % \changes{0.3}{2013/02/20}{Split core functionality out into package}
173 % \changes{0.4}{2013/02/22}{Support swung dances}
174 % \changes{0.4}{2013/02/22}{Add list of dances}
175 % \changes{0.4}{2013/02/22}{Add \pkg{tocloft} package to requirements}
176 % \changes{1.0.0}{2013/09/09}{Start using \href{http://semver.org}{Semantic
177 % Versioning}}
178 % \changes{1.0.0}{2013/09/15}{Fix phrase separator issues}
179 %
180 % \section{Building and using \pkg{contracard}}
181 %
182 % \paragraph{Dependencies} The following dependencies are loaded by
183 % \pkg{contracard} (you do not need to include them in your project,
184 % \pkg{contracard} does this for you); before building the \pkg{contracard}
185 % package you should verify that they are installed.
186 %
187 % \begin{macrocode}
188 %<*contracard-pkg>
189 \RequirePackage{calc,intcalc}
190 \RequirePackage{ifthen}
191 \RequirePackage{tocloft}
192 \RequirePackage{textcomp}
193 %</contracard-pkg>
194 % \end{macrocode}
195 %
196 % If you're using the class, you'll want the following additional dependencies:
197 %
198 % \begin{macrocode}
199 %<*contracard-cls>
200 \AtEndOfClass{\RequirePackage{geometry}}
201 \AtEndOfClass{\RequirePackage[compact]{titlesec}}
202 \AtEndOfClass{\RequirePackage{contracard}}
203 %</contracard-cls>
204 % \end{macrocode}
205 % \begin{macrocode}
206 %<*contracard-pkg>
207 % \end{macrocode}
208 %
209 % \paragraph{Building \pkg{contracard}} Once you have all the required packages,
210 % building \pkg{contracard} from source can be accomplished in multiple ways. If
211 % the Makefile is present running \code{make help} will tell you everything you
212 % need to know. To manually extract the files and generate the documentation
213 % simply run \code{pdflatex} or \code{xelatex} against \fname{contracard.dtx}:
214 %
215 % \begin{Verbatim}
216 % $ xelatex --shell-escape contracard.dtx
217 % \end{Verbatim}
218 %
219 % The \code{-{}-shell-escape} option is only required if you want the output to
220 % contain version information. This will also require that you have \pkg{git}
221 % installed (and the git repo itself) as the version is determined by running:
222 %
223 % \begin{Verbatim}
224 % $ git describe --tags --dirty
225 % \end{Verbatim}
226 %
227 % \paragraph{Using \pkg{contracard}} Building results in two main files, a class
228 % and a package. In general, if you want to make a calling card, use the
229 % \pkg{contracard} class and if you want to print a contra dance in a book or
230 % article, use a different class and require the \pkg{contracard} package.
231 %
232 % \subsection{Options}
233 %
234 % \hypertarget{CCPACKAGE:OPTIONS}{}
235 % \begin{macro}{showcountbefore}
236 % \begin{macro}{showcountafter}
237 % \begin{macro}{enableidx}
238 % \changes{1.0.0}{2013/09/08}{New option}
239 % The package (or class) can also be loaded with the following options. For more
240 % information about each option, see the command which it calls.
241 % \begin{macrocode}
242 \DeclareOption{showcountafter}{\showcountafter}
243 \DeclareOption{showcountbefore}{\showcountbefore}
244 \DeclareOption{enableidx}{\AtEndOfPackage{\enableidx}}
245 % \end{macrocode}
246 % \end{macro}
247 % \end{macro}
248 % \end{macro}
249 %
250 % \clearpage
251 % \phantomsection
252 % \part{The \pkg{contracard} package}
253 %
254 % \section{Formatting}
255 %
256 % These options determine how the dance will look.
257 %
258 % \begin{macro}{\defaultcontraenv}
259 % \begin{macro}{\dancetitleenv}
260 % \changes{0.1}{2013/02/14}{Allow user to format moves}
261 % \changes{0.3}{2013/02/20}{Allow user to format dance title block}
262 % By default, all contra moves and the title block are wrapped in the
263 % \code{flushleft} environment. To change this you can renew
264 % the following macros:
265 % \begin{macrocode}
266 \newcommand*{\defaultcontraenv}{flushleft}
267 \newcommand*{\dancetitleenv}{flushleft}
268 % \end{macrocode}
269 % \end{macro}
270 % \end{macro}
271 %
272 % \begin{macro}{\dancetitleformat}
273 % \begin{macro}{\danceauthorformat}
274 % \begin{macro}{\danceformformat}
275 % \changes{0.3}{2013/02/20}{Allow the user to change the dance title format}
276 % \changes{0.3}{2013/02/20}{Allow the user to change the dance form format}
277 % To change the formatting of a dance's title, author, or form, redefine the
278 % following macros:
279 % \begin{macrocode}
280 \newcommand*{\dancetitleformat}{\section*}
281 \newcommand*{\danceauthorformat}{\subsection*}
282 \newcommand*{\danceformformat}{\hspace{\fill}}
283 % \end{macrocode}
284 % \end{macro}
285 % \end{macro}
286 % \end{macro}
287 %
288 % \begin{macro}{\movedelimiter}
289 % \changes{0.3}{2013/02/20}{Allow customizing the move delimiter character}
290 % \begin{macro}{\partdelimiter}
291 % \changes{0.3}{2013/02/20}{Allow customizing the part delimiter}
292 % \begin{macro}{\midpartdelimiter}
293 % \changes{0.3}{2013/02/20}{Allow customizing the mid-part delimiter}
294 % These commands define delimiters that are used between moves, or at the midway
295 % point in a part.
296 % \begin{macrocode}
297 \newcommand*{\movedelimiter}{,}
298 \newcommand*{\partdelimiter}{.}
299 \newcommand*{\midpartdelimiter}{;}
300 % \end{macrocode}
301 % \end{macro}
302 % \end{macro}
303 % \end{macro}
304 %
305 % \begin{macro}{\phraseseparator}
306 % \changes{0.4}{2013/02/22}{Allow custom phrase separator character}
307 % \begin{macro}{\phrasevspace}
308 % \changes{0.4}{2013/02/22}{Allow custom phrase separation length}
309 % The \code{\textbackslash phraseseparator} macro is inserted between every
310 % musical phrase and --- by default --- inserts \code{\textbackslash
311 % phrasevspace} amount of white space.
312 % \begin{macrocode}
313 \newlength{\phrasevspace}
314 \setlength{\phrasevspace}{1em}
315 \newcommand*{\phraseseparator}{\vspace{\phrasevspace}}
316 % \end{macrocode}
317 % \end{macro}
318 % \end{macro}
319 %
320 % A dance with a centered title block, a custom mid-part delimiter (an em-dash
321 % in this case), and a nice horticultural dingbat as the phrase separator can be
322 % accomplished with:
323 %
324 % \begin{verbatim}
325 % \renewcommand*{\dancetitleenv}{center}
326 % \renewcommand*{\midpartdelimiter}{\ ---}
327 % \renewcommand*{\phraseseparator}{\ding{167}}
328 % \end{verbatim}
329 %
330 % and looks something like this:
331 %
332 % \begin{exampledance}
333 % \renewcommand*{\dancetitleenv}{center}%
334 % \renewcommand*{\midpartdelimiter}{\ ---}%
335 % \renewcommand*{\phraseseparator}{\ding{167}}%
336 % \begin{contra}{Code's Compiling}{Sam Whited}{Duple becket}
337 % \dosido*[Neighbor]{8}
338 % \seesaw*[Partner]{8}
339 % \swing*[Shadow]{16}
340 % \balanceand\petronella
341 % \balanceand\petronella
342 % \swing*[Partner]{8}
343 % \rightandleftthrough*[Left diagonal:]
344 % \notes{The Neighbor dosido into a partner see saw should be one fluid
345 % motion. Resist spinning in the dosido, and start revolving slowly over your
346 % right shoulder as you enter the see saw and everything will flow. Make sure
347 % lines have \emph{lots} of space for the dosido.}
348 % \vspace*{\fill}
349 % \begin{flushright}
350 % \href{http://creativecommons.org/licenses/by/3.0/}{%
351 % \IfFileExists{by.png}{%
352 % \includegraphics[width=1cm]{by.png}%
353 % }{\cc\by}}
354 % \end{flushright}
355 % \end{contra}
356 % \end{exampledance}
357 %
358 % \begin{macro}{\showcountbefore}
359 % \changes{1.0.0}{2013/09/07}{Allow showing the count before each move}
360 % \begin{macro}{\showcountafter}
361 % \changes{1.0.0}{2013/09/07}{Allow showing the count after each move}
362 % \begin{macro}{\hidecountbefore}
363 % \changes{1.0.0}{2013/09/07}{Allow hiding the count before each move}
364 % \begin{macro}{\hidecountafter}
365 % \changes{1.0.0}{2013/09/07}{Allow hiding the count after each move}
366 % These macros allow the user to show or hide the moves duration before or after
367 % each move.
368 % \begin{macrocode}
369 \newcommand*{\showcountbefore}{\def\@showcountbefore{}}
370 \newcommand*{\showcountafter}{\def\@showcountafter{}}
371 \newcommand*{\hidecountbefore}{\let\@showcountbefore\undefined}
372 \newcommand*{\hidecountafter}{\let\@showcountafter\undefined}
373 % \end{macrocode}
374 % \end{macro}
375 % \end{macro}
376 % \end{macro}
377 % \end{macro}
378
379 % \begin{macro}{\countleftbracket}
380 % \changes{1.0.0}{2013/09/10}{Add ability to change count brackets}
381 % \begin{macro}{\countrightbracket}
382 % \changes{1.0.0}{2013/09/10}{Add ability to change count brackets}
383 % These commands can be used to set the left and right brackets which are
384 % inserted on around the count as discussed above. By default, they are set to
385 % plain left and right parenthesis. Note that these commands take a single
386 % argument (the new bracket) instead of simply being something that you redefine
387 % like many of the other formatting commands. They are not used for inserting
388 % the brackets themselves; just for changing them.
389 % \begin{macrocode}
390 \def\cc@countleftbracket{(}
391 \def\cc@countrightbracket{)}
392 \newcommand*{\countleftbracket}[1]{\def\cc@countleftbracket{#1}}
393 \newcommand*{\countrightbracket}[1]{\def\cc@countrightbracket{#1}}
394 % \end{macrocode}
395 % \end{macro}
396 % \end{macro}
397 %
398 % For instance, a dance with the count shown afterwards (and the default
399 % brackets) looks like this:
400 %
401 % \begin{exampledance}
402 % \showcountafter%
403 % \begin{contra}{Whirling Dervish}{Sam Whited}{Duple improper}
404 % \walkaround[neighbor 1\textthreequarters]{8}
405 % \move[8]{Men half hey ricochet while ladies cross%
406 % \unskip\moveindex{Hey for Four}%
407 % \unskip\moveindex{Half Hey}%
408 % \unskip\moveindex{Half Hey Ricochet}%
409 % \unskip\moveindex{Hey}%
410 % }
411 % \swing[your partners all]{16}
412 % \move[8]{Spin like a Whirling Dervish\moveindex{Whirling Dervish}}
413 % \balanceand\petronella
414 % \balanceand\move[4]{gents roll neighbor away with a half sashay\moveindex{Half
415 % Sashay}\moveindex{Roll Away}\moveindex{Roll Away\ldots Half Sashay}}
416 % \move[8]{Balance neighbor and left shoulder round 1 time to new
417 % neighbors\moveindex{Balance}\moveindex{Walk around}\moveindex{Left shoulder round}}
418 % \notes{A ``Whirling Dervish" is just a circle left in single file except
419 % that you should spin over your left shoulder the entire time you're doing
420 % it.}
421 % \vspace*{\fill}
422 % \begin{flushright}
423 % \href{http://creativecommons.org/licenses/by/3.0/}{%
424 % \IfFileExists{by.png}{%
425 % \includegraphics[width=1cm]{by.png}%
426 % }{\cc\by}}
427 % \end{flushright}
428 % \end{contra}
429 % \end{exampledance}
430 %
431 % \begin{macro}{\setdefaultnotesenv}
432 % \changes{1.0.0}{2013/09/10}{Allow changing the default notes environment}
433 % \begin{macro}{\prenotevspace}
434 % \changes{1.0.0}{2013/09/10}{Allow changing the default notes vspace}
435 % You might have noticed the nicely formatted notes in the previous example. By
436 % default, all notes are set using the \code{flushleft} environment, and with
437 % \code{\textbackslash fill} amount of vspace before them. This can easily be
438 % changed with this macro and length.
439 % \begin{macrocode}
440 \def\cc@defaultnotesenv{flushleft}
441 \newcommand*{\setdefaultnotesenv}[1]{\def\cc@defaultnotesenv{#1}}
442 \newlength{\prenotevspace}
443 \setlength{\prenotevspace}{\fill}
444 % \end{macrocode}
445 % \end{macro}
446 % \end{macro}
447 %
448 % \section{Counters}
449 %
450 % Lots of counters are used throughout Contra Card for various tasks. The
451 % following counters do everything from keeping track of the timing, to counting
452 % the number of moves in a dance.
453 %
454 % \subsection{Musical counts}
455 %
456 % \begin{macro}{dancecount}
457 % \begin{macro}{partcount}
458 % \changes{0.2}{2013/02/15}{Create a counter for the current musical part}
459 % \changes{0.3}{2013/02/21}{Change to contain the count, not the part itself}
460 % \begin{macro}{phrasecount}
461 % \changes{0.2}{2013/02/15}{Create a counter for the current musical phrase}
462 % \changes{0.3}{2013/02/21}{Change to contain the count, not the phrase itself}
463 % \begin{macro}{dancepart}
464 % \changes{0.3}{2013/02/21}{Create a new counter for the current phrase}
465 % \begin{macro}{dancephrase}
466 % \changes{0.3}{2013/02/21}{Create a new counter for the current phrase}
467 % These counters help us keep track of the counts (or `steps') in the dance. The
468 % \code{dancecount} is reset at the start of each new dance, the
469 % \code{partcount} is reset at the begining of each part (eg.\ \code{A1} or
470 % \code{B1}), and the \code{phrasecount} is reset every time the part changes
471 % (eg.~from \code{A} to \code{B}). The \code{dancepart} and \code{dancephrase}
472 % counters contain the number of the part of phrase in the dance (instead of the
473 % number of steps).
474 % \begin{macrocode}
475 \newcounter{dancecount}
476 \newcounter{partcount}
477 \newcounter{phrasecount}
478 \newcounter{dancepart}
479 \newcounter{dancephrase}
480 % \end{macrocode}
481 % \end{macro}
482 % \end{macro}
483 % \end{macro}
484 % \end{macro}
485 % \end{macro}
486 %
487 % \begin{macro}{dancepartlength}
488 % \changes{0.4}{2013/02/22}{Create a new counter for the part length}
489 % \begin{macro}{dancephraselength}
490 % \changes{0.4}{2013/02/22}{Create a new counter for the phrase length}
491 % \begin{macro}{\resetdancepartlength}
492 % \changes{1.0.0}{2013/08/12}{Add ability to easily reset counter}
493 % \begin{macro}{\resetdancephraselength}
494 % \changes{1.0.0}{2013/08/12}{Add ability to easily reset counter}
495 % Most contra dances are composed of two 32 count phrases, each with two 16
496 % count parts, however, it's sometimes useful to change these lengths (for swung
497 % dances and the like). It's important to fully understand how the move command
498 % works before modifying these values. Changing just one or the other can have
499 % unexpected consequences. You can set them back quickly afterwards with the
500 % reset commands.
501 % \begin{macrocode}
502 \newcounter{dancepartlength}
503 \newcounter{dancephraselength}
504 \newcommand*{\resetdancepartlength}{\setcounter{dancepartlength}{16}}
505 \newcommand*{\resetdancephraselength}{\setcounter{dancephraselength}{32}}
506 \resetdancepartlength
507 \resetdancephraselength
508 % \end{macrocode}
509 % For example, if we set the \code{dancepartlength} to 12 and the
510 % \code{\textbackslash dancephraselength} to 24 (along with some minor tweaks
511 % for clarity) like so:
512 %
513 % \begin{verbatim}
514 % \setcounter{dancepartlength}{12}
515 % \setcounter{dancephraselength}{24}
516 % \showcountafter
517 % \end{verbatim}
518 %
519 % We can create a nice mixer in waltz time:
520 %
521 % \begin{exampledance}
522 % \setcounter{dancepartlength}{12}
523 % \setcounter{dancephraselength}{24}
524 % \begin{contra}{Turn Around Waltz}{Sam Whited}{Circle waltz}
525 % \showcountafter
526 %
527 % \move[6]{Roll lady on left away}\moveindex{Roll Away}
528 % \move[6]{Forward and back}\moveindex{Forward and Back}
529 % \move[6]{Roll lady on left away}\moveindex{Roll Away}
530 % \move[6]{Forward and back}\moveindex{Forward and Back}
531 % \move[6]{Hands out and in, turn out}\moveindex{Turn Alone}
532 % \move[6]{Hands in and out, turn in}\moveindex{Turn Alone}
533 % \move[6]{Hands out and in ladies cast right}\moveindex{Cast Right}
534 % \move[6]{Parallels or free waltz}\moveindex{Parallels}
535 %
536 % \notes{Repeat \textbf{BABB} if dancing to the Nanci Griffith cover of ``Turn
537 % Around". Circles of 4 or 8 couples brings you back to your original partner
538 % for free waltz at end; for 3 or 7 put partner on your left to start. Get
539 % people into square formation, then ask them to merge squares to make things
540 % easier.}
541 % \end{contra}
542 % \resetdancepartlength
543 % \resetdancephraselength
544 % \end{exampledance}
545 % \end{macro}
546 % \end{macro}
547 % \end{macro}
548 % \end{macro}
549 %
550 % \begin{macro}{\resetdancephrase}
551 % \begin{macro}{\resetdancepart}
552 % \begin{macro}{\resetdancephrase*}
553 % \begin{macro}{\resetdancepart*}
554 % \changes{0.2}{2013/02/15}{Allow the user to reset the phrase}
555 % \changes{0.3}{2013/02/21}{Change name of \code{\textbackslash progressed}}
556 % The phrase will continue to increment (\code{A}, \code{B}, \code{C}) unless
557 % the user resets it by calling \code{\textbackslash resetdancephrase}. The user
558 % can also manually reset the part. If the value of the phrase or part would be
559 % the same after resetting, no action is taken. You can use the splat version of
560 % the commands to force a reset (eg.~even if the \code{dancephrase} counter is
561 % already at 1, the \code{dancephrase} and \code{phrasecount} counters will
562 % still be reset).
563 % \begin{macrocode}
564 \newcommand*{\resetdancephrase}{%
565 \ifthenelse{\value{partcount}=16}{\newline}{}%
566 \@ifstar{\@resetdancephraseStar}{\@resetdancephraseNoStar}%
567 }
568 \newcommand*{\@resetdancephraseStar}{%
569 \setcounter{dancephrase}{1}%
570 \setcounter{phrasecount}{0}%
571 \setcounter{phrasemovenum}{0}%
572 \resetdancepart*%
573 }
574 \newcommand*{\@resetdancephraseNoStar}{%
575 \ifthenelse{\value{dancephrase}=1}{}{%
576 \setcounter{dancephrase}{1}%
577 \setcounter{phrasecount}{0}%
578 \setcounter{phrasemovenum}{0}%
579 \resetdancepart%
580 }%
581 }
582 \newcommand*{\resetdancepart}{%
583 \@ifstar{\@resetdancepartStar}{\@resetdancepartNoStar}%
584 }
585 \newcommand*{\@resetdancepartStar}{%
586 \setcounter{dancepart}{1}%
587 \setcounter{partcount}{0}%
588 \setcounter{partmovenum}{0}%
589 \setcounter{halfpartmovenum}{0}%
590 }
591 \newcommand*{\@resetdancepartNoStar}{%
592 \ifthenelse{\value{dancepart}=1}{}{%
593 \setcounter{dancepart}{1}%
594 \setcounter{partcount}{0}%
595 \setcounter{partmovenum}{0}%
596 \setcounter{halfpartmovenum}{0}%
597 }%
598 }
599 % \end{macrocode}
600 % \end{macro}
601 % \end{macro}
602 % \end{macro}
603 % \end{macro}
604 %
605 % \begin{macro}{\newdancephrase}
606 % \changes{0.3}{2013/02/21}{Allow user to manually start a new phrase}
607 % \begin{macro}{\newdancepart}
608 % \changes{0.3}{2013/02/21}{Allow user to manually start a new part}
609 % The user can also manually start a new phrase or part:
610 % \begin{macrocode}
611 \newcommand*{\newdancephrase}{%
612 \ifthenelse{\NOT\value{phrasecount}=0}{\par\phraseseparator\par}{}%
613 \addtocounter{dancephrase}{1}%
614 \setcounter{phrasecount}{0}%
615 \setcounter{phrasemovenum}{0}%
616 \resetdancepart*%
617 }
618 \newcommand*{\newdancepart}{%
619 \par\nopagebreak%
620 \addtocounter{dancepart}{1}%
621 \setcounter{partcount}{0}%
622 \setcounter{partmovenum}{0}%
623 \setcounter{halfpartmovenum}{0}%
624 }
625 % \end{macrocode}
626 % \end{macro}
627 % \end{macro}
628 %
629 % To see how this can be useful consider the following blues contras by caller
630 % (and all around cat's pajamas) Seth Tepfer. Each one comprises three 16 count
631 % phrases (\code{A1}, \code{B1}, and \code{C1}). The first employs the
632 % \code{\textbackslash newdancephrase} command to reset the phrase every 16
633 % counts, the second changes the \code{dancephraselength} and lets Contra Card
634 % handle figuring out how to break up the phrases. Both methods produce the same
635 % result.
636 %
637 % \begin{Verbatim}
638 % \begin{contra}{Untitled Blues \textnumero\ 1}{Seth Tepfer}{Duple minor im.}
639 % \setlength{\phrasevspace}{0em}
640 % \renewcommand*{\partdelimiter}{:}
641 % \walkaround*[Neighbor]{8}
642 % \walkaround*[Ladies]{8}
643 % \newdancephrase
644 % \balanceand*[Partner]\swing{12}
645 % \newdancephrase
646 % \ladieschain
647 % \starleft{8}
648 % \vspace*{\fill}
649 % \begin{flushright}
650 % \href{http://creativecommons.org/licenses/by-nc/3.0/}{%
651 % \IfFileExists{by-nc.png}{%
652 % \includegraphics[width=1cm]{by-nc.png}%
653 % }{\cc\bync}}
654 % \end{flushright}
655 % \end{contra}
656 % \end{Verbatim}
657 %
658 % \begin{exampledance}
659 % \begin{contra}{Untitled Blues \textnumero\ 1}{Seth Tepfer}{Duple minor im.}
660 % \setlength{\phrasevspace}{0em}
661 % \renewcommand*{\partdelimiter}{:}
662 % \walkaround*[Neighbor]{8}
663 % \walkaround*[Ladies]{8}
664 % \newdancephrase
665 % \balanceand*[Partner]\swing{12}
666 % \newdancephrase
667 % \ladieschain
668 % \starleft{8}
669 % \vspace*{\fill}
670 % \begin{flushright}
671 % \href{http://creativecommons.org/licenses/by-nc/3.0/}{%
672 % \IfFileExists{by-nc.png}{%
673 % \includegraphics[width=1cm]{by-nc.png}%
674 % }{\cc\bync}}
675 % \end{flushright}
676 % \end{contra}
677 % \end{exampledance}
678 %
679 % \clearpage
680 % \begin{Verbatim}
681 % \begin{contra}{Untitled Blues \textnumero\ 2}{Seth Tepfer}{Duple minor im.}
682 % \setlength{\phrasevspace}{0em}
683 % \renewcommand*{\partdelimiter}{:}
684 % \setcounter{dancephraselength}{16}
685 %
686 % \walkaround*[Neighbor]{8}
687 % \move[8]{Gents allemande\moveindex{Allemande} left 1\textonehalf}
688 % \balanceand*[Partner]\swing{12}
689 % \move[8]{\textonehalf\ promenade\moveindex{Half Promenade}\moveindex{Promenade} across set}
690 % \ladieschain
691 % \vspace*{\fill}
692 % \begin{flushright}
693 % \href{http://creativecommons.org/licenses/by-nc/3.0/}{%
694 % \IfFileExists{by-nc.png}{%
695 % \includegraphics[width=1cm]{by-nc.png}%
696 % }{\cc\bync}}
697 % \end{flushright}
698 % \end{contra}
699 % \end{Verbatim}
700 %
701 % \begin{exampledance}
702 % \begin{contra}{Untitled Blues \textnumero\ 2}{Seth Tepfer}{Duple minor im.}
703 % \setlength{\phrasevspace}{0em}
704 % \renewcommand*{\partdelimiter}{:}
705 % \setcounter{dancephraselength}{16}
706 %
707 % \walkaround*[Neighbor]{8}
708 % \move[8]{Gents allemande\moveindex{Allemande} left 1\textonehalf}
709 % \balanceand*[Partner]\swing{12}
710 % \move[8]{\textonehalf\ promenade\moveindex{Half Promenade}\moveindex{Promenade} across set}
711 % \ladieschain
712 % \vspace*{\fill}
713 % \begin{flushright}
714 % \href{http://creativecommons.org/licenses/by-nc/3.0/}{%
715 % \IfFileExists{by-nc.png}{%
716 % \includegraphics[width=1cm]{by-nc.png}%
717 % }{\cc\bync}}
718 % \end{flushright}
719 % \end{contra}
720 % \resetdancephraselength
721 % \end{exampledance}
722 %
723 % \subsection{Move counts}
724
725 % \begin{macro}{phrasemovenum}
726 % \changes{1.0.0}{2013/09/05}{Add counter for the number of moves in the phrase}
727 % \begin{macro}{partmovenum}
728 % \changes{1.0.0}{2013/09/05}{Add counter for the number of moves in the part}
729 % \begin{macro}{halfpartmovenum}
730 % \changes{1.0.0}{2013/09/10}{Add counter for the number of moves in half the part}
731 % \begin{macro}{dancemovenum}
732 % \changes{1.0.0}{2013/09/05}{Add counter for the number of moves in the dance}
733 % The following counters are used to keep track of the number of moves that have
734 % occurred thus far in the given dance, phrase, or part. They are incremented
735 % every time \code{\textbackslash move} is called.
736 % \begin{macrocode}
737 \newcounter{phrasemovenum}
738 \newcounter{partmovenum}
739 \newcounter{halfpartmovenum}
740 \newcounter{dancemovenum}
741 \setcounter{phrasemovenum}{0}
742 \setcounter{partmovenum}{0}
743 \setcounter{halfpartmovenum}{0}
744 \setcounter{dancemovenum}{0}
745 % \end{macrocode}
746 % \end{macro}
747 % \end{macro}
748 % \end{macro}
749 % \end{macro}
750 %
751 % \section{The \code{contra} environment}
752 %
753 % \begin{macro}{contra}
754 % \changes{0.1}{2013/02/14}{Create contra environment}
755 % The contra environment is pretty simple. It resets the various counters, and
756 % displays some information about the dance---if it is used inside of the
757 % \pkg{contracard} class, it also clears the page and moves the dance form into
758 % the header.
759 % \begin{macrocode}
760 \newenvironment{contra}[4][\defaultcontraenv]{%
761 \global\def\dancetitle{\ignorespaces#2\unskip}
762 \global\def\danceauthor{\ignorespaces#3\unskip}
763 \global\def\danceform{\ignorespaces#4\unskip}
764 \setlength{\parskip}{0.3em plus 0.2em minus 0.3em}
765 \refstepcounter{dance}
766 \addcontentsline{lod}{dance}{\protect\numberline{\thedance}\ignorespaces#2\unskip}
767 \setcounter{dancecount}{0}
768 \setcounter{dancemovenum}{0}
769 \resetdancepart*
770 \resetdancephrase*
771 \ifdefined\@ccisclass\clearpage\fi%
772 \ifthenelse{\isundefined{\imki@wrindexentry}}{%
773 \index{\ignorespaces#4\unskip}
774 }{%
775 \index[dbt]{\ignorespaces#4\unskip}
776 \index[dba]{\ignorespaces#3\unskip}
777 }%
778 \begin{\dancetitleenv}
779 \ifdefined\@ccisclass%
780 \pagestyle{myheadings}
781 \thispagestyle{myheadings}
782 \markboth{}{\danceformformat{\ignorespaces#4\unskip}}
783 \else%
784 {\danceformformat{\ignorespaces#4\unskip}}%
785 \fi%
786 {\dancetitleformat{\ignorespaces#2\unskip}}%
787 {\danceauthorformat{\ignorespaces#3\unskip}}%
788 \end{\dancetitleenv}
789 \newcommand*{\@contraenv}{#1}
790 \begin{\@contraenv}
791 % \end{macrocode}
792 % The next three lines are worth noting. Any new lines, vertical tabs, or form
793 % feeds you introduce into your dance won't actually do anything. Contra Card
794 % attempts to handle line breaks for your, and provides you with hook to insert
795 % vertical space at the appropriate times.
796 % \begin{macrocode}
797 \catcode10=9\relax % New line
798 \catcode11=9\relax % Vertical Tab
799 \catcode12=9\relax % Form Feed
800 }{%
801 \end{\@contraenv}
802 }
803 % \end{macrocode}
804 % \end{macro}
805 %
806 % \section{Moves}
807 %
808 % \subsection{The \code{\textbackslash move} command}
809 %
810 % \begin{macro}{\move}
811 % \changes{0.1}{2013/02/14}{Add move command}
812 % \changes{0.3}{2013/02/21}{Simplify dance logic using new counters}
813 % \changes{1.0.0}{2013/09/10}{Improve indentation and line spacing}
814 % \begin{macro}{\move*}
815 % The meat of the \pkg{contracard} package is contained in the
816 % \code{\textbackslash move} command.
817 % This command takes in a move to display, and (optionally) the number of beats
818 % the move takes.
819 % If the count is not specified, 8 is used as the default.
820 % \begin{macrocode}
821 \newcommand*{\move}{\@ifstar\@moveStar\@moveNoStar}
822 \newcommand*{\@moveStar}[2][8]{%
823 \def\cc@moveStar{}\@moveNoStar[#1]{#2}\let\cc@moveStar\undefined%
824 }
825 \newlength{\cc@partsepwidth}%
826 \newcommand*{\@balanceAnd}{\ignorespaces}%
827 \newcommand*{\@extraCount}{0}%
828 \newcounter{movecount}%
829 \newcommand*{\@moveNoStar}[2][8]{%
830 \setlength{\parindent}{0pt}%
831 \setlength{\cc@partsepwidth}{\widthof{\Alph{dancephrase}\arabic{dancepart}%
832 \partdelimiter\ }}%
833 \setlength{\hangindent}{\cc@partsepwidth}%
834 \ifthenelse{\value{phrasecount}=\value{dancephraselength}}{%
835 \ifthenelse{\NOT\(#1=0\)}{%
836 \newdancephrase%
837 }{}%
838 }{%
839 \ifthenelse{\(\value{partcount}=\value{dancepartlength}\)%
840 \AND\NOT\(#1=0\)}{%
841 \newdancepart%
842 }{}%
843 }%
844 \ifthenelse{\value{partmovenum}=0}{%
845 \Alph{dancephrase}\arabic{dancepart}\partdelimiter\ %
846 }{}%
847 \setcounter{movecount}{0}%
848 \addtocounter{movecount}{#1}%
849 \addtocounter{movecount}{\@extraCount}%
850 \addtocounter{dancecount}{\value{movecount}}%
851 \addtocounter{phrasecount}{\value{movecount}}%
852 \addtocounter{partcount}{\value{movecount}}%
853 \addtocounter{phrasemovenum}{1}%
854 \addtocounter{partmovenum}{1}%
855 \addtocounter{halfpartmovenum}{1}%
856 \addtocounter{dancemovenum}{1}%
857 \ifthenelse{\isundefined{\@showcountbefore}\OR\(\value{movecount}=0\)}{%
858 \relax%
859 }{\cc@countleftbracket\ignorespaces\themovecount\unskip\cc@countrightbracket~}%
860 \@balanceAnd#2\unskip%
861 \ifthenelse{\isundefined{\@showcountafter}\OR\(\value{movecount}=0\)}{%
862 \relax%
863 }{~\cc@countleftbracket\ignorespaces\themovecount\unskip\cc@countrightbracket}%
864 \ifthenelse{\NOT\(\value{movecount}=0\)}{%
865 \ifthenelse{\value{partcount}=\intcalcDiv{\value{dancepartlength}}{2}}{%
866 \setcounter{halfpartmovenum}{0}%
867 }{}%
868 \ifx\cc@moveStar\undefined%
869 \ifthenelse{\value{partcount}=\intcalcDiv{\value{dancepartlength}}{2}}{%
870 \midpartdelimiter\looseness=-1\linebreak[1]\space\nopagebreak\ignorespaces%
871 }{%
872 \ifthenelse{\NOT\value{partcount}=\value{dancepartlength}}{%
873 \movedelimiter\nolinebreak[2]\space\nopagebreak\ignorespaces%
874 }{}%
875 }%
876 \fi%
877 }{}%
878 \renewcommand*{\@balanceAnd}{\ignorespaces}%
879 \renewcommand*{\@extraCount}{0}%
880 }
881 % \end{macrocode}
882 % \end{macro}
883 % \end{macro}
884 %
885 % \subsection{Move shortcuts}
886 %
887 % Often you may find yourself copy and pasting common moves that have the same
888 % timing, wording, etc. For times like this \pkg{contracard} provides a number
889 % of shortcut macros.
890 %
891 % \begin{macro}{\allemande}
892 % \changes{1.0.0}{2013/09/05}{Add move shortcut}
893 % \begin{macro}{\allemande*}
894 % \changes{1.0.0}{2013/09/05}{Add move shortcut}
895 % The allemande macro takes two mandatory arguments: the count, and the
896 % direction to allemande. It also takes the person to allemande (eg.~shadow,
897 % partner, neighbor, etc.) as an optional first argument.
898 % \begin{macrocode}
899 \newcommand*{\allemande}{%
900 \moveindex{Allemande}%
901 \@ifstar\@allemandeStar\@allemandeNoStar%
902 }
903 \newcommand*{\@allemandeNoStar}[3][\unskip]{%
904 \move[#2]{Allemande \ignorespaces#3\unskip\ \ignorespaces#1\unskip}%
905 }
906 \newcommand*{\@allemandeStar}[3][%
907 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
908 \move[#2]{\ignorespaces#1\unskip\ allemande \ignorespaces#3\unskip}%
909 }
910 % \end{macrocode}
911 % \end{macro}
912 % \end{macro}
913 %
914 % \begin{macro}{\balance}
915 % \changes{1.0.0}{2013/09/05}{Add move shortcut}
916 % \begin{macro}{\balance*}
917 % \changes{1.0.0}{2013/09/05}{Add move shortcut}
918 % \begin{macro}{\balanceand}
919 % \changes{1.0.0}{2013/09/05}{Add move shortcut}
920 % \changes{2.0.0}{2019/02/28}{Now modifies count and text of next move}
921 % \begin{macro}{\balanceand*}
922 % \changes{1.0.0}{2013/09/05}{Add move shortcut}
923 % \changes{2.0.0}{2019/02/28}{Now modifies count and text of next move}
924 % The \code{\textbackslash balance} macro takes a single optional argument and
925 % prints it after (or before if you use \code{\textbackslash balance*}) the word
926 % `balance'. Balances always take up 4 beats.
927 % If \code{\textbackslash balanceand} or \code{\textbackslash balanceand*} is
928 % used, the balance won't be counted as a separate move.
929 % Instead, its count (and the text) will be added to the next move used.
930 % \begin{macrocode}
931 \newcommand*{\balance}{%
932 \moveindex{Balance}%
933 \@ifstar\@balanceStar\@balanceNoStar%
934 }
935 \newcommand*{\@balanceNoStar}[1][\unskip]{%
936 \move[4]{Balance \ignorespaces#1\unskip}%
937 }
938 \newcommand*{\@balanceStar}[1][%
939 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
940 \move[4]{\ignorespaces#1\unskip\ balance}%
941 }
942 \newcommand*{\balanceand}{%
943 \cc@checkphrasestart%
944 \moveindex{Balance}%
945 \@ifstar\@balanceandStar\@balanceandNoStar%
946 }
947 \newcommand*{\@balanceandNoStar}[1][]{%
948 \renewcommand*{\@balanceAnd}{Balance and \ignorespaces#1\unskip\ \expandafter\ignorespaces\expandafter\MakeLowercase}%
949 \renewcommand*{\@extraCount}{4}%
950 }
951 \newcommand*{\@balanceandStar}[1][%
952 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
953 \renewcommand*{\@balanceAnd}{\ignorespaces#1\unskip\ balance and\ \expandafter\ignorespaces\expandafter\MakeLowercase}%
954 \renewcommand*{\@extraCount}{4}%
955 }
956 % \end{macrocode}
957 % \end{macro}
958 % \end{macro}
959 % \end{macro}
960 % \end{macro}
961 %
962 % \begin{macro}{\butterflywhirl}
963 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
964 % \begin{macro}{\butterflywhirl*}
965 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
966 % Both versions of \code{\textbackslash butterflywhirl} also take in an optional
967 % string representing the other dance (eg.~partner, neighbor, etc.) and the
968 % count as arguments.
969 % \begin{macrocode}
970 \newcommand*{\butterflywhirl}{%
971 \moveindex{Butterfly Whirl}%
972 \@ifstar\@butterflyStar\@butterflyNoStar%
973 }
974 \newcommand*{\@butterflyNoStar}[2][\unskip]{%
975 \move[#2]{Butterfly whirl \ignorespaces#1\unskip}%
976 }
977 \newcommand*{\@butterflyStar}[2][%
978 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
979 \move[#2]{\ignorespaces#1\unskip\ butterfly whirl}%
980 }
981 % \end{macrocode}
982 % \end{macro}
983 % \end{macro}
984 %
985 % \begin{macro}{\circleleft}
986 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
987 % \begin{macro}{\circleleft*}
988 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
989 % \begin{macro}{\circleright}
990 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
991 % \begin{macro}{\circleright*}
992 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
993 % Here are a few commands to deal with circles. As usual, there is an optional
994 % argument (in case you need to say something like ``Gents circle left" or
995 % ``Circle left 1 time `round") and a mandatory argument (the number of beats to
996 % circle).
997 % \begin{macrocode}
998 \newcommand*{\circleleft}{%
999 \moveindex{Circle Left}%
1000 \def\cc@dir{left}%
1001 \@ifstar\@circleStar\@circleNoStar%
1002 }
1003 \newcommand*{\circleright}{%
1004 \moveindex{Circle Right}%
1005 \def\cc@dir{right}%
1006 \@ifstar\@circleStar\@circleNoStar%
1007 }
1008 \newcommand*{\@circleNoStar}[2][\unskip]{%
1009 \move[#2]{Circle \cc@dir\ \ignorespaces#1\unskip}%
1010 }
1011 \newcommand*{\@circleStar}[2][%
1012 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1013 \move[#2]{\ignorespaces#1\unskip\ circle \cc@dir}%
1014 }
1015 % \end{macrocode}
1016 % \end{macro}
1017 % \end{macro}
1018 % \end{macro}
1019 % \end{macro}
1020 %
1021 % \begin{macro}{\courtesyturn}
1022 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1023 % \begin{macro}{\courtesyturn*}
1024 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1025 % Like most of the move shortcut macros, these take an optional person to turn,
1026 % and the number of beats. The star version of the command tweaks the wording a
1027 % bit.
1028 % \begin{macrocode}
1029 \newcommand*{\courtesyturn}{%
1030 \moveindex{Courtesy Turn}%
1031 \@ifstar\@courtesyturnStar\@courtesyturnNoStar%
1032 }
1033 \newcommand*{\@courtesyturnNoStar}[2][\unskip]{%
1034 \move[#2]{Courtesy turn \ignorespaces#1\unskip}%
1035 }
1036 \newcommand*{\@courtesyturnStar}[2][%
1037 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1038 \move[#2]{\ignorespaces#1\unskip\ courtesy turn}%
1039 }
1040 % \end{macrocode}
1041 % \end{macro}
1042 % \end{macro}
1043 %
1044 % \begin{macro}{\dosido}
1045 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1046 % \begin{macro}{\dosido*}
1047 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1048 % \begin{macro}{\seesaw}
1049 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1050 % \begin{macro}{\seesaw*}
1051 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1052 % These commands create a dosido (aka \word{do-si-do}, \word{do-se-do},
1053 % \word{dosado}, \word{dos-\`a-dos}, etc.) or a see saw (left shoulder dosido).
1054 % \begin{macrocode}
1055 \newcommand*{\dosido}{%
1056 \moveindex{\spellDosido}%
1057 \@ifstar\@dosidoStar\@dosidoNoStar%
1058 }
1059 \newcommand*{\@dosidoNoStar}[2][\unskip]{%
1060 \move[#2]{\spellDosido\ \ignorespaces#1\unskip}%
1061 }
1062 \newcommand*{\@dosidoStar}[2][%
1063 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1064 \move[#2]{\ignorespaces#1\unskip\ \spelldosido}%
1065 }
1066 \newcommand*{\seesaw}{%
1067 \moveindex{See Saw}%
1068 \@ifstar\@seesawStar\@seesawNoStar%
1069 }
1070 \newcommand*{\@seesawNoStar}[2][\unskip]{%
1071 \move[#2]{See saw \ignorespaces#1\unskip}%
1072 }
1073 \newcommand*{\@seesawStar}[2][%
1074 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1075 \move[#2]{\ignorespaces#1\unskip\ see saw}%
1076 }
1077 % \end{macrocode}
1078 % \end{macro}
1079 % \end{macro}
1080 % \end{macro}
1081 % \end{macro}
1082 %
1083 % \begin{macro}{\walkaround}
1084 % \changes{2.0.0}{2019/02/17}{Rename move}
1085 % \begin{macro}{\walkaround*}
1086 % \changes{2.0.0}{2019/02/17}{Rename move}
1087 % \begin{macro}{\walkaroundleft}
1088 % \changes{2.0.0}{2019/02/17}{Rename move}
1089 % \begin{macro}{\walkaroundleft*}
1090 % \changes{2.0.0}{2019/02/17}{Rename move}
1091 % \begin{macro}{\walkaroundright}
1092 % \changes{2.0.0}{2019/02/17}{Rename move}
1093 % \begin{macro}{\walkaroundright*}
1094 % \changes{2.0.0}{2019/02/17}{Rename move}
1095 % Several different macros exist for creating walk arounds (sometimes right or
1096 % left shoulder round).
1097 % You can create a direction agnostic version with the \code{\textbackslash
1098 % walkaround} macro, while the \code{\textbackslash walkaroundleft} and
1099 % \code{\textbackslash walkaroundright} macros use the ``shoulder round" variant
1100 % and include the direction, they also index the move under the given direction.
1101 %
1102 % For information about the terminology, see appendix \ref{appendix:notation}.
1103 % \begin{macrocode}
1104 \newcommand*{\walkaround}{%
1105 \moveindex{Walk around}%
1106 \@ifstar\@walkAroundStar\@walkAroundNoStar%
1107 }
1108 \newcommand*{\walkaroundright}{%
1109 \moveindex{Walk around}%
1110 \moveindex{Right shoulder round}%
1111 \def\cc@thedir{right}%
1112 \@ifstar\@walkAroundDirStar\@walkAroundDirNoStar%
1113 }
1114 \newcommand*{\walkaroundleft}{%
1115 \moveindex{Walk around}%
1116 \moveindex{Left shoulder round}%
1117 \def\cc@thedir{left}%
1118 \@ifstar\@walkAroundDirStar\@walkAroundDirNoStar%
1119 }
1120 \newcommand*{\@walkAroundNoStar}[2][\unskip]{%
1121 \move[#2]{Walk around \ignorespaces#1\unskip}%
1122 }
1123 \newcommand*{\@walkAroundStar}[2][%
1124 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1125 \move[#2]{\ignorespaces#1\unskip\ walk around}%
1126 }
1127 \newcommand*{\@walkAroundDirNoStar}[2][\unskip]{%
1128 \move[#2]{\cc@thedir\ shoulder round \ignorespaces#1\unskip}%
1129 }
1130 \newcommand*{\@walkAroundDirStar}[2][%
1131 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1132 \move[#2]{\ignorespaces#1\unskip\ \cc@thedir\ shoulder round}%
1133 }
1134 % \end{macrocode}
1135 % \end{macro}
1136 % \end{macro}
1137 % \end{macro}
1138 % \end{macro}
1139 % \end{macro}
1140 % \end{macro}
1141 %
1142 % \begin{macro}{\heyforfour}
1143 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1144 % \begin{macro}{\heyforfour*}
1145 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1146 % \begin{macro}{\halfhey}
1147 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1148 % \begin{macro}{\halfhey*}
1149 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1150 % \begin{macro}{\halfheyricochet}
1151 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1152 % \begin{macro}{\halfheyricochet*}
1153 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1154 % \begin{macro}{\fullhey}
1155 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1156 % \begin{macro}{\fullhey*}
1157 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1158 % \begin{macro}{\fullheyricochet}
1159 % \changes{2.0.0}{2019/03/03}{Add move shortcut}
1160 % \begin{macro}{\fullheyricochet*}
1161 % \changes{2.0.0}{2019/03/03}{Add move shortcut}
1162 % These macros produce various kinds of hey. Though `hey for four' is often used
1163 % to indicate `half a hey` we define `hey for four` and `full hey' to be the
1164 % same thing.
1165 % \begin{macrocode}
1166 \newcommand*{\heyforfour}{%
1167 \moveindex{Hey}%
1168 \moveindex{Hey for Four}%
1169 \moveindex{Full Hey}%
1170 \@ifstar\@heyforfourStar\@heyforfourNoStar%
1171 }
1172 \newcommand*{\@heyforfourNoStar}[1][\unskip]{%
1173 \move[16]{Hey for four \ignorespaces#1\unskip}
1174 }
1175 \newcommand*{\@heyforfourStar}[1][%
1176 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1177 \move[16]{\ignorespaces#1\unskip\ hey for four}
1178 }
1179 \newcommand*{\halfhey}{%
1180 \moveindex{Hey}%
1181 \moveindex{Hey for Four}%
1182 \moveindex{Half Hey}%
1183 \@ifstar\@halfheyStar\@halfheyNoStar%
1184 }
1185 \newcommand*{\@halfheyNoStar}[1][\unskip]{%
1186 \move[8]{Half a hey \ignorespaces#1\unskip}
1187 }
1188 \newcommand*{\@halfheyStar}[1][%
1189 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1190 \move[8]{\ignorespaces#1\unskip\ half a hey}
1191 }
1192 \newcommand*{\halfheyricochet}{%
1193 \moveindex{Hey}%
1194 \moveindex{Hey for Four}%
1195 \moveindex{Half Hey}%
1196 \moveindex{Half Hey Ricochet}%
1197 \@ifstar\@halfheyricochetStar\@halfheyricochetNoStar%
1198 }
1199 \newcommand*{\@halfheyricochetNoStar}[1][\unskip]{%
1200 \move[8]{Half hey ricochet \ignorespaces#1\unskip}
1201 }
1202 \newcommand*{\@halfheyricochetStar}[1][%
1203 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1204 \move[8]{\ignorespaces#1\unskip\ half hey ricochet}
1205 }
1206 \newcommand*{\fullhey}{%
1207 \moveindex{Hey}%
1208 \moveindex{Hey for Four}%
1209 \moveindex{Full Hey}%
1210 \@ifstar\@fullheyStar\@fullheyNoStar%
1211 }
1212 \newcommand*{\@fullheyNoStar}[1][\unskip]{%
1213 \move[16]{Full hey \ignorespaces#1\unskip}
1214 }
1215 \newcommand*{\@fullheyStar}[1][%
1216 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1217 \move[16]{\ignorespaces#1\unskip\ full hey}
1218 }
1219 \newcommand*{\fullheyricochet}{%
1220 \moveindex{Hey}%
1221 \moveindex{Hey for Four}%
1222 \moveindex{Full Hey}%
1223 \moveindex{Full Hey Ricochet}%
1224 \@ifstar\@fullheyricochetStar\@fullheyricochetNoStar%
1225 }
1226 \newcommand*{\@fullheyricochetNoStar}[1][\unskip]{%
1227 \move[16]{Full hey ricochet \ignorespaces#1\unskip}
1228 }
1229 \newcommand*{\@fullheyricochetStar}[1][%
1230 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1231 \move[16]{\ignorespaces#1\unskip\ full hey ricochet}
1232 }
1233 % \end{macrocode}
1234 % \end{macro}
1235 % \end{macro}
1236 % \end{macro}
1237 % \end{macro}
1238 % \end{macro}
1239 % \end{macro}
1240 % \end{macro}
1241 % \end{macro}
1242 % \end{macro}
1243 % \end{macro}
1244 %
1245 % \begin{exampledance}
1246 % \begin{contra}{East Meets West}{Martha Wild}{Duple improper}
1247 % \longlines
1248 % \move{Walk around star \textthreequarters}\moveindex{Walk Around Star}
1249 % \move[16]{Right shoulder round and swing partner}\moveindex{Walk around}%
1250 % \moveindex{Right shoulder round}\moveindex{Swing}
1251 % \halfpromenade
1252 % \move{Hey}\moveindex{Hey}\moveindex{Hey for Four}\moveindex{Full Hey}
1253 % \move{(continue hey)}
1254 % \ladieschain
1255 % \end{contra}
1256 % \end{exampledance}
1257 %
1258 % \begin{macro}{\ladieschain}
1259 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1260 % \begin{macro}{\ladieschain*}
1261 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1262 % \begin{macro}{\menchain}
1263 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1264 % \begin{macro}{\menchain*}
1265 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1266 % \begin{macro}{\halfladieschain}
1267 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1268 % \begin{macro}{\halfladieschain*}
1269 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1270 % \begin{macro}{\halfmenchain}
1271 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1272 % \begin{macro}{\halfmenchain*}
1273 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1274 % \begin{macro}{\fullladieschain}
1275 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1276 % \begin{macro}{\fullladieschain*}
1277 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1278 % \begin{macro}{\fullmenchain}
1279 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1280 % \begin{macro}{\fullmenchain*}
1281 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1282 % The ladies chain (and it's less common variant for men) is actually a half of
1283 % a ladies chain. The full ladies chain is often simply called as two ladies
1284 % chains, however, the alternate full ladies chain commands are provided
1285 % anyways. A set of commands for half ladies chains are also provided; these are
1286 % exactly like the normal ladies chain commands except they include the word
1287 % `half' in the output.
1288 % \begin{macrocode}
1289 \newcommand*{\ladieschain}{%
1290 \moveindex{Ladies Chain}%
1291 \def\cc@who{ladies}%
1292 \@ifstar\@chainStar\@chainNoStar%
1293 }
1294 \newcommand*{\menchain}{%
1295 \moveindex{Men Chain}%
1296 \def\cc@who{men}%
1297 \@ifstar\@chainStar\@chainNoStar%
1298 }
1299 \newcommand*{\@chainNoStar}[1][\unskip]{%
1300 \move[8]{\expandafter\MakeUppercase\cc@who\ chain \ignorespaces#1\unskip}%
1301 }
1302 \newcommand*{\@chainStar}[1][%
1303 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1304 \move[8]{\ignorespaces#1\unskip\ \cc@who\ chain}%
1305 }
1306 \newcommand*{\halfladieschain}{%
1307 \moveindex{Half Ladies Chain}%
1308 \def\cc@who{ladies}%
1309 \@ifstar\@halfchainStar\@halfchainNoStar%
1310 }
1311 \newcommand*{\halfmenchain}{%
1312 \moveindex{Half Men Chain}%
1313 \def\cc@who{men}%
1314 \@ifstar\@halfchainStar\@halfchainNoStar%
1315 }
1316 \newcommand*{\@halfchainNoStar}[1][\unskip]{%
1317 \move[8]{\expandafter\MakeUppercase\cc@who\ half chain \ignorespaces#1\unskip}%
1318 }
1319 \newcommand*{\@halfchainStar}[1][%
1320 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1321 \move[8]{\ignorespaces#1\unskip\ \cc@who\ half chain}%
1322 }
1323 \newcommand*{\fullladieschain}{%
1324 \moveindex{Full Ladies Chain}%
1325 \def\cc@who{ladies}%
1326 \@ifstar\@fullchainStar\@fullchainNoStar%
1327 }
1328 \newcommand*{\fullmenchain}{%
1329 \moveindex{Full Men Chain}%
1330 \def\cc@who{men}%
1331 \@ifstar\@fullchainStar\@fullchainNoStar%
1332 }
1333 \newcommand*{\@fullchainNoStar}[1][\unskip]{%
1334 \move[16]{\expandafter\MakeUppercase\cc@who\ full chain \ignorespaces#1\unskip}%
1335 }
1336 \newcommand*{\@fullchainStar}[1][%
1337 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1338 \move[16]{\ignorespaces#1\unskip\ \cc@who\ full chain}%
1339 }
1340 % \end{macrocode}
1341 % \end{macro}
1342 % \end{macro}
1343 % \end{macro}
1344 % \end{macro}
1345 % \end{macro}
1346 % \end{macro}
1347 % \end{macro}
1348 % \end{macro}
1349 % \end{macro}
1350 % \end{macro}
1351 % \end{macro}
1352 % \end{macro}
1353 %
1354 % \begin{macro}{\lines}
1355 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1356 % \begin{macro}{\lines*}
1357 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1358 % \begin{macro}{\longlines}
1359 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1360 % \begin{macro}{\longlines*}
1361 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1362 % The \code{\textbackslash lines} macro (lines forward and back) takes a single
1363 % optional argument: The type of lines (eg. `short', `long', etc.). Using the
1364 % starred version of the command tells the lines to go forward (4 counts) but
1365 % not back. Since ``long lines forward and back" is such a common figure, an
1366 % alias is provided just for that.
1367 % \begin{macrocode}
1368 \newcommand*{\lines}{%
1369 \moveindex{Lines Forward and Back}%
1370 \@ifstar\@linesStar\@linesNoStar%
1371 }
1372 \newcommand*{\@linesNoStar}[1][%
1373 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1374 \move[8]{\ignorespaces#1\unskip\ lines forward and back}%
1375 }
1376 \newcommand*{\@linesStar}[1][lines]{%
1377 \move[4]{\ignorespaces#1\unskip\ lines forward}%
1378 }
1379 \newcommand*{\longlines}{%
1380 \moveindex{Long Lines Forward and Back\ \seealso{Lines Forward and Back}{X}}%
1381 \@ifstar\@longlinesStar\@longlinesNoStar%
1382 }
1383 \newcommand*{\@longlinesNoStar}{%
1384 \lines[Long]%
1385 }
1386 \newcommand*{\@longlinesStar}{%
1387 \lines*[Long]%
1388 }
1389 % \end{macrocode}
1390 % \end{macro}
1391 % \end{macro}
1392 % \end{macro}
1393 % \end{macro}
1394 %
1395 % \begin{macro}{\madrobin}
1396 % \changes{2.0.0}{2018/07/24}{New macro}
1397 % \begin{macro}{\madrobin*}
1398 % \changes{2.0.0}{2018/07/24}{New macro}
1399 % The Mad Robin (sometimes called ``Sashay 'round") always takes up 8 full
1400 % beats.
1401 % The star version of the command inserts the optional argument before the text
1402 % ``mad robin" instead of after it.
1403 % \begin{macrocode}
1404 \newcommand*{\madrobin}{%
1405 \moveindex{Mad Robin}%
1406 \@ifstar\@madrobinStar\@madrobinNoStar%
1407 }
1408 \newcommand*{\@madrobinNoStar}[1][\unskip]{%
1409 \move[8]{Mad robin \ignorespaces#1\unskip}%
1410 }
1411 \newcommand*{\@madrobinStar}[1][%
1412 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1413 \move[8]{\ignorespaces#1\unskip\ mad robin}%
1414 }
1415 % \end{macrocode}
1416 % \end{macro}
1417 % \end{macro}
1418 %
1419 % \begin{macro}{\petronella}
1420 % \changes{1.0.0}{2013/09/08}{Add move shortcut}
1421 % \begin{macro}{\petronella*}
1422 % \changes{1.0.0}{2013/09/08}{Add move shortcut}
1423 % \begin{macro}{\petronellanella}
1424 % \changes{1.1.0}{2018/07/21}{Add nella-nella petronella variants}
1425 % \begin{macro}{\petronellanella*}
1426 % \changes{1.1.0}{2018/07/21}{Add nella-nella petronella variants}
1427 % Petronella's are normally performed in rings of four, and aren't with another
1428 % individual, however, the \code{\textbackslash petronella} macro still takes a
1429 % single optional argument for those rare occasions when two individuals are
1430 % turning in a diamond pattern.
1431 % A petronella-nella has the same timing as a normal petronella but instead of
1432 % moving one place to the right dancers move two places.
1433 % \begin{exampledance}
1434 % \begin{contra}{Snowball Shimmy}{Seth Tepfer}{Duple becket}
1435 % \move[8]{Circle left all the way}
1436 % \allemande*[Gents]{8}{left 1\textonehalf}
1437 % \balanceand\swing[neighbor]{12}
1438 % \balanceand\petronella
1439 % \balanceand\petronellanella
1440 % \balanceand\swing[partner]{12}
1441 % \notes{nella-nella variant of Erik Weberg's Wasatch Wiggle}
1442 % \end{contra}
1443 % \end{exampledance}
1444 % \begin{macrocode}
1445 \newcommand*{\petronella}{%
1446 \moveindex{Petronella}%
1447 \@ifstar\@petronellaStar\@petronellaNoStar%
1448 }
1449 \newcommand*{\@petronellaNoStar}[1][\unskip]{%
1450 \move[4]{Petronella \ignorespaces#1\unskip}%
1451 }
1452 \newcommand*{\@petronellaStar}[1][%
1453 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1454 \move[4]{\ignorespaces#1\unskip\ petronella}%
1455 }
1456 \newcommand*{\petronellanella}{%
1457 \moveindex{Petronella}%
1458 \moveindex{Petronella-nella}%
1459 \@ifstar\@petronellanellaStar\@petronellanellaNoStar%
1460 }
1461 \newcommand*{\@petronellanellaNoStar}[1][\unskip]{%
1462 \move[4]{Petronella-nella \ignorespaces#1\unskip}%
1463 }
1464 \newcommand*{\@petronellanellaStar}[1][%
1465 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1466 \move[4]{\ignorespaces#1\unskip\ petronella-nella}%
1467 }
1468 % \end{macrocode}
1469 % \end{macro}
1470 % \end{macro}
1471 % \end{macro}
1472 % \end{macro}
1473 %
1474 % \begin{macro}{\promenade}
1475 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1476 % \begin{macro}{\promenade*}
1477 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1478 % \begin{macro}{\halfpromenade}
1479 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1480 % \begin{macro}{\halfpromenade*}
1481 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1482 % The \code{\textbackslash promenade} and \code{\textbackslash halfpromenade}
1483 % commands work slightly differently. Both take the person (or direction) you're
1484 % promenading as the optional argument, but the \code{\textbackslash promenade}
1485 % command also takes a mandatory argument (the number of beats) while
1486 % \code{\textbackslash halfpromenade} command is fixed at 8 beats.
1487 % \begin{macrocode}
1488 \newcommand*{\promenade}{%
1489 \moveindex{Promenade}
1490 \@ifstar\@promenadeStar\@promenadeNoStar%
1491 }
1492 \newcommand*{\@promenadeNoStar}[2][\unskip]{%
1493 \move[#2]{Promenade \ignorespaces#1\unskip}%
1494 }
1495 \newcommand*{\@promenadeStar}[2][%
1496 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1497 \move[#2]{\ignorespaces#1\unskip\ promenade}%
1498 }
1499 \newcommand*{\halfpromenade}{%
1500 \moveindex{Promenade}%
1501 \moveindex{Half Promenade}%
1502 \@ifstar\@halfpromenadeStar\@halfpromenadeNoStar%
1503 }
1504 \newcommand*{\@halfpromenadeNoStar}[1][\unskip]{%
1505 \move[8]{Half promenade \ignorespaces#1\unskip}%
1506 }
1507 \newcommand*{\@halfpromenadeStar}[1][%
1508 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1509 \move[8]{\ignorespaces#1\unskip\ half promenade}%
1510 }
1511 % \end{macrocode}
1512 % \end{macro}
1513 % \end{macro}
1514 % \end{macro}
1515 % \end{macro}
1516 %
1517 % \begin{macro}{\rightandleftthrough}
1518 % \changes{1.0.0}{2013/09/08}{Add move shortcut}
1519 % \begin{macro}{\rightandleftthrough*}
1520 % \changes{1.0.0}{2013/09/08}{Add move shortcut}
1521 % \begin{macro}{\rightsandlefts}
1522 % \changes{1.0.0}{2013/09/08}{Add move shortcut}
1523 % \begin{macro}{\rightsandlefts*}
1524 % \changes{1.0.0}{2013/09/08}{Add move shortcut}
1525 % Creates a right and left through (aka. rights and lefts). These always take up
1526 % 8 counts.
1527 % \begin{macrocode}
1528 \newcommand*{\rightandleftthrough}{%
1529 \moveindex{Right and left through}%
1530 \moveindex{Rights and lefts|seealso{Right and left through}}%
1531 \@ifstar\@rlStar\@rlNoStar%
1532 }
1533 \newcommand*{\rightsandlefts}{%
1534 \moveindex{Right and left through}%
1535 \moveindex{Rights and lefts|seealso{Right and left through}}%
1536 \@ifstar\@rlStar\@rlNoStar%
1537 }
1538 \newcommand*{\@rlNoStar}[1][\unskip]{%
1539 \move[8]{Right and left through \ignorespaces#1\unskip}%
1540 }
1541 \newcommand*{\@rlStar}[1][%
1542 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1543 \move[8]{\ignorespaces#1\unskip\ right and left through}%
1544 }
1545 % \end{macrocode}
1546 % \end{macro}
1547 % \end{macro}
1548 % \end{macro}
1549 % \end{macro}
1550 %
1551 % \begin{macro}{\rollaway}
1552 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
1553 % \changes{2.0.0}{2018/07/25}{Breaking change to allow complex notation}
1554 % \begin{macro}{\rollaway*}
1555 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
1556 % \changes{2.0.0}{2018/07/25}{Breaking change to allow complex notation}
1557 % \begin{macro}{\rollawaysashay}
1558 % \changes{2.0.0}{2018/07/25}{Renamed from ``\texttt{\textbackslash rollawayhalfsashay}''}
1559 % \begin{macro}{\rollawaysashay*}
1560 % \changes{2.0.0}{2018/07/25}{Renamed from ``\texttt{\textbackslash rollawayhalfsashay*}''}
1561 % ``Roll away" and ``roll away with a half sashay" may sound similar, but the
1562 % macros that produce them are a bit different. The \code{\textbackslash
1563 % rollaway} macro works exactly like most macros here: It takes a single
1564 % optional argument, and the star version rewords things a bit (it takes no
1565 % count argument since that's always 4 beats for this figure).
1566 % The \code{\textbackslash rollawaysashay} macro on the other hand, takes a
1567 % single optional argument unless you use the splat version in which case it
1568 % takes a single optional argument \emph{and} a required argument.
1569 % This allows you to reword things (just like the other commands) by leaving off
1570 % the optional argument, but also allows you to make more complicated roll aways
1571 % such as \code{\textbackslash rollawaysashay*{[the gents]}\{Ladies\}} which
1572 % would be typeset as: ``Ladies roll the gents away with a half sashay".
1573 % \begin{macrocode}
1574 \newcommand*{\rollaway}{%
1575 \moveindex{Roll away}%
1576 \@ifstar\@rollawayStar\@rollawayNoStar%
1577 }
1578 \newcommand*{\rollawaysashay}{%
1579 \moveindex{Roll Away}%
1580 \moveindex{Roll Away with a Half Sashay}%
1581 \moveindex{Half Sashay}%
1582 \@ifstar\@rawhsStar\@rawhsNoStar%
1583 }
1584 \newcommand*{\@rollawayNoStar}[1][\unskip]{%
1585 \move[4]{Roll \ignorespaces#1\unskip\ away}%
1586 }
1587 \newcommand*{\@rollawayStar}[3][\unskip]{%
1588 \move[4]{\ignorespaces#2\unskip\ roll \ignorespaces#3\unskip\ away \ignorespaces#1\unskip}%
1589 }
1590 \newcommand*{\@rawhsNoStar}[1][\unskip]{%
1591 \move[4]{Roll \ignorespaces#1\unskip\ away with a half sashay}%
1592 }
1593 \newcommand*{\@rawhsStar}[3][\unskip]{%
1594 \move[4]{\ignorespaces#2\unskip\ roll \ignorespaces#3\unskip\ away with a half sashay \ignorespaces#1\unskip}%
1595 }
1596 % \end{macrocode}
1597 % \end{macro}
1598 % \end{macro}
1599 % \end{macro}
1600 % \end{macro}
1601 %
1602 % \begin{macro}{\starleft}
1603 % \changes{1.0.0}{2013/09/09}{Add move shortcut}
1604 % \begin{macro}{\starleft*}
1605 % \changes{1.0.0}{2013/09/09}{Add move shortcut}
1606 % \begin{macro}{\starright}
1607 % \changes{1.0.0}{2013/09/09}{Add move shortcut}
1608 % \begin{macro}{\starright*}
1609 % \changes{1.0.0}{2013/09/09}{Add move shortcut}
1610 % Though `star left' and `star right' are really the same move (in different
1611 % directions), there are two separate macros since there aren't any other
1612 % directions you can star.
1613 % \begin{macrocode}
1614 \newcommand*{\starleft}{%
1615 \moveindex{Star}%
1616 \moveindex{Left hand star}%
1617 \def\cc@dir{Left}%
1618 \@ifstar\@starStar\@starNoStar%
1619 }
1620 \newcommand*{\starright}{%
1621 \moveindex{Star}%
1622 \moveindex{Right hand star}%
1623 \def\cc@dir{right}%
1624 \@ifstar\@starStar\@starNoStar%
1625 }
1626 \newcommand*{\@starNoStar}[1]{%
1627 \move[#1]{\cc@dir\ hand star}%
1628 }
1629 \newcommand*{\@starStar}[1]{%
1630 \move[#1]{Star \cc@dir}%
1631 }
1632 % \end{macrocode}
1633 % \end{macro}
1634 % \end{macro}
1635 % \end{macro}
1636 % \end{macro}
1637 %
1638 % \begin{macro}{\sashay}
1639 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
1640 % \begin{macro}{\sashay*}
1641 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
1642 % The sashay command, like \code{\textbackslash rollawaysashay} takes a
1643 % different number of arguments if you use the starred version.
1644 % The normal version takes an optional argument and the required count, while
1645 % the starred version takes the same optional argument, the required count, and
1646 % another required argument.
1647 % For instance, \code{\textbackslash sashay*{[down and back]}\{8\}\{Ladies\}}
1648 % would create the move: ``Ladies sashay down and back''.
1649 % \begin{macrocode}
1650 \newcommand*{\sashay}{%
1651 \moveindex{Sashay}%
1652 \@ifstar\@sashayStar\@sashayNoStar%
1653 }
1654 \newcommand*{\@sashayNoStar}[2][\unskip]{%
1655 \move[#2]{Sashay \ignorespaces#1\unskip}%
1656 }
1657 \newcommand*{\@sashayStar}[3][\unskip]{%
1658 \move[#2]{\ignorespaces#3\unskip\ sashay \ignorespaces#1\unskip}%
1659 }
1660 % \end{macrocode}
1661 % \end{macro}
1662 % \end{macro}
1663 %
1664 % \begin{macro}{\swing}
1665 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1666 % \begin{macro}{\swing*}
1667 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
1668 % Creates a basic swing. Probably the most common move in modern contra dance,
1669 % and also one of the simplest commands in this package.
1670 % \begin{macrocode}
1671 \newcommand*{\swing}{%
1672 \moveindex{Swing}%
1673 \@ifstar\@swingStar\@swingNoStar%
1674 }
1675 \newcommand*{\@swingNoStar}[2][\unskip]{%
1676 \move[#2]{Swing \ignorespaces#1\unskip}%
1677 }
1678 \newcommand*{\@swingStar}[2][%
1679 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1680 \move[#2]{\ignorespaces#1\unskip\ swing}%
1681 }
1682 % \end{macrocode}
1683 % \end{macro}
1684 % \end{macro}
1685 %
1686 % \begin{macro}{\turnalone}
1687 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
1688 % \begin{macro}{\turnalone*}
1689 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
1690 % \begin{macro}{\turncouple}
1691 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
1692 % \begin{macro}{\turncouple*}
1693 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
1694 % \begin{macro}{\turntogether}
1695 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
1696 % \begin{macro}{\turntogether*}
1697 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
1698 % ``Turn alone" and ``Turn as a couple" aren't exactly dance figures; just
1699 % directions that are often placed at the end of other figures. For this reason,
1700 % they all take up 0 logical counts of music and should be prepended to other
1701 % commands. The normal commands take an optional argument which can be used to
1702 % add some text after `alone' or `couple'. The starred version of each command
1703 % is exactly the same, except that it also has a required argument, a number of
1704 % counts (for those times when you want it to actually take up time in the music
1705 % and not just be part of another move).
1706 % \begin{macrocode}
1707 \newcommand*{\turnalone}{%
1708 \moveindex{Turn Alone}%
1709 \def\cc@who{alone}%
1710 \@ifstar\@turnStar\@turnNoStar%
1711 }
1712 \newcommand*{\turncouple}{%
1713 \moveindex{Turn as a Couple}%
1714 \moveindex{Turn Together|see{Turn as a Couple}}%
1715 \def\cc@who{as a couple}%
1716 \@ifstar\@turnStar\@turnNoStar%
1717 }
1718 \newcommand*{\turntogether}{%
1719 \moveindex{Turn as a Couple}%
1720 \moveindex{Turn Together|see{Turn as a Couple}}%
1721 \def\cc@who{together}%
1722 \@ifstar\@turnStar\@turnNoStar%
1723 }
1724 \newcommand*{\@turnNoStar}[1][\unskip]{%
1725 \cc@checkphrasestart%
1726 \move*[0]{Turn \cc@who\ \ignorespaces#1\unskip\ \ \ignorespaces}%
1727 }
1728 \newcommand*{\@turnStar}[2][\unskip]{%
1729 \move[#2]{Turn \cc@who\ \ignorespaces#1\unskip}%
1730 }
1731 % \end{macrocode}
1732 % \end{macro}
1733 % \end{macro}
1734 % \end{macro}
1735 % \end{macro}
1736 % \end{macro}
1737 % \end{macro}
1738 %
1739 % \begin{macro}{\twirltoswap}
1740 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1741 % \begin{macro}{\californiatwirl}
1742 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1743 % \begin{macro}{\starthrough}
1744 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1745 % \begin{macro}{\starthru}
1746 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1747 % \begin{macro}{\boxthegnat}
1748 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1749 % \begin{macro}{\swattheflea}
1750 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1751 % \begin{macro}{\jerseytwirl}
1752 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1753 % \begin{macro}{\arizonatwirl}
1754 % \changes{1.0.0}{2013/09/11}{Add move shortcut}
1755 % ``Twirl to Swap" is probably in the running for having the most variations of
1756 % any Contra dance move. A few of the more common ones are presented here. They
1757 % don't take any arguments, and there aren't any starred versions. Just simple,
1758 % 4 count moves.
1759 % \begin{macrocode}
1760 \newcommand*{\twirltoswap}{%
1761 \moveindex{Twirl to Swap}%
1762 \move[4]{Twirl to swap}%
1763 }
1764 \newcommand*{\californiatwirl}{%
1765 \moveindex{California Twirl}%
1766 \move[4]{California twirl}%
1767 }
1768 \newcommand*{\starthrough}{%
1769 \moveindex{Star Through}%
1770 \move[4]{Star through}%
1771 }
1772 \newcommand*{\starthru}{%
1773 \moveindex{Star Thru|see{Star Through}}%
1774 \moveindex{Star Through}%
1775 \move[4]{Star thru}%
1776 }
1777 \newcommand*{\boxthegnat}{%
1778 \moveindex{Box the Gnat}%
1779 \move[4]{Box the gnat}%
1780 }
1781 \newcommand*{\swattheflea}{%
1782 \moveindex{Swat the Flea}%
1783 \move[4]{Swat the flea}%
1784 }
1785 \newcommand*{\jerseytwirl}{%
1786 \moveindex{Jersey Twirl}%
1787 \move[4]{Jersey twirl}%
1788 }
1789 \newcommand*{\arizonatwirl}{%
1790 \moveindex{Arizona Twirl}%
1791 \move[4]{Arizona twirl}%
1792 }
1793 % \end{macrocode}
1794 % \end{macro}
1795 % \end{macro}
1796 % \end{macro}
1797 % \end{macro}
1798 % \end{macro}
1799 % \end{macro}
1800 % \end{macro}
1801 % \end{macro}
1802 %
1803 % \begin{macro}{\downthehall}
1804 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1805 % \begin{macro}{\downthehall*}
1806 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1807 % \begin{macro}{\upthehall}
1808 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1809 % \begin{macro}{\upthehall*}
1810 % \changes{1.0.0}{2013/09/12}{Add move shortcut}
1811 % Up and down the hall are often counted as a single move (sometimes with a
1812 % `turn alone' or similar in between). You may want to use the
1813 % \code{\textbackslash move} command to define your own versions of these
1814 % commands, but just in case some shortcuts are provided anyways.
1815 % \begin{macrocode}
1816 \newcommand*{\downthehall}{%
1817 \moveindex{Down the Hall}%
1818 \def\cc@dir{down}%
1819 \@ifstar\@walkthehallStar\@walkthehallNoStar%
1820 }
1821 \newcommand*{\upthehall}{%
1822 \moveindex{Up the Hall}%
1823 \def\cc@dir{up}%
1824 \@ifstar\@walkthehallStar\@walkthehallNoStar%
1825 }
1826 \newcommand*{\@walkthehallNoStar}[2][\unskip]{%
1827 \move[#2]{\expandafter\MakeUppercase\cc@dir\ the hall\ \ignorespaces#1\unskip}%
1828 }
1829 \newcommand*{\@walkthehallStar}[2][%
1830 \expandafter\expandafter\expandafter\MakeUppercase\@gobbletwo]{%
1831 \move[#2]{\ignorespaces#1\unskip\ \cc@dir\ the hall}%
1832 }
1833 % \end{macrocode}
1834 % \end{macro}
1835 % \end{macro}
1836 % \end{macro}
1837 % \end{macro}
1838 %
1839 % \section{Dance information}
1840 %
1841 % \begin{macro}{\dancetitle}
1842 % \changes{1.0.0}{2013/09/11}{New macro}
1843 % \begin{macro}{\danceauthor}
1844 % \changes{1.0.0}{2013/09/11}{New macro}
1845 % \begin{macro}{\danceform}
1846 % \changes{1.0.0}{2013/09/11}{New macro}
1847 % These macros give information about the current (or previous, if you're not in
1848 % a dance environment) dance. They can be used for things like adding the dance
1849 % name and number to the header in a book, referencing the dance author in
1850 % footnotes, etc.
1851 % \begin{macrocode}
1852 \newcommand*{\dancetitle}{}
1853 \newcommand*{\danceauthor}{}
1854 \newcommand*{\danceform}{}
1855 % \end{macrocode}
1856 % \end{macro}
1857 % \end{macro}
1858 % \end{macro}
1859 %
1860 % \section{Lists and Indices}
1861 %
1862 % \subsection{Lists}
1863 %
1864 % Just as many classes allow you to build a table of contents, or a list of
1865 % figures, \pkg{contracard} allows you to create a list of dances.
1866 %
1867 % \begin{macro}{\listofdances}
1868 % The list of dances is created by a call to \code{\textbackslash listofdance}
1869 % by default, however, we define an alias: \code{\textbackslash listofdances}
1870 % to prevent confusion.
1871 % \begin{macrocode}
1872 \newlistof{dance}{lod}{\cfttoctitlefont\lodtitle}
1873 \newcommand*{\listofdances}{\listofdance}
1874 % \end{macrocode}
1875 % \end{macro}
1876 %
1877 % \begin{macro}{\lodtitle}
1878 % The title of the list of dances will be:
1879 % \begin{macrocode}
1880 \newcommand*{\lodtitle}{List of Dances}
1881 % \end{macrocode}
1882 % \end{macro}
1883 %
1884 % An \hyperlink{CC:LOD}{example list of dances} can be found at the beginning of
1885 % this document.
1886 %
1887 % \subsection{Indices}
1888 % \changes{1.0.0}{2013/09/08}{Added support for indices}
1889 %
1890 % \pkg{Contra Card} has the ability to produce several different indices that
1891 % might be useful for your book or collection of dances. They are:
1892 %
1893 % \begin{center}
1894 % \begin{tabular}{ l l }
1895 % Shortcut & Name \\
1896 % \hline
1897 % dbt & \hyperlink{CC:DBT}{Dances by Type} \\
1898 % dba & \hyperlink{CC:DBA}{Dances by Author} \\
1899 % mvp & \hyperlink{CC:MVP}{Moves by Page} \\
1900 % mvd & \hyperlink{CC:MVD}{Moves by Dance} \\
1901 % \end{tabular}
1902 % \end{center}
1903 %
1904 % An example of each type of index can be found at the end of this document.
1905 %
1906 % \begin{macro}{\enableidx}
1907 % \changes{1.0.0}{2013/09/08}{New command}
1908 % Indexing is not turned on by default in Contra Card. When you enable it, the
1909 % \href{http://ctan.org/pkg/imakeidx}{\pkg{imakeidx}} package is loaded, and the
1910 % indices are created. This means that \code{\textbackslash enableidx} should
1911 % \emph{only} be called in the preamble.
1912 % \begin{macrocode}
1913 \newcommand*{\enableidx}{%
1914 \PassOptionsToPackage{splitindex}{imakeidx}
1915 \RequirePackage{imakeidx}
1916 \cc@createindices
1917 }%
1918 \newcommand*{\cc@createindices}{%
1919 \makeindex[name=\cc@dbt,title=\dbtname]
1920 \makeindex[name=\cc@dba,title=\dbaname]
1921 \makeindex[name=\cc@mvp,title=\mvpname]
1922 \makeindex[name=\cc@mvd,title=\mvdname]
1923 }%
1924 % \end{macrocode}
1925 % Because we use the \code{splitindex} option, you'll need to run the
1926 % \fname{splitindex} command against the index file. For instance, if your
1927 % project is called \fname{root.tex} you'll want to run:
1928 %
1929 % \begin{quote}
1930 % \code{\$ splitindex root}
1931 % \end{quote}
1932 % \end{macro}
1933 %
1934 % \begin{macro}{\pauseindexing}
1935 % \changes{1.0.0}{2013/09/10}{New command}
1936 % \begin{macro}{\resumeindexing}
1937 % \changes{1.0.0}{2013/09/10}{New command}
1938 % On occasion you might have a dance that you don't want to include in the index
1939 % for some reason. When this happens, you can temporarily disable indexing (and
1940 % later enable it again).
1941 % \begin{macrocode}
1942 \newcommand*{\pauseindexing}{\def\cc@indexingpaused{}}
1943 \newcommand*{\resumeindexing}{\let\cc@indexingpaused\undefined}
1944 % \end{macrocode}
1945 % \end{macro}
1946 % \end{macro}
1947 %
1948 % \begin{macro}{\cc@dbt}
1949 % \changes{1.0.0}{2013/09/08}{New command}
1950 % \begin{macro}{\cc@dba}
1951 % \changes{1.0.0}{2013/09/08}{New command}
1952 % \begin{macro}{\cc@mvp}
1953 % \changes{1.0.0}{2013/09/08}{New command}
1954 % \begin{macro}{\cc@mvd}
1955 % \changes{1.0.0}{2013/09/08}{New command}
1956 % Though you probably don't need to change this, the shortcut for each index can
1957 % be changed by redefining the following commands (before you turn on indexing
1958 % functionality):
1959 % \begin{macrocode}
1960 \newcommand*{\cc@dbt}{dbt}
1961 \newcommand*{\cc@dba}{dba}
1962 \newcommand*{\cc@mvp}{mvp}
1963 \newcommand*{\cc@mvd}{mvd}
1964 % \end{macrocode}
1965 % \end{macro}
1966 % \end{macro}
1967 % \end{macro}
1968 % \end{macro}
1969 %
1970 % \begin{macro}{\dbtname}
1971 % \changes{1.0.0}{2013/09/08}{New command}
1972 % \begin{macro}{\dbaname}
1973 % \changes{1.0.0}{2013/09/08}{New command}
1974 % \begin{macro}{\mvpname}
1975 % \changes{1.0.0}{2013/09/08}{New command}
1976 % \begin{macro}{\mvdname}
1977 % \changes{1.0.0}{2013/09/08}{New command}
1978 % The names of each index can also be changed by redefining these commands. This
1979 % should also be done \emph{before} the indexing functionality is turned on.
1980 % This means that if you're loading \pkg{Contra Card} with the \code{enableidx}
1981 % package option, you shouldn't mess with these commands.
1982 % \begin{macrocode}
1983 \newcommand*{\dbtname}{Dances by Type}
1984 \newcommand*{\dbaname}{Dances by Author}
1985 \newcommand*{\mvpname}{Moves by Page}
1986 \newcommand*{\mvdname}{Moves by Dance}
1987 % \end{macrocode}
1988 % \end{macro}
1989 % \end{macro}
1990 % \end{macro}
1991 % \end{macro}
1992 %
1993 % \begin{macro}{\moveindex}
1994 % \changes{1.0.0}{2013/09/08}{New command}
1995 % \begin{macro}{\moveindex*}
1996 % \changes{1.0.0}{2013/09/08}{New command}
1997 % For any of the move shortcut macros, index entries are automatically added for
1998 % the given move. However, for moves that you define yourself with the
1999 % \code{\textbackslash move} command, you'll need to add index entries manually.
2000 % This can be done with \code{\textbackslash moveindex}. This macro takes a
2001 % single argument (the index entry to add) and should only be called from within
2002 % the \code{contra} environment. The star version of the command also typesets
2003 % the first argument (so you don't have to write it twice).
2004 % \begin{macrocode}
2005 \newcommand*{\moveindex}{\@ifstar\moveindexStar\moveindexNoStar}
2006 \newcommand*{\moveindexStar}[1]{%
2007 #1%
2008 \ifthenelse{\isundefined{\cc@indexingpaused}}{%
2009 \ifthenelse{\isundefined{\imki@wrindexentry}}{%
2010 \index{#1}%
2011 }{%
2012 \index[mvp]{#1}%
2013 \imki@wrindexentry{mvd}{#1}{\arabic{dance}}%
2014 }%
2015 }{}%
2016 }
2017 \newcommand*{\moveindexNoStar}[1]{%
2018 \ifthenelse{\isundefined{\cc@indexingpaused}}{%
2019 \ifthenelse{\isundefined{\imki@wrindexentry}}{%
2020 \index{#1}%
2021 }{%
2022 \index[mvp]{#1}%
2023 \imki@wrindexentry{mvd}{#1}{\arabic{dance}}%
2024 }%
2025 }{}%
2026 }
2027 % \end{macrocode}
2028 % \end{macro}
2029 % \end{macro}
2030 %
2031 % \section{Helper macros}
2032 %
2033 % The following macros are used by the \pkg{contracard} package to perform
2034 % various tasks. Those that may also be of use to the contra dance writer have
2035 % been left unhidden.
2036 %
2037 % \begin{macro}{\timesaround}
2038 % \changes{1.0.0}{2013/09/05}{Split out ability to calculate times around}
2039 % Sometimes it's useful to calculate the approximate number of times a given
2040 % move can be done in a certain number of beats of music (eg.~the number of
2041 % times around one can allemande in 6 beats). For this, the \code{\textbackslash
2042 % timesaround} macro was created. It takes two arguments: the number of beats it
2043 % takes to go one time around (eg.~4 for an allemande) and the total number of
2044 % beats you have to work with. It spits out an integer, a fraction, or a mixed
2045 % number and a word matching the regular expression:
2046 % \regexp{/{[}1-9{]}*{[}\textonequarter\textonehalf%
2047 % \textthreequarters{]}?(\textbackslash\ times?)?/}.
2048
2049 %
2050 % For example: \code{\textbackslash timesaround\{4\}\{6\}} produces:
2051 % ``\timesaround{4}{6}".
2052 % \begin{macrocode}
2053 \newcounter{timesaround}
2054 \newcounter{quartertimesaround}
2055 \newcommand*{\timesaround}[2]{%
2056 \setcounter{timesaround}{\intcalcDiv{\intcalcNum{#2}}{\intcalcNum{#1}}}%
2057 \setcounter{quartertimesaround}{%
2058 \intcalcMod{\intcalcNum{#2}}{\intcalcNum{#1}}%
2059 }%
2060 \ifthenelse{\value{timesaround}>0}{\arabic{timesaround}}{}%
2061 \ifthenelse{\value{quartertimesaround}=1}{\textonequarter}{%
2062 \ifthenelse{\value{quartertimesaround}=2}{\textonehalf}{%
2063 \ifthenelse{\value{quartertimesaround}=3}{\textthreequarters}{}%
2064 }%
2065 }%
2066 \ifthenelse{%
2067 \value{timesaround}>1\OR%
2068 \(\value{timesaround}=1\AND\NOT\value{quartertimesaround}=0\)%
2069 }{\ times}{%
2070 \ifthenelse{\value{timesaround}=1}{\ time}{}%
2071 }%
2072 }%
2073 % \end{macrocode}
2074 % \end{macro}
2075 %
2076 % \begin{macro}{\notes}
2077 % \changes{1.0.0}{2013/09/10}{Make adding notes easier}
2078 % This macro can be used to insert some nicely formatted notes at the end of
2079 % your calling cards. Just use it in the \code{contra} environment right after
2080 % your last move.
2081 % \begin{macrocode}
2082 \newcommand*{\notes}[2][\cc@defaultnotesenv]{%
2083 \par\nopagebreak\vspace*{\prenotevspace}
2084 \begin{\cc@defaultnotesenv}
2085 \setlength{\baselineskip}{1.1em plus 0.1em minus 0.2em}
2086 \def\cc@notestitle{\textbf{\ignorespaces Notes\unskip}}%
2087 \setlength{\parindent}{0pt}%
2088 \setlength{\cc@partsepwidth}{\widthof{\footnotesize \cc@notestitle~}}%
2089 \setlength{\hangindent}{\cc@partsepwidth}%
2090 {\footnotesize \cc@notestitle~\ignorespaces#2\unskip}%
2091 \end{\cc@defaultnotesenv}
2092 }
2093 % \end{macrocode}
2094 % \end{macro}
2095 %
2096 % \begin{macro}{\spelldosido}
2097 % \changes{1.0.0}{2013/09/12}{Change how Do-si-do is spelled easily}
2098 % \begin{macro}{\spellDosido}
2099 % \changes{1.0.0}{2013/09/12}{Change how Do-si-do is spelled easily}
2100 % \begin{macro}{\setdosidospelling}
2101 % \changes{1.0.0}{2013/09/12}{Change how Do-si-do is spelled easily}
2102 % These macros can be used for easily changing the spelling of `Do-si-do'
2103 % anywhere a \code{\textbackslash dosido} command is found (and in the index).
2104 % By default, we spell it the contra dance way (`Do-si-do'), however, this can
2105 % easily be changed. For example, running \code{\textbackslash
2106 % setdosidospelling\{dos-\textbackslash \`{}a-dos\}} will cause
2107 % \code{\textbackslash spellDosido} to render: `Dos-\`a-dos' and
2108 % \code{\textbackslash spelldosido} to render: `dos-\`a-dos'.
2109 % \begin{macrocode}
2110 \def\spelldosido{do-si-do}
2111 \def\spellDosido{Do-si-do}
2112 \newcommand*{\setdosidospelling}[1]{%
2113 \protected@edef\spelldosido{\expandafter\MakeLowercase#1}
2114 \protected@edef\spellDosido{\expandafter\MakeUppercase#1}
2115 }
2116 % \end{macrocode}
2117 % \end{macro}
2118 % \end{macro}
2119 % \end{macro}
2120 %
2121 % \begin{macro}{\cc@checkphrasestart}
2122 % This macro is used by various parts of contra card to reset the dance phrase
2123 % and part at the appropriate time. You should probably just move on and leave
2124 % it alone.
2125 % \begin{macrocode}
2126 \newcommand*{\cc@checkphrasestart}{%
2127 \ifthenelse{\value{phrasecount}=\value{dancephraselength}}{%
2128 \newdancephrase%
2129 }{%
2130 \ifthenelse{\(\value{partcount}=\value{dancepartlength}\)}{%
2131 \newdancepart%
2132 }{}%
2133 }%
2134 }
2135 % \end{macrocode}
2136 % \end{macro}
2137 %
2138 % \begin{macrocode}
2139 \ProcessOptions\relax
2140 %</contracard-pkg>
2141 % \end{macrocode}
2142 %
2143 % \clearpage
2144 % \phantomsection
2145 % \part{The \pkg{contracard} class}
2146 %
2147 % \begin{macrocode}
2148 %<*contracard-cls>
2149 % \end{macrocode}
2150 %
2151 % The Contra Card project also provides a class (\fname{contracard.cls}) which
2152 % acts as a convenience wrapper around the core functionality provided by the
2153 % package. This is useful for generating calling cards, and saves you the
2154 % trouble of looking up standard card sizes and figuring out margins and where
2155 % to put headings and the like.
2156 %
2157 % \phantomsection
2158 % \hypertarget{CCCLASS:OPTIONS}{}
2159 % \subsection{Options}
2160 %
2161 % \begin{macro}{small}
2162 % \begin{macro}{medium}
2163 % \begin{macro}{large}
2164 % \begin{macro}{a7paper}
2165 % \begin{macro}{draft}
2166 % \changes{1.0.0}{2013/09/11}{Pass option through to \code{article} class}
2167 % The class can be loaded with any of the following options. The various size
2168 % options are summarized in the table below. Any unrecognized options are passed
2169 % to the \pkg{contracard} package.
2170 %
2171 % \begin{center}
2172 % \begin{tabular}{ l l l }
2173 % Option & Size (mm) & Size (in) \\
2174 % \hline
2175 % \code{small} & 127.0 $\times$ 76.2 & 5.0 $\times$ 3.0 \\
2176 % \code{medium} & 152.4 $\times$ 101.6 & 6.0 $\times$ 4.0 \\
2177 % \code{large} & 203.2 $\times$ 27.0 & 8.0 $\times$ 5.0 \\
2178 % \code{a7paper} & 105.0 $\times$ 74.0 & 4.1 $\times$ 2.9 \\
2179 % \end{tabular}
2180 % \end{center}
2181 % \begin{macrocode}
2182 \AtBeginDocument{\large}
2183 \PassOptionsToPackage{%
2184 margin=0.5in,top=0.75in,paperwidth=6in,paperheight=4in%
2185 }{geometry}%
2186 \DeclareOption{small}{%
2187 \AtBeginDocument{%
2188 \titleformat{\section}{\normalsize\bfseries}{\thesection}{1em}{}%
2189 \titleformat{\subsection}{\normalsize}{\thesection}{1em}{}%
2190 }
2191 \PassOptionsToPackage{%
2192 margin=0.25in,top=0.75in,paperwidth=5in,paperheight=3in%
2193 }{geometry}%
2194 }
2195 \DeclareOption{medium}{%
2196 \AtBeginDocument{\large}
2197 \PassOptionsToPackage{%
2198 margin=0.5in,top=0.75in,paperwidth=6in,paperheight=4in%
2199 }{geometry}%
2200 }
2201 \DeclareOption{large}{%
2202 \AtBeginDocument{\Large}
2203 \PassOptionsToPackage{%
2204 margin=0.75in,top=1in,paperwidth=8in,paperheight=5in%
2205 }{geometry}%
2206 }
2207 \DeclareOption{a7paper}{%
2208 \AtBeginDocument{%
2209 \titleformat{\section}{\normalsize\bfseries}{\thesection}{1em}{}%
2210 \titleformat{\subsection}{\normalsize}{\thesection}{1em}{}%
2211 }
2212 \PassOptionsToPackage{%
2213 margin=5mm,top=15mm,paperwidth=105mm,paperheight=74mm%
2214 }{geometry}%
2215 }
2216 \DeclareOption{draft}{%
2217 \PassOptionsToClass{draft}{article}%
2218 }
2219 \DeclareOption*{%
2220 \PassOptionsToPackage{\CurrentOption}{contracard}%
2221 }
2222 % \end{macrocode}
2223 % \end{macro}
2224 % \end{macro}
2225 % \end{macro}
2226 % \end{macro}
2227 % \end{macro}
2228 %
2229 % \subsection{Environment setup}
2230 %
2231 % The \pkg{contracard} class does a little extra work to turn off headers, and
2232 % prevent page numbering:
2233 %
2234 % \begin{macrocode}
2235 \AtBeginDocument{\pagestyle{empty}}
2236 \AtBeginDocument{\pagenumbering{gobble}}
2237 % \end{macrocode}
2238 % It also defines a command \code{\textbackslash @ccisclass} to let the
2239 % \pkg{contracard} package know that it was called via the class:
2240 % \begin{macrocode}
2241 \newcommand*{\@ccisclass}{}
2242 \ProcessOptions\relax
2243 %</contracard-cls>
2244 % \end{macrocode}
2245 %
2246 % \cleardoublepage
2247 % \begin{appendices}
2248 % \section{On Notation}
2249 % \label{appendix:notation}
2250 %
2251 % \begin{macro}{\gypsy}
2252 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
2253 % \begin{macro}{\gypsy*}
2254 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
2255 % \begin{macro}{\gypsyleft}
2256 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
2257 % \begin{macro}{\gypsyleft*}
2258 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
2259 % \begin{macro}{\gypsyright}
2260 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
2261 % \begin{macro}{\gypsyright*}
2262 % \changes{1.0.0}{2013/09/06}{Add move shortcut}
2263 % In some circles (pun intended) the move ``walk around" or ``right/left
2264 % shoulder round" (also ``spiral", ``gyre", ``eyes", etc.) is called a ``gypsy".
2265 % This is considered an ethnic slur by some groups of the Romani people.
2266 % While the contra term is not likely to have been derived from the slur, I see
2267 % no reason not to use an alternative.
2268 % In version 2 of this document---and in calling cards generated with this
2269 % package---I have chosen to use the term ``walk around" when no direction needs
2270 % to be specified, or ``right/left shoulder round" when it does.
2271 % This avoids creating an uncomfortable situation for a dancer hearing a word
2272 % that to them may be associated with hostility, and a lifetime of persecution.
2273 % It seems to me that providing a safe and welcoming dance environment is worth
2274 % the trivial inconvenience of having to learn a new move name.
2275 %
2276 % The commands listed in the margin have been renamed, for their alternatives
2277 % see \texttt{\textbackslash walkaround} and its variants.
2278 % \end{macro}
2279 % \end{macro}
2280 % \end{macro}
2281 % \end{macro}
2282 % \end{macro}
2283 % \end{macro}
2284 %
2285 % \section{Deprecated macros}
2286 % \label{appendix:deprecated}
2287 %
2288 % \begin{macro}{\longpetronella}
2289 % \changes{1.0.0}{2013/09/08}{Add move shortcut}
2290 % \changes{2.0.0}{2018/07/25}{Remove move}
2291 % \begin{macro}{\longpetronella*}
2292 % \changes{1.0.0}{2013/09/08}{Add move shortcut}
2293 % \changes{2.0.0}{2018/07/25}{Remove move}
2294 % \begin{macro}{\longpetronellanella}
2295 % \changes{1.1.0}{2018/07/21}{Add nella-nella petronella variants}
2296 % \changes{2.0.0}{2019/02/24}{Remove move}
2297 % \begin{macro}{\rollawayhalfsashay}
2298 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
2299 % \changes{2.0.0}{2018/07/25}{Renamed to ``\texttt{\textbackslash rollawaysashay}''}
2300 % \begin{macro}{\rollawayhalfsashay*}
2301 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
2302 % \changes{2.0.0}{2018/07/25}{Renamed to ``\texttt{\textbackslash rollawaysashay*}''}
2303 % \begin{macro}{\rawhs}
2304 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
2305 % \changes{2.0.0}{2018/07/25}{Remove move}
2306 % \begin{macro}{\rawhs*}
2307 % \changes{1.0.0}{2013/09/10}{Add move shortcut}
2308 % \changes{2.0.0}{2018/07/25}{Remove move}
2309 % These macros (as well as the ones mentioned in appendix
2310 % \ref{appendix:notation}) have been removed from the package, resulting in a
2311 % major version bump.
2312 % If you were using any of these macros in your documents, you may wish to
2313 % continue using an older version of this package or update your documents
2314 % before upgrading.
2315 % For information about what version each macro was removed in see the change
2316 % log.
2317 % \end{macro}
2318 % \end{macro}
2319 % \end{macro}
2320 % \end{macro}
2321 % \end{macro}
2322 % \end{macro}
2323 % \end{macro}
2324 %
2325 % \section{Upgrading from 1.x}
2326 %
2327 % Aside from removing deprecated macros, (see appendix
2328 % \ref{appendix:deprecated}), you will also want to search your dances for the
2329 % text \code{\textbackslash balanceand} and decrement the following move by 4
2330 % counts.
2331 % Previously, the \code{\textbackslash balanceand} macros took up 0 logical
2332 % counts of music, but in version 2.0 it adds 4 counts to the next move.
2333 % Several new move shortcuts were also added in version 2.0 of this package
2334 % which may be able to replace uses of the generic \code{\textbackslash move}
2335 % macro in your dances.
2336 % For a full list, see the change history at the end of this document.
2337 %
2338 % \end{appendices}
2339 %
2340 % \bookmarksetup{startatroot}
2341 % \addtocontents{toc}{\bigskip}
2342 % \clearpage
2343 % \setcounter{IndexColumns}{2}
2344 % \phantomsection
2345 % \addcontentsline{toc}{section}{Index}
2346 % \PrintIndex
2347 % \clearpage
2348 % \phantomsection
2349 % \addcontentsline{toc}{section}{\dbtname}
2350 % \hypertarget{CC:DBT}{}
2351 % \printindex[\cc@dbt]
2352 % \clearpage
2353 % \phantomsection
2354 % \addcontentsline{toc}{section}{\dbaname}
2355 % \hypertarget{CC:DBA}{}
2356 % \printindex[\cc@dba]
2357 % \clearpage
2358 % \phantomsection
2359 % \addcontentsline{toc}{section}{\mvpname}
2360 % \hypertarget{CC:MVP}{}
2361 % \printindex[\cc@mvp]
2362 % \clearpage
2363 % \phantomsection
2364 % \addcontentsline{toc}{section}{\mvdname}
2365 % \hypertarget{CC:MVD}{}
2366 % \printindex[\cc@mvd]
2367 %
2368 % \makeatletter
2369 % \renewenvironment{theglossary}{%
2370 % \glossary@prologue
2371 % \setlength\emergencystretch{5em}
2372 % \GlossaryParms \let\item\@idxitem \ignorespaces}{}
2373 % \makeatother
2374 % \clearpage
2375 % \phantomsection
2376 % \addcontentsline{toc}{section}{Change History}
2377 % \PrintChanges
2378 % \Finale
2379 %
2380 % \iffalse
2381 %\fi
2382 \endinput