summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-02-18 23:56:20 +0000
committerKarl Berry <karl@freefriends.org>2013-02-18 23:56:20 +0000
commite43ae240f33296136cb498e6d9d0e9a55eba7493 (patch)
treed27190d27658569c1f62e632c1f30e96fa07de58 /Master/texmf-dist/source
parentcdbdc383307e5585391076143f1a790aeacc220f (diff)
contracard (18feb13)
git-svn-id: svn://tug.org/texlive/trunk@29156 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/contracard/contracard.dtx56
1 files changed, 38 insertions, 18 deletions
diff --git a/Master/texmf-dist/source/latex/contracard/contracard.dtx b/Master/texmf-dist/source/latex/contracard/contracard.dtx
index aa0fb35c2a8..2c5088ec48e 100644
--- a/Master/texmf-dist/source/latex/contracard/contracard.dtx
+++ b/Master/texmf-dist/source/latex/contracard/contracard.dtx
@@ -55,8 +55,8 @@
%</driver>
%
%<*contracard>
-\NeedsTeXFormat{LaTeX2e}[1994/06/01]
-\ProvidesClass{contracard}[2013/02/07]
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+\ProvidesClass{contracard}[2013/02/17]
\AtEndOfClass{\LoadClass{article}}
%</contracard>%
%
@@ -131,7 +131,7 @@
\AtEndOfClass{\RequirePackage{hyperref}}
\AtEndOfClass{\RequirePackage{ifthen}}
\AtEndOfClass{\RequirePackage{geometry}}
-\AtEndOfClass{\usepackage{fancyhdr}}
+\AtEndOfClass{\RequirePackage{fancyhdr}}
\AtEndOfClass{\RequirePackage[compact]{titlesec}}
% \end{macrocode}
% Once you have all the required packages, building \pkg{contracard} from source
@@ -207,10 +207,31 @@
% \end{macrocode}
%
% \begin{macro}{dancecount}
-% Next, we'll create the \code{dancecount} counter that will help us keep track
-% of timing in the dance:
+% \begin{macro}{partcount}
+% \changes{0.2}{2013/02/15}{Create a counter for the current musical part}
+% \begin{macro}{phrasecount}
+% \changes{0.2}{2013/02/15}{Create a counter for the current musical phrase}
+% Next, we'll create some counters that will help us keep track the counts (or
+% `steps') in the dance. The \code{dancecount} is reset at the start of each new
+% dance, the \code{partcount} is reset at the begining of each part (eg. \code{%
+% A1} or \code{B1}), and the \code{phrasecount} is reset every time the part
+% changes (eg. from \code{A} to \code{B}).
% \begin{macrocode}
\newcounter{dancecount}
+\newcounter{partcount}
+\newcounter{phrasecount}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\progressed}
+% \changes{0.2}{2013/02/15}{Allow the user to reset the phrase}
+% The phrase will continue to increment (\code{A}, \code{B}, \code{C}) unless
+% the user resets it by calling \code{\textbackslash progressed}. This does not
+% strictly indicate progression, but it will be intuitive for most callers.
+% \begin{macrocode}
+\newcommand*{\progressed}{\setcounter{phrasecount}{1}}
% \end{macrocode}
% \end{macro}
%
@@ -238,11 +259,13 @@
% \begin{macro}{contra}
% \changes{0.1}{2013/02/14}{Create contra environment}
% The contra environment is pretty simple. It clears the page, resets the
-% \code{dancecount} and displays some information about the dance.
+% various counters, and displays some information about the dance.
% \begin{macrocode}
\newenvironment{contra}[4][\defaultcontraenv]{%
\clearpage
\setcounter{dancecount}{0}
+ \setcounter{partcount}{1}
+ \setcounter{phrasecount}{1}
\thispagestyle{fancy}
\rhead{#4}
\section*{#2}
@@ -260,26 +283,23 @@
% \begin{macro}{\move}
% \changes{0.1}{2013/02/14}{Add move command}
% The next thing we need to define is the \code{\textbackslash move} command.
-% This command takes in a move to display, and (optionally) the number of beats
-% the move takes. If no beats are specified, it is assumed it takes up a full
-% 16.
+% This command takes in a move to display, and (optionally) the number of counts
+% the move takes. If the count is not specified, 16 is used as the default.
% \begin{macrocode}
\newcommand*{\move}[2][16]{%
- \ifthenelse{\intcalcMod{\value{dancecount}}{64}=0}{A1.\ }{%
- \ifthenelse{\intcalcMod{\value{dancecount}-16}{64}=0}{A2.\ }{%
- \ifthenelse{\intcalcMod{\value{dancecount}-32}{64}=0}{B1.\ }{%
- \ifthenelse{\intcalcMod{\value{dancecount}-48}{64}=0}{B2.\ }{}%
- }%
- }%
- }%
+ \ifthenelse{\intcalcMod{\value{dancecount}}{16}=0}{%
+ \Alph{phrasecount}\arabic{partcount}.\ %
+ }{}%
\addtocounter{dancecount}{#1}%
#2%
\ifthenelse{\intcalcMod{\value{dancecount}}{8}=0
\and\not\intcalcMod{\value{dancecount}}{16}=0}{;}{\nopagebreak}%
\ifthenelse{\not\intcalcMod{\value{dancecount}}{8}=0}{,}{\nopagebreak}%
\ifthenelse{\intcalcMod{\value{dancecount}}{32}=0}{%
- \pagebreak[1]\vspace{1em}}{}%
- \ifthenelse{\intcalcMod{\value{dancecount}}{16}=0}{\newline}{}%
+ \addtocounter{phrasecount}{1}\setcounter{partcount}{0}\pagebreak[1]%
+ \vspace{1em}}{}%
+ \ifthenelse{\intcalcMod{\value{dancecount}}{16}=0}{%
+ \addtocounter{partcount}{1}\newline}{}%
}
% \end{macrocode}
% \end{macro}