Dr Nicola Talbot | School of Computing Sciences | University of East Anglia

crkscrsh.cls v 1.1



This is the documentation for the LaTeX2e class file crkscrsh.cls, which is designed to typeset cricket score sheets. It requires a large amount of memory, so will not run on small installations of TeX. In order to reduce memory requirements, this class file is not of much use for anything other than printing the score sheet of a 90 or 40 limited overs cricket match (2 x 45-over or 2 x 20-over innings), so there are no sectioning commands etc available. The score sheet is typeset on A4 landscape with 10pt sans serif text, and there are no options to change the paper size or font size, however the following options are available:
final Final version (default)
draftDraft version
allDisplay everything (default)
nosummaryDon't display the bowling and batting summaries (Useful if TeX's capacities are exceeded)
summaryonlyOnly display the bowling and batting summaries
4545-over innings (default)
2020-over innings

The commands \showall, \nosummary and \summaryonly are equivalent to the options all, nosummary and summaryonly, respectively.

Entering Information

This section describes the commands required to specify the relevant information.

Global Commands

The following five commands may be used in the preamble:
The home team is specified by the command \hometeam{name}.

The away team is specified by the command \awayteam{name}.

The location of the match is specified by the command \location{place}.

The date of the match is specified by the command \date{dd}{mm}{yy}, where the three arguments are numerical and specify the day, month and year.

The team that won the toss is specified by \tosswonby{name}.

Commands Local to Each Innings


The information about each innings are specified within an innings environment. The innings environment takes one argument, team, that specifies the batting team. (See example) Within the innings environment, the following commands may be used:

Each bowler should be specified with a separate \newbowler command. The first argument, name, is the bowler's name, and the second argument, label, is a unique identifier for this bowler.

Each batsman should be specified by the \newbatsman command, where hr:min specifies the time the batsman went to the crease, and name is the name of the batsman. Each batsman should be specified in order. The optional argument delay is the delay in minutes between the previous batsman leaving the crease, and the new batsman going out. By default delay is zero. Apart from the first two batsman, a batsman should not be defined until the previous one is out.

The results of each over should be specified by the \Over command, where label is the label of the bowler and b is either the number of runs for that ball, a "." for a dot ball, "w" for a fall of wicket, "r" for a batsman retiring, or a "+" for a wide or no ball. b may also be "s", to indicate if the batsmen have swapped due to runs being obtained from a bye, leg-bye, or if the batsman crossed before one was caught out or stumped. Note that this class file will only display the first 12 entries of an over (which should account for most bowler's capabilities, although it will appear very cramped), but any runs scored beyond the 12th ball will still be added to the total. (See example.)

Any extras obtained during an over should be specified by the \extra command, where type should be one of: bye, legbye, wide or noball. This command should come somewhere after the \Over command for that over, and before the \Over command for the following over. It may appear before or after \howout and \newbatsman, although it makes sense to have it in chronological order. (See leg-bye example and no ball example)

\howout[bowler]{how out}
The \howout command specifies how the last batsman to be out was out. This command should come after the over in which that batsman was out, and before the \newbatsman command, specifying the replacement batsman. The mandatory argument how out specifies the text to appear in the "How Out" column of the sheet. By default the bowler's name will be placed in the "Bowler" column, next to the "How Out" column, but sometimes this is inappropriate (e.g. for a run out), in which case the optional argument bowler can be used to override this. (See retired example and Fall of wicket example.)

The time the innings ended is specified by the command \InningsEndTime, where hrs:min is the end time (24 hour clock).

Retrieving Totals

The total number of runs (including extras), total number of wickets and overs for each innings are stored in TeX count registers of the form \inningsntot, \inningsnwks and \inningsnovers, where n is the lowercase romannumeral for the innings. For example, the total number of runs scored in the first innings is stored in the register \inningsitot, whereas the total number of runs scored in the second innings is stored in the register \inningsiitot. The total number of innings is stored in the register \inningsN. Each innings also has a macro of the form \inningsnname that stores the name of the batting side for that innings (the name passed to the innings environment). To access the value of a register, prefix it with \the. For example:
Innings & Total & Wickets & Overs\\
\inningsiname & \the\inningsitot & \the\inningsiwks & \the\inningsiovers\\
\inningsiiname & \the\inningsiitot & \the\inningsiiwks & \the\inningsiiovers

Using the \SaveResults command, the above registers can be saved to a file which can then be \input'd into another document. In addition, the following macro definitions are saved in filename: \HomeTeam, \AwayTeam, \MatchDate, \MatchLocation, \WonToss, \InningsIResults, \InningsIIResults and \MatchResult. (See saving results example.)


Innings Example

The following is an extract from one of Colney's innings:
\begin{innings}{Colney}           % Colney's innings
\newbowler{Moore}{moore}          % Bowler A, given the label "moore"
\newbowler{S. Brown}{brown}       % Bowler B, given the label "brown"
\newbatsman{14:03}{G. Cawley}     % Batsman no 1.
\newbatsman{14:03}{D. Whitworth}  % Batsman no 2.
\Over{moore}{2....1}              % This is the first over bowled by "moore"
                                  % 2 runs were scored off the first ball,
                                  % and 1 run was scored off the last ball.
\Over{brown}{....1.}              % This over was bowled by "brown",
                                  % only 1 run was scored
\InningsEndTime{16:36}            % Innings ended at 16:36.

Leg Bye Example

Now for an over where there has been a leg bye:
\Over{moore}{.s2124.}             % The first ball was a leg bye.  It's entered
                                  % as a dot ball, as the run was not scored from 
                                  % the bat, but since it has caused the batsmen
                                  % to change over, "s" is required.
\extra{legbye}{1}                 % This specifies the number of runs
                                  % scored from the extra.

Example of Batsman Retiring

In the following over, batsman number 1 retired out at the end of the over (the bowler mears should have been defined before this section of code):
\Over[1]{mears}{12..22r}          % "r" specifies that batsman no 1 retired. 
                                  % (The number of wickets fallen is not advanced.)
\howout[Out]{Retired}             % Bowler's name is not appropriate in this instance,
                                  % so optional argument is needed to override it).
