summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/contracard/contracard.cls
blob: e473f047bfe0add0a1b6c5a876fcf0fa17a1a240 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
%%
%% This is file `contracard.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% contracard.dtx  (with options: `contracard')
%% 
%%   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.
%% 
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{contracard}[2013/02/17]
\AtEndOfClass{\LoadClass{article}}
\AtEndOfClass{\RequirePackage{intcalc}}
\AtEndOfClass{\RequirePackage{hyperref}}
\AtEndOfClass{\RequirePackage{ifthen}}
\AtEndOfClass{\RequirePackage{geometry}}
\AtEndOfClass{\RequirePackage{fancyhdr}}
\AtEndOfClass{\RequirePackage[compact]{titlesec}}
\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}%
}
\AtBeginDocument{\renewcommand{\headrulewidth}{0pt}}
\AtBeginDocument{\pagestyle{empty}}
\newcounter{dancecount}
\newcounter{partcount}
\newcounter{phrasecount}
\newcommand*{\progressed}{\setcounter{phrasecount}{1}}
\newcommand*{\defaultcontraenv}{flushleft}
\newenvironment{contra}[4][\defaultcontraenv]{%
  \clearpage
  \setcounter{dancecount}{0}
  \setcounter{partcount}{1}
  \setcounter{phrasecount}{1}
  \thispagestyle{fancy}
  \rhead{#4}
  \section*{#2}
  {#3}
  \newcommand*{\@contraenv}{#1}
  \begin{\@contraenv}
}{%
  \end{\@contraenv}
}
\newcommand*{\move}[2][16]{%
  \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}{%
    \addtocounter{phrasecount}{1}\setcounter{partcount}{0}\pagebreak[1]%
    \vspace{1em}}{}%
  \ifthenelse{\intcalcMod{\value{dancecount}}{16}=0}{%
    \addtocounter{partcount}{1}\newline}{}%
}
\ProcessOptions\relax
%% 
%%   ___________
%%   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
%% 
%%
%% End of file `contracard.cls'.