School of Mathematical Sciences

School of Mathematical Sciences
Queen Mary, University of London
London, E1 4NS, UK

# Putting course informationon the Web

This document is designed for members of the School of Mathematical Sciences at Queen Mary, University of London. It is written by Peter Cameron, with assistance from Wilfrid Hodges, Peter Kropholler, Boris Khoruzhenko, Steve Schwartz and Francis Wright. Page design is by Leonard Soicher and Chris Pinnock. Jeff Spirko has also provided some material.

It contains information about putting course information (lecture notes, problem sheets, etc.) on the Web, and pointers to sources of further information. Although lecturers use a wide variety of computers, operating systems, and software, it is crucial that students are able to read all the material from a properly configured Web browser.

The document is available to everybody, but some of the links are restricted to members of the School of Mathematical Sciences at Queen Mary. Comments are welcome and should be sent to Peter Cameron, p.j.cameron(at)qmul.ac.uk.

## Creating a course Web page

This document assumes that you already have a personal Web page. If not, you can find a template and a tutorial for producing one here or here on the School intranet.

A sample course Web page is here.

Material accessible on the Web should be kept within your public_html directory on the School network. So, for example, if the lecturer with username pjc is teaching the module MAS999, a file called cw1.pdf placed in a subdirectory MAS999 of his public_html directory will be available on the Web at the URL http://www.maths.qmul.ac.uk/~pjc/MAS999/cw1.pdf.

It is necessary to change the permissions of any files, by means of the UNIX command

chmod a+r file.pdf
otherwise students will not be able to read them. You also have to make the directories executable: in this case by the command
chmod a+rx MAS999

If the directory contains a file called index.html, then this file is opened by a Web browser pointed at the directory address. Otherwise, the browser may or may not give a directory listing, depending on the web server: some web servers disable this feature. You can see examples of the two methods at http://www.maths.qmul.ac.uk/~pjc/MAS999/ and http://www.maths.qmul.ac.uk/~pjc/MAS999alt/ respectively. The first method is recommended.

Note that in 2006 the School adopted a policy for the location of web pages, which is as described above: that is, they should be placed in a directory whose name is the module code within your public_html directory, and this directory should contain a file called index.html. If you prefer to use another system, we describe below how to map your system onto the School default by means of the Unix command ln (link).

If your course is available to both year 4 undergraduates and MSc students it probably has two numbers. Instead of maintaning two separate pages it is preferable to set up one and link the other to it. See below.

It is not difficult to produce HTML documents. The simplest way is to find a page you like, take a copy (with the SAVE AS... menu item), and edit it to suit your own needs! If you want to know more, there are many tutorials on the Web; one by David Harper and Lynne Stockman is recommended.

## Producing PDF files

The preferred method of putting course material on the Web is Adobe's Portable Document Format (PDF). This provides the accurate control of typesetting that we expect from TeX, inclusion of graphics, cross-references, and links to other Web documents, and (most important) can be read and printed by Adobe's Acrobat Reader program, which is available on the computers the undergraduates use.

If you have the commercial program Acrobat Distiller, there is no limit to what you can do. Wilfrid Hodges' document explaining this gives examples taken from LaTeX, Maple, Microsoft Word, and Adobe Illustrator, and a page scanned in from handwritten lecture notes.

Most of us will probably be producing our PDF files from LaTeX documents. There are two methods for this:

Method 1:
Simply use pdflatex instead of latex to compile your document. Instead of a DVI file, this produces a PDF file in one shot.

Method 2:
There is an alternative 3-step method which can be used. This assumes that your file is called file.tex. The following are the UNIX commands for Method 2.
• latex file produces a DVI file as usual.
• dvips -o file.ps file converts the DVI to PostScript.
• ps2pdf file.ps converts the PostScript to PDF.

#### Notes

1. If you use plain TeX rather than LaTeX, substitute pdftex for pdflatex in Method 1, or tex for latex in Method 2.

2. In LaTeX, we strongly recommend using the package mathptmx. This typesets your document with Times Roman instead of the default Computer Modern. The advantage is that, since the Times fonts are built in to Acrobat Reader, they do not need to be included in every document; this results in much smaller files (typically one-fifth the size for a problem sheet) which are quicker to download.