\newbatsman{16:05}{M. Burrell}    % Need to specify the new batsman before
                                  % the next over starts.

Example of Wickets Falling

In the following over, two wickets fell:
\Over[76]{mears}{.w1ws..}         % Batsman no 7 was the first to go,
                                  % then batsman 6 was out. The batsmen had 
                                  % swapped sides before batsman 6 was caught,
                                  % so "s" is needed to reflect this.

\howout{Bowled}                   % First state how batsman 7 was out.
\newbatsman{16:20}{M. Robson}     % Declare the batsman to replace batsman 7

\howout{Caught}                   % Now state how batsman no 6 was out.
\newbatsman{16:21}{R. Foxall}     % Declare the batsman to replace batsman 6.
(Note that if the batsman out was either number 10 or 11, the number should be grouped. For example: \Over[{10}6]{mears}{.w1ws..}.)

Example of a No Ball and a Wide

In the following over, there was a no ball and a wide.
\Over{brown}{+..2+.12}            % The first ball was a wide 
                                  % (indicated by the first "+")
                                  % the second "+" was a no ball.
\extra{wide}{3}                   % Two runs were scored from the wide,
                                  % plus one run for the wide itself, 
                                  % which gives a total of 3.
\extra{noball}{1}                 % No runs were scored off the no ball, 
                                  % plus one run for the no ball itself, 
                                  % which gives a total of 1.

Example Illustrating How to Save and Use Results

In this example, the match was defined in a file called match1.tex, which looks something like:
\hometeam{Colney Cricket Club}
\SaveResults{match1res} % save the results to match1res.tex

As noted in the Introduction , crkscrsh.cls does require a fair amount of memory, which is why it is a class file, and not a package. So what if you want to use the information provided in match1.tex? Firstly, the tables for each innings can be saved as EPS files as follows:

latex match1
dvips -E -pp1 -o match1.1.eps match1
dvips -E -pp2 -o match1.2.eps match1

Now suppose you want to write a document (say matchsummaries.tex) that includes a summary of the match defined in match1.tex. The contents of matchsummaries.tex might look something like:

 \input{match1res}The match between \HomeTeam\ and \AwayTeam\ on
 \MatchDate\ took place at \MatchLocation.  \WonToss\ won the
 toss, and \inningsiname\ batted first.  The score for the
 first innings was \InningsIResults.  The score for \inningsiiname's innings
 was \InningsIIResults.
Note that the macros \inningsiiname and \InningsIIResults will only be defined if at least two innings were specified in the original file (in this example match1.tex). The macro \MatchResult will only be defined if there were exactly two innings specified in the original file, and \InningsIResults will only be defined if there was at least one innings specified in the original file.

This class file comes with a sample file, sample.tex. Figure 1 shows the first page, and Figure 2 shows the second page.

First Innings

Figure 1 : First Innings

Second Innings

Figure 2 : Second Innings

To Do

Currently there is no allowance for a previously retired batsman to return to the crease. If there is demand for it, I will try to add in a new command to allow for this in subsequent versions.


Dr Nicola Talbot | School of Computing Sciences | University of East Anglia
N.L.C. Talbot. School of Computing Sciences. University of East Anglia. Last Modified: 19 Mar 2004