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

cmpreprt.cls v 1.0 : LaTeX2e class file for writing project reports

Introduction

This is the documentation for cmpreprt.cls, a class file provided for writing reports in the style required by the School of Computing Sciences, University of East Anglia. All students should read the Report Writing Guide before writing a report.

Available Commands

Title Page Commands

The following commands may be used in the preamble. If they are placed within the document environment, they must go before \maketitle:

\ccode
The course code is specified using the command:
\ccode{code}.
For example:
\ccode{CMPS1A4Y}

\lecturer
The course lecturer can be specified using the command:
\lecturer{name}

\date
The date is the current date by default, but can be changed using the command:
\date{date}

\title
The assignment title is specified using the command:
\title{title}

\author
The author name (or the group name and the authors) is specified using the command:
\author{name(s)}

\regnum
The student's registration number is specified using the command:
\regnum{registration number}
If there is more that one student, the registration numbers can be separated by a line break. For example:
\regnum{01234567\\12345678\\23456789}

\numwords
The total number of words in the report should be specified using the command:
\numwords{number}
For example:
\numwords{1500}
Some front-ends or editors have a build in word count function. For those who don't have this option, there are several ways of counting the number of words in your document.
  1. The Perl script latexcount.pl can be used to count the words in a LaTeX document. For example:
    perl latexcount.pl filename
    This Perl script can be downloaded from http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/latexcount.html

    If you are using a Makefile, you can use sed in combination with latexcount.pl to store the word count in a file, and then input it into your document. For example, suppose your document is called "myrep.tex", then your Makefile might look something like:

    myrep.dvi       : myrep.tex
                    latexcount.pl myrep.tex | sed '/[0-9]\+ total/!d;s/\([0-9]\+\) total/\1/' > docwc.tex
                    latex myrep
    

    (You may need to write "perl latexcount.pl" instead of simply "latexcount.pl" depending on your system.) The second line of the above creates a file called "docwc.tex" which simply contains the total number of words. This can then be read in by "myrep.tex":
    \numwords{\input{docwc}}
    
    If you are using Windows, latexcount.pl is probably the best method if your front-end doesn't have a word count facility. (Although obviously you will need to have Perl installed.)

  2. The Unix command wc will count the number of words, characters and lines in an ordinary ASCII file, however it will also count all LaTeX commands as well. To get around this you can use detex:

    detex filename | wc -w

    In this case you will need the following in your Makefile (again supposing that your document is called "myrep.tex"):
    myrep.dvi       : myrep.tex
                    detex myrep.tex | wc -w | sed '/[0-9]\+ myrep.tex/!d;s/\([0-9]\+\) myrep.tex/\1/' > docwc.tex
                    latex myrep
    
    Again, your LaTeX source code will need to load in "docwc.tex":
    \numwords{\input{docwc}}
    

  3. The shell script wordcount.sh and accompanying file wordcount.tex can be used to count words, whilst ignoring LaTeX commands. This can be downloaded from http://www.tex.ac.uk/tex-archive/help/Catalogue/entries/wordcount.html. In this case you will need the following in your Makefile (again supposing that your document is called "myrep.tex"):
    myrep.dvi      : myrep.tex
                    wordcount.sh myrep.tex | \
                            sed '/[0-9]\+ words/!d;s/.\+ \([0-9]\+\) words\./\1/' \
                            > docwc.tex
                    latex myrep
    

    (You may need to use bash wordcount.sh instead of wordcount.sh.) Again, your LaTeX source code will need to load in "docwc.tex":
    \numwords{\input{docwc}}
    
Note that the word count should exclude appendices. This is easily done by placing the appendices in a separate file, and including that file into your document using \input{filename}.

Most front-ends (such as WinEdt and TeXnicCenter) have a spell checking tool, make sure you use it to check your document. For those not using a front-end, there is an application called "ispell" which will spell check an ASCII file. You will need to use the "-t" option to indicate that your file is a LaTeX file.

Other Commands

All commands that are defined in the article class file, may also be used with this class file. There is an additional page style called cmpreprt available, which is used by default. Remember to use \maketitle to generate the title page.

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: 28 May 2004