3. Using Times fonts, Method 1 gives PDF files that look better on-screen, though the printed versions seem to be about the same quality.

4. The UNIX commands described can be made to work in the same way under Windows: see Francis Wright's document for more details. Alternatively, WinEDT will produce PDF at the touch of a button. As a last resort, log in to the School network and use the UNIX commands there.

5. Remember that LaTeX provides a "slides" class, for producing OHP slides for your course: start your document with
\documentclass{slides}
and put each page between the commands \begin{slide} and \end{slide}. See Peter Kropholler's document for more details. (Unfortunately we no longer have the source code for this document.) You are also strongly urged to read Wilfrid Hodges' guidelines on use of OHPs.

6. LaTeX also now provides a "beamer" class for use with a data projector. Sart your document with
\documentclass{beamer}
and put each page between the commands \begin{frame} and \end{frame}. Frames can be titled with \frametitle. Further instructions on this are coming soon!

7. The following modification of the dvips command
dvips -o file.ps -Ppdf -G0 file
avoids some problems with characters (such as ligatures) printing incorrectly. See the FAQs.

Windows users may be interested in a tutorial by C. T. J. Dodson at Manchester.

## Graphics, cross-references, etc.

This section will tell you about including graphics or cross-references in your lecture notes, and on printing them four-to-a-page.

#### Graphics

Pictures are easily incorporated into a PDF file produced by Acrobat Distiller, as Wilfrid Hodges' document shows.

For LaTeX users, life has been more complicated in the past. Here is some advice. For further details, see the FAQs.

1. Pictures produced by the LaTeX picture environment, or by various enhancements such as the curves package, can be handled by either of the two methods.

2. Some LaTeX packages (such as PSTricks) insert PostScript commands in the DVI file. In this case, Method 2 should be used.

3. If you need to include an externally produced graphics file, it should be in either PostScript or PDF format, and you should use the package graphicx. If your graphic is PDF, use Method 1; otherwise use Method 2. To include the file gfile.ps in your LaTeX document, put the line
\includegraphics{gfile.ps}
at the appropriate place in the document. The picture can be re-scaled by an optional argument such as [scale=0.8] before the filename.

4. Method 1 (using pdflatex) will also handle JPEG and PNG files (PNG="Portable Network Graphics").

5. Jeff Spirko has suggested the following tip. If you have a picture in both PostScript and PNG format (see below for converting), and use the package epsfig instead of graphicx, with syntax like
\epsfig{file=figure1,width=0.8\textwidth}
then the program will insert figure1.ps if you use LaTeX, and figure1.png if you use PDFLaTeX. (You can substitute PDF for PNG here.)
If your graphics are in a different format, you should convert them to PostScript, PDF, or PNG.
1. Many graphics programs, such as the UNIX programs xv and gimp, convert formats, and have the option of PostScript output.

2. Any program which has a "print to file" option should allow you to produce a PostScript version of your work. Sometimes you need to adjust the bounding boxes.

3. The UNIX script epstopdf will convert Encapsulated PostScript (e.g. a graphic file) into PDF format. There is a Windows version of this command too: see the FAQs. The syntax is
epstopdf gfile.eps
Unfortunately the results are sometimes bizarrely unexpected!

#### Cross-references

LaTeX automatically works out cross-references and citation keys when it compiles your document. In a PDF file, these can have the added feature that clicking on a cross-reference such as "Theorem 7" takes you to the statement of the theorem, etc.

If you use Method 1, all you have to do is to put the line

\usepackage[colorlinks]{hyperref}
in your document (after any other packages you use). No changes to the LaTeX text are necessary.

You can also include links to other documents anywhere on the Web with this package. The syntax is

\href{URL}{link text}
(this is the equivalent of the HTML <A HREF="URL">link text</A>). Peter Cameron's document gives several examples of this feature.

Note: Not all web browsers permit this feature: it appears to fail with Konqueror. Both Netscape and Mozilla work fine.

