LTEX2ε Macros for Constructing UCL Documents document should provide sufficient information for...

7
IN/95/XX Internal December 20, 2004 Note L A T E X2 ε Macros for Constructing UCL Documents Dr Russel Winder Telephone: +44 (0)171 380 7293 Fax: +44 (0)20 7679 1397 Electronic Mail: [email protected] URL: http://www.cs.ucl.ac.uk/staff/R.Winder/ Abstract This document should provide sufficient information for people to use the ucl letter, ucl fax, ucl memo, ucl document, ucl thesis and ucl exam classes. It should be noted that these classes have been used quite extensively by the author but have not been extensively tested beyond normal use by the author. This means that there are likely to be a few bugs resulting in interesting behaviour in some circumstances of use that the author does not himself employ. If you find any such situations or if you find any other errors or omissions in either the macros or this document, please contact the author. Department of Computer Science University College London Gower Street London WC1E 6BT, UK

Transcript of LTEX2ε Macros for Constructing UCL Documents document should provide sufficient information for...

Page 1: LTEX2ε Macros for Constructing UCL Documents document should provide sufficient information for people to use the ucl letter, ucl fax, ucl memo, ucl document, ucl thesis and ucl

IN/95/XX InternalDecember 20, 2004 Note

LATEX 2ε Macros for Constructing UCL Documents

Dr Russel Winder

Telephone: +44 (0)171 380 7293Fax: +44 (0)20 7679 1397

Electronic Mail: [email protected]: http://www.cs.ucl.ac.uk/staff/R.Winder/

Abstract

This document should provide sufficient information for people to use the ucl letter, ucl fax,ucl memo, ucl document, ucl thesis and ucl exam classes.

It should be noted that these classes have been used quite extensively by the author but have not beenextensively tested beyond normal use by the author. This means that there are likely to be a few bugsresulting in interesting behaviour in some circumstances of use that the author does not himself employ.

If you find any such situations or if you find any other errors or omissions in either the macros or thisdocument, please contact the author.

Department of Computer ScienceUniversity College LondonGower StreetLondon WC1E 6BT, UK

Page 2: LTEX2ε Macros for Constructing UCL Documents document should provide sufficient information for people to use the ucl letter, ucl fax, ucl memo, ucl document, ucl thesis and ucl

LATEX 2ε Macros for Constructing UCL Documents Dr Russel Winder

1 Introduction

The Department of Computer Science at UCL has a standard format for letters, faxes, memos, documents — internalnotes (IN), research notes (RN) and technical reports (TR) — and exam papers. The standard is implemented inLATEX 2ε, psroff and Word, which are the 3 formatting mechanisms most popular in the department. At some stageFrameMaker templates may also be produced.

This document covers how to use the LATEX 2ε classes. Separate documents cover the other formatting systems.

2 The Basic Structure

The UCL macros are not complete classes in themselves but are extension of the LATEX 2ε standard classes; theclasses inherit directly from standard ones. ucl letter and ucl memo inherit from letter; ucl fax inheritsfrom ucl letter and hence is also a letter; ucl thesis inherits from book; and ucl document anducl exam inherit from article. Access to LATEX A Document Preparation System, 2nd edition by Leslie Lamport(or something equivalent) is therefore required since this document deals only with the extensions provided by theucl * classes.

Letter, faxes and documents come in two guises, general and personalized. The general guise produces a formatwith general departmental information and requires no extra information about the user. The personalized formsrequire the user to have predefined a package, with certain macro calls inside, included into the document using\usepackage (or to include the macro calls directly in the document source, of course) in order to prepare thepersonal information in the right form.

In fact, there is a command /opt/tex/lib/texmf/tex/ucl/preparesignature which will prepare thebasics of such a file from the information stored in /cs/docs/research/deptlist.awk. This is the filecontaining the official information held about people in the central user database.

3 The Personal Signature File

The information required in a personal signature file is best demonstrated via an example. The following is the resultof running the preparesignature file for myself:

\personname{Dr Russel Winder}\persontitle{Reader in Software Engineering}\personrole{ex Research Student Tutor}\persontelephone{+44 (0)171 380 7293}\personemail{[email protected]}\personurl{//www.cs.ucl.ac.uk/staff/R.Winder/}\personpostnominal{MInstP, CPhys, FBCS, CEng}

By default the classes use all the fields one way or another. It is sometimes required that some of the fields are notused. The printing, or not, of a field is controlled by a Boolean, person*wanted, where * is one of title, role,telephone, mail, url and postnominal. A line such as:

\setboolean{personrolewanted}{false}

causes the class not to use the role field.

This information could in principle be included directly in the LATEX 2ε source document (as it is in fact with thisdocument) but more usually it will reside in a file with a .sty extension and be included into the document as apackage, i.e. with a line such as:

\usepackage{rlw_signature}

in the source file.

IN/95/XX Page 1

Page 3: LTEX2ε Macros for Constructing UCL Documents document should provide sufficient information for people to use the ucl letter, ucl fax, ucl memo, ucl document, ucl thesis and ucl

LATEX 2ε Macros for Constructing UCL Documents Dr Russel Winder

4 UCL Letters, Faxes and Memos

UCL letters are letters with a special letterhead which may or may not be personalized. A start line of:

\documentclass{ucl_letter}

sets everything up for a general UCL letter, whereas using the option personalisehead uses the personalizedform of the letterhead:

\documentclass[personalisehead]{ucl_letter}

Everything else about a letter is as Standard LATEX 2ε letter class and environment.

Faxes are no different from letters except that one extra field is required the fax number to send to. An extra commandis introduce:

\tofax{...}

which appears in the preamble.

A memo is a letter with a simpler letterhead. It is accessed using the class ucl_memo. However, it requires a subjectfield so a call to:

\subject{...}

is required to set the field.

5 UCL Documents

UCL documents include INs, RNs and TRs which are simply variations on a theme, the UCL document. Thus, in, rn,and tr are simply options to the ucl document class. Thus for example the start line might be:

\documentclass[rn]{ucl_document}

This class can use the personalization data as described in Section 3. If you use this facility then the \author macrodoes not need to be used in the document to get the name on the front cover. If you choose not to use this facilitythen not only must \author be used but a call of the following ilke must appear to deal with all contact details:

\contactdetails{%\mbox{\emph{Telephone}: +44 (0)171 380 7293}\\%\mbox{\emph{Fax}: +44 (0)171 387 1397}\\%\mbox{\emph{Electronic Mail}: [email protected]}\\%\mbox{\emph{URL}: http://www.cs.ucl.ac.uk/staff/R,Winder/}\\%

}

Two extra commands are introduced over and above those required by the article class and they are:

\documentnumber{...}\keywords{...}

\documentnumber should contain the correct document number as assigned by the department assigner, currentlyTessa Rickards, and \keywords should contain the list of keywords to appear on the cover of the document.

Apart from the above a UCL document is the same as an article.

Will except that the \title and \author have been redefined to admit an optional parameter enabling easyspecification of separate title page title/author and running head title/author. Thus, these macros can appear like:

IN/95/XX Page 2

Page 4: LTEX2ε Macros for Constructing UCL Documents document should provide sufficient information for people to use the ucl letter, ucl fax, ucl memo, ucl document, ucl thesis and ucl

LATEX 2ε Macros for Constructing UCL Documents Dr Russel Winder

\title[Short title]{An Extremely Long Title that is Fine on the TitlePage but would be Useless as a Running Head}\author[Bloggs et al.][J Bloggs, U Persson, Z Beeblebrox, JDoe, T Jig}

Because of the way these redefined versions of \title and \authorwork there are minor difficulties using macrosin titles and author lists. The cure is quite straightforward but irritating. I am trying to find a more elegant solution.An example, the use of \title for this document, shows the solution, which is to use the full form of the macro(despite the repetition) and to disallow early expansion of the macro in the troublesome place:

\title[\noexpand \LaTeXe\ Macros for Constructing UCLDocuments]{\LaTeXe\ Macros for Constructing UCL Documents}

6 UCL Theses

MRes, MPhil and PhD theses have to be typeset to certain rules as laid down by University of London. These rulesare (more or less) encapsulated in the ucl thesis class, which inherits from book.

The University regulations on margins, spacing etc. are:

• Margin at binding edge = 40mm.

• Margin at all other edges = 20mm.

• Inter-line spacing = 1.5.

• Pages must be numbered in one continuous sequence from title page to the last page of type in arabic numerals.

As a thesis is a book, use can be made of \frontmatter, \mainmatter and \backmatter if that is desiredbut this would be a variation of the thesis standard since \frontmatter causes roman page numbering and thestandard states that numbering is arabic throughout starting with the title page as page 1. Despite this, no thesis hasbeen rejected for being non-standard on this point, so it is a choice.

Other components of the style are:

• Contents: No deeper than subsections.

• Equations, figures, tables and other numbered objects: These are numbered by chapter and item number withinchapter. For example, the first equation in chapter 1 will be equation 1.1.

• Section headings: There is no italic type in chapter, section, subsection and subsubsection headings. Bold fontat different font sizes is used. Subsubsections are not numbered.

• Paragraph style: The default should be indented paragraphs with a supported option for blocked paragraphs.

• Fonts: Times Roman is a font that has been consistently used over a long period of time, and for that reason ispreferable to any other font. Although the default font is a 10pt one, 11pt font is preferred (12pt could even beused) so it is usual to put the 11pt option in the \documentclass statement.

• References: References should be all at the end of the thesis and in alphabetical order. There is no default onthe style of references, this is left to the author.

It is expected that acknowledgements appear between the abstract and the table of contents. An environment isprovided for acknowledgements.

The paradigm of a LATEX UCL Thesis file is:

\documentclass{ucl_thesis}\title{<The Thesis Title>}\author{<The Author>}\date{<The Year>}

IN/95/XX Page 3

Page 5: LTEX2ε Macros for Constructing UCL Documents document should provide sufficient information for people to use the ucl letter, ucl fax, ucl memo, ucl document, ucl thesis and ucl

LATEX 2ε Macros for Constructing UCL Documents Dr Russel Winder

\begin{document}\maketitle\begin{abstract}<Words comprising the abstract.>\end{abstract}\begin{acknowledgements}<Words comprising the acknowledgements.>\end{acknowledgements}\tableofcontents\listoffigures\listoftables<... The thesis ...>\end{document}

Whilst, the entire thesis could reside in a single file, it is far more likely that the above will reside in one file with thethesis content being a set of \include or input calls, perhaps each chapter being a separate file.

It is strongly advised that BibTEX be used for handling the references. The \bibliographystyle call comes inthe document body, not in the preamble. The \bibliography call should be exactly where the bibliography isto appear. It is strongly recommended that either plain (essentially Vancouver) or Harvard citation style are used.There are a large number of different implementations of Harvard and derivatives. I have settled on one: rnmdt(mostly because I constructed it!).

\documentclass{ucl_thesis}\usepackage{rnmdt}\title{<The Thesis Title>}\author{<The Author>}\date{<The Year>}\begin{document}\bibliographystyle{rnmdt}\maketitle\begin{abstract}<Words comprising the abstract.>\end{abstract}\begin{acknowledgements}<Words comprising the acknowledgements.>\end{acknowledgements}\tableofcontents\listoffigures\listoftables<... The thesis ...>\bibliography{...}\end{document}

This provides a set of \cite macros beyond that specified in the various books on LATEX 2ε.

In the text, one is likely to use the standard \cite{...} quite a lot. This produces ‘(namelist, date)’ in thetext. As this is a name–date style, we often want ‘namelist (date)’. For this use \citeasnoun{...}. . . . hererepresents a label that labels an item in the BibTEX database. Note that whilst \cite{label1,label2} makesense, \citeasnoun{label1,label2} is an error.

Possesiveness is sometimes required and this can be a difficulty if the name is being used as a noun, e.g. Winder’s(1994) . . . . In this situation \citeasposnoun{...} can come in handy. Also \citeasplposnoun{...}which deals with situation where an s ends the name and the apostrophe is the last character.

Unfortunately, we sometimes have to do the formatting entirely by hand. For example, Winder (1994; 1995; Wer-nick & Winder, 1994) cannot be handled by any of the above so use:

\unfcite — produce the ‘name, date’ with no parentheses.\unfshcite — produce only ‘date’ with no parentheses.

IN/95/XX Page 4

Page 6: LTEX2ε Macros for Constructing UCL Documents document should provide sufficient information for people to use the ucl letter, ucl fax, ucl memo, ucl document, ucl thesis and ucl

LATEX 2ε Macros for Constructing UCL Documents Dr Russel Winder

These should, however, only be used in this sort of case, they are not intended for general use.

Finally, there are some circumstances where \cite just cannot be used without some difficulty. A citationwithin a \caption is an example. In such circumstances, please ensure that you protect the macro, e.g.\caption{Problem \protect\cite{Winder1994}}.

7 On Typefaces

The department uses Helvetica (or Ariel) and Times (or Times New Roman) as its standard typefaces and these arethe defaults for all the UCL classes. People clearly can but should not use different typefaces.

8 UCL Exam Papers

This class is used for constructing exam papers according to the rules laid down by Registrar’s Division. Answerscan be included in the same file and printed or not, to produce the final exam paper.

An exam paper is a 12pt Times-Roman, two-sided, one-column, space-and-a-half, A4 article comprising questions,subquestions and subsubquestions each one of which may have an answer and a mark associated with it.

The cover sheet of an examination paper is provided centrally and details the usual material: heading, title, course,date, time, copyright, etc. It is treated as unnumbered material. Thus, the exam paper starts on page 1 with the rubricfor the paper.

Style requires that marks should be put for each question or sub-part thereof with a total at the end. There is noseparate macro for doing totals, so these must be added manually.

Model answers can (indeed should) be provided within the same file as the questions. It is usually best to place theanswer directly below the (sub-)20question to which it refers but there is no requirement that this is so.

All features of an exam paper are provided as environments. The source will look something like:

\begin{rubric}...

\end{rubric}\begin{question}\begin{subquestion}...

\marks{10}\begin{answer}...

\end{answer}\end{subquestion}\begin{subquestion}...

\marks{15}\begin{answer}...

\end{answer}\marks{Total 25}\end{subquestion}\end{question}\begin{question}...

\end{question}

The \end{...}\begin{...} combination happens so often in questions, subquestions and subsubquestions thata shorthand is available, \further{...}. Thus a real paper might look like:

\begin{rubric}...

IN/95/XX Page 5

Page 7: LTEX2ε Macros for Constructing UCL Documents document should provide sufficient information for people to use the ucl letter, ucl fax, ucl memo, ucl document, ucl thesis and ucl

LATEX 2ε Macros for Constructing UCL Documents Dr Russel Winder

\end{rubric}\begin{question}\begin{subquestion}...

\marks{10}\begin{answer}...

\end{answer}\further{subquestion}...

\marks{15}\begin{answer}...

\end{answer}\marks{Total 25}\end{subquestion}\further{question}...

\end{question}

The decision of whether to print the answers (which are typeset in the associated sans serif typeface — Helvetica whenusing Times-Roman, which is what should be used) or not rests with the Boolean \ifanswersrequired, whosedefault is false — NB the use of a primitive TEX Boolean here. To print answers, the call \answersrequiredtrueshould appear somewhere at the start of the file, usually in the preamble.

IN/95/XX Page 6