diff options
author | Karl Berry <karl@freefriends.org> | 2013-02-15 23:59:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-02-15 23:59:27 +0000 |
commit | 0ccccba206b1401b7478dd9629fb2386887c5ec6 (patch) | |
tree | 479077b3eb475fb288267121523ec447e2a917d7 /Master/texmf-dist/source | |
parent | aeb928a24790407db5779d28c62f6c514619cdaa (diff) |
contracard (15feb13)
git-svn-id: svn://tug.org/texlive/trunk@29130 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/contracard/contracard.dtx | 373 |
1 files changed, 373 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/contracard/contracard.dtx b/Master/texmf-dist/source/latex/contracard/contracard.dtx new file mode 100644 index 00000000000..aa0fb35c2a8 --- /dev/null +++ b/Master/texmf-dist/source/latex/contracard/contracard.dtx @@ -0,0 +1,373 @@ +% \iffalse +%<*internal> +\begingroup +\input docstrip.tex +\keepsilent +\usedir{tex/latex/contracard} +\preamble + + Copyright 2012 Samuel Whited + + This file may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either + version 1.3c of this license or (at your option) any later + version. The latest version of this license is in: + + http://www.latex-project.org/lppl.txt + + and version 1.3c or later is part of all distributions of + LaTeX version 2008/05/04 or later. + +\endpreamble +\postamble + + ___________ + Maintainer: Sam Whited + Website: https://samwhited.com + Contact: sam@samwhited.com + Public key: 0xEC2C9934 + + This work consists of this file contracard.dtx + and the derived files contracard.cls + and contracard.pdf + +\endpostamble +\askforoverwritefalse + +\generate{\file{contracard.cls}{\from{contracard.dtx}{contracard}}} +\generate{\file{contracard-style.sty}{\from{contracard.dtx}{doc-style}}} + +\obeyspaces +\Msg{****************************************************} +\Msg{* *} +\Msg{* To finish the installation you have to move the *} +\Msg{* following file into a directory searched by TeX: *} +\Msg{* *} +\Msg{* contracard.cls *} +\Msg{* *} +\Msg{****************************************************} + +\endgroup +%</internal> +% +%<*driver> +\ProvidesFile{contracard.dtx} +%</driver> +% +%<*contracard> +\NeedsTeXFormat{LaTeX2e}[1994/06/01] +\ProvidesClass{contracard}[2013/02/07] +\AtEndOfClass{\LoadClass{article}} +%</contracard>% +% +%<*driver> +\documentclass[a4paper]{ltxdoc} +\usepackage{contracard-style} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +%</driver> +% +% \fi +% +% \GetFileInfo{contracard.dtx} +% \makeatletter +% \errorcontextlines=999 +% +% \title{The \textsf{contracard} class} +% \author{ +% \name{Sam Whited}\\ +% \texttt{sam@samwhited.com} +% } +% \date{\today\\\gittag} +% +% \maketitle +% \tableofcontents +% +% \section{Introduction} +% +% The \pkg{contracard} class is designed to aid in the formatting and +% typesetting of caller cards for traditional square and line dances. +% +% \subsection{Rationale} +% +% There is little to no purpose for this class. I was tired of seeing caller +% cards that were written in difficult to read shorthand, or, when they were +% presented in a digital format, using some ugly 90s-looking HTML or MS Word +% template. This is my attempt to make calling cards more beautiful. +% +% \subsection{License / about the source} +% +% This project may be distributed and/or modified under the conditions of the +% \LaTeX\ Project Public License, either version 1.3c of this license or (at +% your opinion) any later version. The latest version of this license is in: +% +% \url{http://www.latex-project.org/lppl.txt} +% +% and version 1.3c or later is part of all distributions of \LaTeX\ version +% 2008/05/04 or later. +% +% Contributions are welcome, and the latest development version of the project +% can always be found at \url{https://github.com/samwhited/contracard}. +% +% \StopEventually{} +% \changes{0.1}{2013/02/09}{Created boilerplate for class} +% \section{Package building and loading} +% +% \begin{macrocode} +%<*contracard> +% \end{macrocode} +% +% \paragraph{Building} +% +% Before building \pkg{contracard} you should verify that the following +% dependencies are installed: +% +% \begin{macrocode} +\AtEndOfClass{\RequirePackage{intcalc}} +\AtEndOfClass{\RequirePackage{hyperref}} +\AtEndOfClass{\RequirePackage{ifthen}} +\AtEndOfClass{\RequirePackage{geometry}} +\AtEndOfClass{\usepackage{fancyhdr}} +\AtEndOfClass{\RequirePackage[compact]{titlesec}} +% \end{macrocode} +% Once you have all the required packages, building \pkg{contracard} from source +% can be accomplished in multiple ways. If the Makefile is present running +% \code{make help} will tell you everything you need to know. To manually +% extract the files and generate the documentation simply run \code{pdflatex} +% against \fname{contracard.dtx} with the \code{-{}-shell-escape} option: +% +% \begin{Verbatim} +% $ pdflatex --shell-escape contracard.dtx +% \end{Verbatim} +% +% \paragraph{Options} +% +% \hypertarget{CONTRACARD:OPTIONS}{} +% \begin{macro}{small} +% \begin{macro}{medium} +% \begin{macro}{large} +% \begin{macro}{a7paper} +% The class can also be loaded with any of the following options: +% \begin{macrocode} +\DeclareOption{small}{% + \AtBeginDocument{% + \titleformat{\section}{\normalsize\bfseries}{\thesection}{1em}{}% + } + \PassOptionsToPackage{% + margin=0.25in,top=0.75in,paperwidth=5in,paperheight=3in% + }{geometry}% +} +\DeclareOption{medium}{% + \AtBeginDocument{\large} + \PassOptionsToPackage{% + margin=0.5in,top=0.75in,paperwidth=6in,paperheight=4in% + }{geometry}% +} +\DeclareOption{large}{% + \AtBeginDocument{\Large} + \PassOptionsToPackage{% + margin=0.75in,top=1in,paperwidth=8in,paperheight=5in% + }{geometry}% +} +\DeclareOption{a7paper}{% + \AtBeginDocument{% + \titleformat{\section}{\normalsize\bfseries}{\thesection}{1em}{}% + } + \PassOptionsToPackage{% + margin=5mm,top=15mm,paperwidth=105mm,paperheight=74mm% + }{geometry}% +} +\DeclareOption*{% + \PassOptionsToClass{\CurrentOption}{article}% +} +% \end{macrocode} +% The \code{small} option creates a 127.0 by 76.2 mm (5 by 3 in) card. +% The \code{medium} option creates a 152.4 by 101.6 mm (6 by 4 in) card. +% The \code{large} option creates a 203.2 by 27.0 mm (8 by 5 in) card. +% The \code{a7paper} option creates a 105 by 74 mm (4.1 by 2.9 in) card. +% Any unrecognized options are passed to the \pkg{article} class. +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \section{Environment setup} +% +% First let's set up the basic environment. We'll start by turning off headers, +% and removing the header rule inserted by \pkg{fancyhdr} on pages that will +% have headers later: +% +% \begin{macrocode} +\AtBeginDocument{\renewcommand{\headrulewidth}{0pt}} +\AtBeginDocument{\pagestyle{empty}} +% \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{macrocode} +\newcounter{dancecount} +% \end{macrocode} +% \end{macro} +% +% \subsection{Formatting} +% +% There are also some options to determine how the environment will be +% formatted. +% +% \begin{macro}{\defaultcontraenv} +% \changes{0.1}{2013/02/14}{Allow user to format moves} +% By default, all contra moves are wrapped in the \code{flushleft} environment. +% To change this you can renew \code{\textbackslash defaultcontraenv}. +% \begin{macrocode} +\newcommand*{\defaultcontraenv}{flushleft} +% \end{macrocode} +% \end{macro} +% +% \section{The Meat} +% +% Next we'll define the meat of the \pkg{contracard} package: The \code{contra} +% environment and the \code{\textbackslash move} command. +% +% \subsection{The \code{contra} environment} +% +% \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. +% \begin{macrocode} +\newenvironment{contra}[4][\defaultcontraenv]{% + \clearpage + \setcounter{dancecount}{0} + \thispagestyle{fancy} + \rhead{#4} + \section*{#2} + {#3} + \newcommand*{\@contraenv}{#1} + \begin{\@contraenv} +}{% + \end{\@contraenv} +} +% \end{macrocode} +% \end{macro} +% +% \subsection{The \code{\textbackslash move} command} +% +% \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. +% \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.\ }{}% + }% + }% + }% + \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}{}% +} +% \end{macrocode} +% \end{macro} +% +% \section{Examples} +% +% A few examples are contained below: +% +% \subsection{Code's Compiling by Sam Whited} +% +% \begin{Verbatim} +% \begin{contra}{Code's Compiling}{Sam Whited}{Duple becket} +% \move[8]{Neighbor dosido} +% \move[8]{Partner see saw} +% \move{Shadow swing} +% \move[8]{Balance and petronella} +% \move[8]{Balance and petronella} +% \move[8]{Partner swing} +% \move[8]{Left diagonal: Right and left through} +% \end{contra} +% \end{Verbatim} +% +% \subsection{Cherokee Shuffle by David Kaynor} +% +% \begin{Verbatim} +% \begin{contra}{Cherokee Shuffle}{David Kaynor}{Duple improper} +% \move[8]{Circle left} +% \move[8]{Neighbor dosido} +% \move{Neighbor balance and swing} +% \move[4]{Men allemande left \textonehalf} +% \move[4]{Balance in a wave} +% \move[8]{Partner swing} +% \move[8]{Circle left \textthreequarters} +% \move[4]{Balance the ring} +% \move[4]{Partner california twirl} +% \end{contra} +% \end{Verbatim} +% +% Now that everything is defined we can process any +% \hyperlink{CONTRACARD:OPTIONS}{options} that were passed in by the user: +% \begin{macrocode} +\ProcessOptions\relax +%</contracard> +% \end{macrocode} +% +% \clearpage +% \setcounter{IndexColumns}{2} +% \phantomsection +% \addcontentsline{toc}{section}{Index} +% \PrintIndex +% +% \makeatletter +% \renewenvironment{theglossary}{% +% \glossary@prologue +% \setlength\emergencystretch{5em} +% \GlossaryParms \let\item\@idxitem \ignorespaces}{} +% \makeatother +% \clearpage +% \phantomsection +% \addcontentsline{toc}{section}{Change History} +% \PrintChanges +% \Finale +% +% \iffalse +%<*doc-style> +% \begin{macrocode} +\ProvidesPackage{contracard-style} +\usepackage{fancyvrb,hologo,framed,multicol,url} +\usepackage[pdfborder=0, bookmarks, colorlinks=false, hidelinks]{hyperref} +\usepackage[parfill]{parskip} + +\fvset{gobble=2} + +\newcommand*{\gittag}{% + \immediate\write18{% + rm gittag.tex 2> /dev/null; (git describe --tags --dirty || echo "v0.0") 2> /dev/null > gittag.tex + }% + \InputIfFileExists{gittag.tex}{}{}\unskip% + \immediate\write18{% + rm gittag.tex 2> /dev/null + }% +} + +\newcommand*\name[1]{\textsc{#1}} +\newcommand*\fname[1]{\textsf{#1}} +\newcommand*\pkg[1]{\textsf{#1}} +\newcommand*\code[1]{\texttt{#1}} +% \end{macrocode} +%</doc-style> +%\fi +\endinput |