If you use the Hyperref package, the default behaviour is that your document will appear with bookmarks and thumbnails. This may be appropriate for a long document, but for a page or two of course information you can change this with the Hyperref options pdfpagemode=None,pdfstartview=FitH: that is, put the line

\usepackage[colorlinks,pdfpagemode=None,pdfstartview=FitH]{hyperref}

Added October 2007: The latest version of Acrobat Reader can recognise a URL in a PDF file, and allow you to open it directly. Of course, the method using Hyperref is much more flexible; it can handle other kinds of cross-references, and it is not necessary for the link text to be the same as the URL. But in some cases you may be able to get away without it. . .

#### Printing four-to-a-page

1. Large-format lecture material such as slides can be printed out four-to-a-page. The UNIX command mpage does this for PostScript files. Use Method 2 described earlier, with a new stage
mpage file.ps >file4.ps
after dvips to create file4.ps, and then apply ps2pdf to this file. Note that this method does not work properly if you have included graphics, since these cannot be re-scaled. Here is an example.

The mpage program will also print two or eight to a page: just put -2 or -8 after mpage and before the filename.

2. Peter Kropholler has provided an alternative method, a LaTeX class file smallslides.cls which can be used in place of the slides.cls class; simply take a copy of his file, and begin your document with
\documentclass{smallslides}
You will need to halve the size of your pictures. This will happen automatically if you set the size of the picture as a fraction of the text width, e.g. by width=0.8\textwidth in epsfig. Otherwise, put [scale=0.5] (or half the existing scale) in each \includegraphics command (if you are using the graphicx package). Here is an example.

3. On a Macintosh, you can print 4-up from the "Print" dialogue. Wilfrid Hodges' notes explain how.

#### School policy on course Web pages

In 2001 the SSLC decided that course information should be made available on the Web. We do not specify exactly what you should put, or how helpful it should be to the students. Look around to see what your colleagues do.

In 2006 the School adopted a policy for uniform naming of web pages. The principal web page for a course should be a file called index.html in a subdirectory whose name is the module's code number (such as MAS999) within your public_html directory, as described above. The School administrator assumes you use this format when producing the list of modules for the on-line version of the Undergraduate Studies Handbook. If you have already used a different system, you can satisfy the requirements by using the Unix ln (link) command. Here are some instructions.

ln -s source target
where source and target are what they would have been if you were copying.

For example,

• If you wish to keep MAS228 Probability II home page as a file index.html in a subdirectory named probII in your public_html directory then, to create the desired symbolic link, you should make public_html your current directory (cd ~/public_html) and then do
ln -s probII MAS228
• If you wish to keep MAS228 Probability II home page as a file probII.html in your public_html directory (no subdirectories involved) then, to create the desired symbolic link, you should make public_html your current directory (cd ~/public_html) and then do
ln -s probII.html MAS228

If your course is available to both year 4 undergraduates and MSc students it probably has two numbers, an MAS number and an MTHM or ASTM number. In that case, instead of maintaining two separate pages, it is better to set one up and link the other to it. Assuming that you have set up a directory MTHMxxx containing the course material, you should make public_html your current directory (cd ~/public_html) and then do
ln -s MTHMxxx MASyyy

A symbolic link can be removed as if it were a file: rm linkname.

A potential problem with the ln command and its solution is documented here.

Once you have produced the Web page for your course, you may want to send a confirmatory email to the Administrator, William White giving him the name of the course and the URL of the Web page.

The course lists are found at http://www.maths.qmul.ac.uk/undergraduate/modules/. Check a few of the courses to see what your colleagues have been up to.

Note added 25/03/2009: All our modules have been re-numbered. But the principles described above still apply.

#### College logo

The College provides a collection of logos which are suitable for use in HTML documents - they look good on-screen but print poorly. The sample course web page for MAS999 uses one of these logos. These logos are also available here on the School's internal pages, with instructions for their use. I have found that QM144 scaled by a factor 0.3 is suitable for use with the beamer package.

Here you will find a PostScript version and a PDF version of the logo which looks bitty on screen but prints more satisfactorily, and a document using this version. Take a copy of either or both of these and put in your working directory.