LaTeX course: Exercise 3

In this exercise you are asked to create the complete document shown in exer3ans.pdf. This will bring together the topics of Chapter 3 in an enlightening way. The text itself is not important---concentrate on making the cross-referencing and bibliography structure work.

Do not reproduce the double-underlines - they are there to show you where you need to use \cite, \ref and \pageref.

Don't worry if the margins are different.

As an additional exercise for the enthusiastic, you are asked to split the document into separate files, which are joined together in a master file using \include.

How to do it

  1. Create a new file exer3.tex to hold this document.
  2. Use the article document class, with the a4paper and 12pt options.
  3. You will need to define a theorem environment with newtheorem.
  4. Create the title using \maketitle in the usual way. You can put two authors into the \author argument by putting \and between the names.
  5. Use \tableofcontents.
  6. To get a new section without a number, use \section*.
  7. Use \label to mark Section 1, the equation and the Theorem, and then use \ref whenever they are referred to. Put the label command on the same line as the \begin{.... Remember to use label key names like sec.something for clarity.
  8. The bibliography section is created with the code:
9.   
10.\begin{thebibliography}{9}
11. 
12.\bibitem{wilkins}
13.B. J. M. Wilkins, ``Topological Dynamics and the Haddock Fishery'',
14.Unpublished, 1987.
15. 
16.\bibitem{strainer-wilkins}
17.T. I. Strainer \& B. J. M. Wilkins 1993, 
18.A new result on Drivle's Theorem, {\em Proc. Iceland Cod Fish Soc.
19.Lond. Ser. D}, {\bf 134} (8678--8679).
20. 
21.\end{thebibliography}
  1. Use \cite to refer to items in the bibliography. The square brackets around the number are included automatically. You may cite two items at once using \cite{ref1,ref2}.

Check your answer with exer3ans.tex.

EXERCISE 3A

You should now have a complete, cross-referenced document in the file exer3.tex. I would like you to SPLIT this file into separate files, with a master file to combine them in LaTeX. DON'T retype the new files: use the text editor to copy portions of exer3.tex into new files. Ask for help if you don't know how to do this.

Create a master file master.tex that uses \include to load the files intro.tex, sect1.tex, sect2.tex, and ref.tex for the bibliography.

The essential commands \documentstyle, \begin{document} and \end{document} must appear in master.tex ONLY. So intro.tex starts just with:

 
\section*{Introduction}

and contains just the text of the Introduction section. sect1.tex starts with:

 
\section{Drivle's Theorem and the R-O Lemma} \label{sec.drivle}

followed by the text of Section 1. Similarly for sect2.tex and ref.tex.

 
What happens if the \include is replaced by \input?

Check your answers with files: master.tex, intro.tex, sect1.tex, sect2.tex, and ref.tex.

EXERCISE 3B

When your split document is complete, experiment with the \includeonly command to see the effect of omitting included files.

Insert new equations, Theorems, references (\bibitems) and see how things get renumbered by LaTeX.

Remember that when new things are inserted into the source files the first run of latex updates the .aux files, and the second run inserts the new numbers into the DVI output.


LaTeX course home page