summaryrefslogtreecommitdiff
path: root/obsolete/macros/latex209/contrib/exam/examdoc.tex
blob: 3ea8401ff9b2850a737d3338c0f232bb042fecda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
% examdoc.tex

\documentstyle[12pt]{exam}

%--------------------------------------------------------------------
%---------------------------------------------------------------------
\newenvironment{example}%
   {\bigskip\filbreak
    \subsubsection{Example:}
   }%
   {}


\def\samplehead#1#2#3#4{%
  \begin{trivlist}
     \item[]
     \leavevmode
     \hbox to \textwidth{%
         \rlap{\parbox[b]{\textwidth}{\raggedright#1\strut}}%
         \hfil\parbox[b]{\textwidth}{\centering#2\strut}\hfil
         \llap{\parbox[b]{\textwidth}{\raggedleft#3\strut}}%
  }% hbox
  #4
  \end{trivlist}
}

\def\samplefoot#1#2#3#4{%
  \begin{trivlist}
     \item[]
     \leavevmode
     #1
     \vskip 3pt

     \hbox to \textwidth{%
         \rlap{\parbox[t]{\textwidth}{\raggedright#2}}%
         \hfil\parbox[t]{\textwidth}{\centering#3}\hfil
         \llap{\parbox[t]{\textwidth}{\raggedleft#4}}%
  }% hbox
  \end{trivlist}
}



\makeatletter
\@ifundefined{AmS}{\def\AmS{{\protect\the\textfont\tw@
  A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}}
  {}
\makeatother


%---------------------------------------------------------------------
%---------------------------------------------------------------------
%---------------------------------------------------------------------
%---------------------------------------------------------------------

\begin{document}

\title{Using the exam document style}

\author{Philip Hirschhorn\\
Department of Mathematics\\
Wellesley College\\
Wellesley, MA 02181\\
phirschhorn@wellesley.edu}

\date{December 12, 1994}

\maketitle

\tableofcontents

\section{Introduction}


The file \verb"exam.sty" provides a document style that attempts to
make it easier to prepare exams.  Most of what's here can also be
accomplished by using \verb"fancyheadings.sty", adjusting \LaTeX's
page layout parameters (perhaps by using \verb"fullpage.sty") and
making careful use of the \verb"list" environment, but \verb"exam.sty"
tries to make all this as simple as possible.

Specifically, \verb"exam.sty" sets the page layout so that there are
one inch margins all around and provides commands that make it easy
to format questions and create very flexible headers and footers.  In
particular:
%
\begin{itemize}
\item The style will automatically format and number the questions,
  parts of questions, and subparts of questions, while making it easy
  to refer to specific questions by number in any special directions
  you need to print on the exam.

\item You can include the point value of each question (or part, or
  subpart), with your choice of having the point values either at the
  beginning of the text of the question or in the left margin.

\item You can specify the header in three parts: The left head, the
  center head, and the right head.  The left head is left justified,
  the center head is centered, and the right head is right justified,
  and one or all of these can be omitted.

\item The footer is also specified in three parts: Left justified,
  centered, and right justified.

\item The header and footer for the first page can be different from
  the ones used on other pages.

\item Both headers and footers can contain more than one line.  To
  accommodate headers and footers with many lines, simple commands are
  provided to increase the parts of the page devoted to the header
  and/or the footer, and these commands can give one amount of space
  on the first page and a different amount of space on all other
  pages.

\item You can have a horizontal rule at the base of the header and/or
  at the top of the footer.

\item Macros are defined to allow you to state the total number of
  pages in the exam and to change the header and/or footer that
  appears on the {\em last\/} page of the exam.

\end{itemize}

%---------------------------------------------------------------------
\section{The documentstyle command}

To use the \verb"exam" document style, you should specify \verb"exam"
as your main document style.  For example, if you want to use
12~point type, then your \verb"documentstyle" command should be
%
\begin{center}
\verb"\documentstyle[12pt]{exam}"
\end{center}
%
If you would also like to use some of the features of \AmS-\LaTeX,
then you should use the command
%
\begin{center}
\verb"\documentstyle[12pt,amstex]{exam}"
\end{center}

%---------------------------------------------------------------------
\section{Questions}

To type the questions in the exam, you use the \verb"questions"
environment.  Each question is then begun with the command
\verb"\question", and the questions will be numbered automatically.

For example, if you type
%
\begin{verbatim}
\begin{questions}

\question
Why is there air?

\question

How much wood would a woodchuck chuck if a woodchuck could chuck
wood?

\question
Compute $\displaystyle\int_0^1 x^2 \, dx$.
\end{questions}
\end{verbatim}
%
then you'll get
%
\begin{questions}

\question
Why is there air?

\question

How much wood would a woodchuck chuck if a woodchuck could chuck
wood?

\question
Compute $\displaystyle\int_0^1 x^2 \, dx$.
\end{questions}

\bigskip

As the above example illustrates, you can leave blank lines between
the \verb"\question" command and the actual beginning of the
question, or before the first \verb"\question" command in the
environment, and they will be ignored.


%---------------------------------------------------------------------
\subsection{Questions with parts and subparts}

If you want a question to have several parts, then you use the
\verb"parts" environment.  For example, if you type
%
\begin{verbatim}
\begin{questions}
\question
Why is there air?

\question
What if there were no air?

\begin{parts}
\part
Describe the effect on the balloon industry.

\part
Describe the effect on the aircraft industry.
\end{parts}

\question

\begin{parts}
\part
Define the universe.  Give three examples.

\part
If the universe were to end, how would you know?

\end{parts}


\end{questions}
\end{verbatim}
%
then you'll get
\begin{questions}
\question
Why is there air?

\question
What if there were no air?

\begin{parts}
\part
Describe the effect on the balloon industry.

\part
Describe the effect on the aircraft industry.
\end{parts}

\question

\begin{parts}
\part
Define the universe.  Give three examples.

\part
If the universe were to end, how would you know?

\end{parts}


\end{questions}

\bigskip

The above example illustrates several things:
%
\begin{itemize}
\item
Parts of a question should be put into a \verb"parts" environment.

\item
If a question begins with a \verb"parts" environment, then the first
part will appear on the same line with the question number.

\item
You can leave blank lines before and after the \verb"\part" command,
and they will be ignored.
\end{itemize}


\bigskip

There is also a \verb"subparts" environment, and it works just as you
would expect.  For example, if you type
%
\begin{verbatim}
\begin{questions}
\question
This is the first question.

\question
This is the second question.

\begin{parts}
\part
This is the first part.

\part
This is the second part.

\begin{subparts}
\subpart
This is the first subpart.

\subpart
This is the second subpart.

\subpart
This is the third subpart.

\end{subparts}

\part
This is the third part.

\end{parts}

\question
\begin{parts}
\part
\begin{subparts}
\subpart
This is a subpart.

\subpart
This is another subpart.
\end{subparts}
\part
This is another part.

\end{parts}


\end{questions}
\end{verbatim}
%
then you'll get
\begin{questions}
\question
This is the first question.

\question
This is the second question.

\begin{parts}
\part
This is the first part.

\part
This is the second part.

\begin{subparts}
\subpart
This is the first subpart.

\subpart
This is the second subpart.

\subpart
This is the third subpart.

\end{subparts}

\part
This is the third part.

\end{parts}

\question
\begin{parts}
\part
\begin{subparts}
\subpart
This is a subpart.

\subpart
This is another subpart.
\end{subparts}
\part
This is another part.

\end{parts}


\end{questions}


%---------------------------------------------------------------------
\subsection{Point values for the questions}
\label{sec:points}

Each of the commands \verb"\question", \verb"\part" and
\verb"\subpart" take an optional argument, which is the number of
points for that question, part, or subpart.  The default is that the
point value will be inserted at the beginning of the question (or
part, or subpart) in parentheses, but if you give the command
\verb"\pointsinmargin", then the point values will be set in the left
margin.  For example, if you type
%
\begin{verbatim}
\begin{questions}
\question[20]
Why is there air?


\question
What if there were no air?

\begin{parts}
\part[10]
Describe the effect on the balloon industry.

\part[10]
Describe the effect on the aircraft industry.
\end{parts}

\end{questions}
\end{verbatim}
%
then, with the default setup, you'll get
\nopointsinmargin
\begin{questions}
\question[20]
Why is there air?


\question
What if there were no air?

\begin{parts}
\part[10]
Describe the effect on the balloon industry.

\part[10]
Describe the effect on the aircraft industry.
\end{parts}

\end{questions}
\bigskip
If you give the command \verb"\pointsinmargin", then the above input
will produce instead
\pointsinmargin
\begin{questions}
\question[20]
Why is there air?


\question
What if there were no air?

\begin{parts}
\part[10]
Describe the effect on the balloon industry.

\part[10]
Describe the effect on the aircraft industry.
\end{parts}

\end{questions}

If you want to switch back and forth between the two formats during
the exam, you can do so by giving the commands \verb"\pointsinmargin"
and \verb"\nopointsinmargin" whenever you want to switch.
%---------------------------------------------------------------------
\subsubsection*{Using a substitute for the word ``points''}

If you want the point value to be inserted at the beginning of the
text of the question (i.e., using the default,
\verb"\nopointsinmargin"), but you want to label it with some word
other than ``points'', then you can change the word inserted by using
the \verb"\pointname" command.  If you give the command
%
\begin{center}
\verb"\pointname{text}"
\end{center}
%
then ``text'' will be inserted inside the parentheses immediately
after the point value.  For example, if you give the command
%
\begin{center}
\verb"\pointname{\%}"
\end{center}
%
and then type
%
\begin{verbatim}
\question[25]
Where, oh where, has my little dog gone?
\end{verbatim}
%
then you'll get
\pointname{\%}
\nopointsinmargin
%
\begin{questions}
\question[25]
Where, oh where, has my little dog gone?
\end{questions}
%
Using the default is equivalent to the command
%
\begin{center}
\verb"\pointname{ points}"
\end{center}
%
\pointname{ points}
(Note that the space following the point value must be explicitly
included.)

%---------------------------------------------------------------------
\subsubsection*{Questions that begin with a parts environment}
One thing to keep in mind is that {\em only one point value can
appear on a line, and it will be the last one to be placed there}.
This matters only if a question begins with a parts environment, or
if a part begins with a subparts environment.  In either of these
cases, the question number and part number (or the part number and
subpart number) will appear on the same line, and if both of these
commands include an optional point value, {\em only the last one
given will be used}.  For example, if you type
%
\begin{verbatim}
\begin{questions}
\question[10]
\begin{parts}
\part[5]
This is the first part.

\part[5]
This is the second part.
\end{parts}
\end{questions}
\end{verbatim}
%
then you'll get
%
\begin{questions}
\question[10]
\begin{parts}
\part[5]
This is the first part.

\part[5]
This is the second part.
\end{parts}
\end{questions}
%
Notice that the 10~points for the entire question are never mentioned
anywhere, since they would have appeared on the same line with the
5~points for the first part, and the 5~points for the part were
placed later.  This is true whether \verb"\pointsinmargin" or
\verb"\nopointsinmargin" is in effect.



%---------------------------------------------------------------------
\subsection{Including special instructions for a group of questions}
\label{sec:uplevel}

There are two commands provided for including special instructions
for specific questions: \verb"\uplevel" and \verb"\fullwidth".  These
commands allow you to give instructions that will be set with the
left indentation appropriate for the scope of the instructions.

For example, if you are inside of a parts environment, and you want
to give directions for the next few parts, then those directions
should be indented to the level of the question of which they are
parts, i.e., up one level.  If you type
%
\begin{verbatim}
\begin{questions}
\question
This is the first question.

\question
\begin{parts}
\part
This is the first part.

\uplevel{The following two parts should be answered in classical
Greek:}
\part
This is the second part.

\part
This is the third part.

\end{parts}
\end{questions}
\end{verbatim}
%
then you'll get
\begin{questions}
\question
This is the first question.

\question
\begin{parts}
\part
This is the first part.

\uplevel{The following two parts should be answered in classical
Greek:}
\part
This is the second part.

\part
This is the third part.

\end{parts}
\end{questions}




\bigskip
If you want to give instructions for a group of questions, then the
indenting for those instructions should be to the outer left margin,
i.e., up one level.  For example, if you type
%
\begin{verbatim}
\begin{questions}
\question
Approximate $\displaystyle \int_0^1 \sin x^2 \, dx$ within $.001$ of
its true value.

\uplevel{Questions \ref{exact-start} through~\ref{exact-end} should
be evaluated completely, not just approximated.}

\question
\label{exact-start}
$\displaystyle \int_0^1 \frac{x^2 \, dx}{\sqrt{1-x^2}}$

\question
$\displaystyle \int_0^1 \frac{1}{1+x^2}\, dx$

\question
\label{exact-end}
$\displaystyle \int_0^{\frac{\pi}{2}} \sin^3 x \cos x \, dx$
\end{questions}
\end{verbatim}
%
you'll get
\begin{questions}
\question
Approximate $\displaystyle \int_0^1 \sin x^2 \, dx$ within $.001$ of
its true value.

\uplevel{Questions \ref{exact-start} through~\ref{exact-end} should
be evaluated completely, not just approximated.}

\question
\label{exact-start}
$\displaystyle \int_0^1 \frac{x^2 \, dx}{\sqrt{1-x^2}}$

\question
$\displaystyle \int_0^1 \frac{1}{1+x^2}\, dx$

\question
\label{exact-end}
$\displaystyle \int_0^{\frac{\pi}{2}} \sin^3 x \cos x \, dx$
\end{questions}






\bigskip
If you want to give instructions that use the full width of the page
(rather than just going up one level of indentation), then use the
\verb"\fullwidth" command.  For example, if you type
%
\begin{verbatim}
\begin{questions}
\question
This is the first question.

\question
\begin{parts}
\part
This is the first part.

\part
This is the second part.
\begin{subparts}
\subpart
This is a subpart.

\fullwidth{When you finish this exam, you should go back and
reexamine your work, both on the earlier part of this exam and in
your life up until the day of this exam, for any errors that you may
have made.}

\subpart
This is another subpart.
\end{subparts}
\end{parts}
\end{questions}
\end{verbatim}
%
then you'll get
\begin{questions}
\question
This is the first question.

\question
\begin{parts}
\part
This is the first part.

\part
This is the second part.
\begin{subparts}
\subpart
This is a subpart.

\fullwidth{When you finish this exam, you should go back and
reexamine your work, both on the earlier part of this exam and in
your life up until the day of this exam, for any errors that you may
have made.}

\subpart
This is another subpart.
\end{subparts}
\end{parts}
\end{questions}



%---------------------------------------------------------------------
\subsubsection*{Referring to specific questions by number}

You can use the standard \LaTeX{} commands \verb"\label" and
\verb"\ref" to refer to questions (or parts, or subparts) by number. 
For example, if you type
%
\begin{verbatim}
The first question is question number~\ref{ques:first}, but it's
question number~\ref{ques:second} that has both a good part
(part~\ref{part:good}) and a bad part (part~\ref{part:bad}).

\begin{questions}
\question
\label{ques:first}
This is the first question.

\question
\label{ques:second}
\begin{parts}
\part
\label{part:good}
This is the good part.

\part
\lable{part:bad}
This is the {\em bad\/} part.
\end{parts}

\question
Is there a question?
\end{questions}
\end{verbatim}
%
then you'll get:

\medskip

The first question is question number~\ref{ques:first}, but it's
question number~\ref{ques:second} that has both a good part
(part~\ref{part:good}) and a bad part (part~\ref{part:bad}).

\begin{questions}
\question
\label{ques:first}
This is the first question.

\question
\label{ques:second}
\begin{parts}
\part
\label{part:good}
This is the good part.

\part
\label{part:bad}
This is the {\em bad\/} part.
\end{parts}

\question
Is there a question?
\end{questions}



\bigskip

As with all other cross references in \LaTeX, you'll have to run your
file through \LaTeX{} {\em twice\/} to be sure that all the cross
references are correct.



%---------------------------------------------------------------------
\subsection{Naming the parts of a long exam}

There are two ways of naming the parts of a long exam.  The first way
uses the \verb"\uplevel" and \verb"\fullwidth" commands (see
section~\ref{sec:uplevel}), and the other way uses the standard
\verb"\part" and \verb"\section" commands.




\subsubsection*{Using {\tt fullwidth} and {\tt uplevel}}

To place a section name in the exam, just use a \verb"\fullwidth"
command (see section~\ref{sec:uplevel}) and include whatever font
changing commands that you want to use.  For example, if you type
%
\begin{verbatim}
\begin{questions}
\question
This is a question in the non-essay part of the exam.

\fullwidth{\Large\bf Essay questions}

\question
Explain how the cooling of matter in the centuries following the big
bang has influenced the British parliamentary system of government.

\fullwidth{\Large\bf Laboratory questions}

\question
In the cabinet below your laboratory bench you will find a single
edged razor blade, several C-clamps, and a bottle of whiskey.  Remove
your appendix.  Do not suture until your work has been inspected.
\end{questions}
\end{verbatim}
%
then you'll get
%
\begin{questions}
\question
This is a question in the non-essay part of the exam.

\fullwidth{\Large\bf Essay questions}

\question
Explain how the cooling of matter in the centuries following the big
bang has influenced the British parliamentary system of government.

\fullwidth{\Large\bf Laboratory questions}

\question
In the cabinet below your laboratory bench you will find a single
edged razor blade, several C-clamps, and a bottle of whiskey.  Remove
your appendix.  Do not suture until your work has been inspected.
\end{questions}






\subsubsection*{Using the standard sectioning commands}

The exam document style is built upon the standard article document
style, and so the sectioning commands used with the article document
style can be used here as well.  In particular, you can give the
commands \verb"\part", \verb"\part*", \verb"\section", and
\verb"\section*".  The definitions made in \verb"exam.sty" ensure
that if a \verb"\part" command appears {\em outside of a parts
environment} it will be interpreted as a sectioning command, while if
it appears {\em inside\/} of a parts environment, it will be
interpreted as beginning a new part of a question.



You can give these commands in the middle of a questions environment
so as not to interrupt the numbering of the questions, or you can end
a questions environment, give a sectioning command, and then start a
new questions environment (which would reset the question counter
to start again with number~1).  If you give any of these commands
while inside of a questions environment, then the section titles will
be indented to the same extent that questions are indented, unless
they are given as the argument of a \verb"\fullwidth" or
\verb"\uplevel" command.  These
commands have the advantage, however, that the unstarred versions
provide automatic numbering of the parts (or sections).
%---------------------------------------------------------------------
\subsection{Leaving space for the answers}

To leave a specific amount of blank space on the page for the answer
to a question, you should use the \verb"\vspace*" command.  For
example, the command \verb"\vspace*{1in}" inserts one inch of vertical
space after the line in which it appears.  (If it appears in between
paragraphs, then it inserts the space right there.)  You can also use
the \verb"\vspace" command, the difference being that any space
inserted by \verb"\vspace" will be deleted if it occurs at the top
of a new page, whereas space inserted by \verb"\vspace*" will never
be deleted.

If you want to equally distribute the blank space among the questions
on the page, then just put \verb"\vspace*{\fill}" after each question
on the page and use \verb"\newpage" to end the page.

%--------------------------------------------------------------------
\subsection{Changing the page size}
\label{sec:pagesize}

The exam document style arranges things so that if you print onto
standard American letter size paper (8.5~inches wide by 11~inches
high) you'll get one inch margins at the top, bottom and
sides.  If you want to change the size of these margins (or if you're
printing onto some other size paper), commands are provided to change
the size of the printed area.

To change the width of the printed area, you would use the
\verb"\extrawidth" command.  The \verb"\extrawidth" command takes one
argument and enlarges the width of the printed area by the amount of
the argument.  It keeps the printed area centered as it changes its
width.  If the argument is negative, then the width of the printed
area is decreased.

For example, to enlarge the left and right margins by one half inch
each, you would use the command
\begin{center}
  \verb"\extrawidth{-1in}"
\end{center}
since the printed region must shrink by one inch to allow an
additional one half inch on both sides.  To decrease the left and
right margins to three quarters of an inch each, you would use the
command 
\begin{center}
  \verb"\extrawidth{.5in}"
\end{center}
since the printed region must grow by one half inch to decrease both
margins by one quarter of an inch.

To change the height of the printed area, you must choose whether the
top or the bottom of the printed area (or possibly both) should move.
The commands for this are principally intended to allow additional
room for large headers and footers, and so they are called
\verb"\extraheadheight" and \verb"\extrafootheight".  For a full
description of these commands, see section~\ref{sec:extra-room}.

To move the top of the printed region (and any header that's present)
downwards, you use the command \verb"\extraheadheight".  This command
takes one argument and moves the top of the text and the header down
by this amount (keeping the distance between header and text
constant).  Thus, to increase the top margin by three quarters of an
inch, you would give the command
\begin{center}
  \verb"\extraheadheight{.75in}"
\end{center}
To decrease the top margin by one half inch, you would give the
command 
\begin{center}
  \verb"\extraheadheight{-.5in}"
\end{center}
The \verb"\extraheadheight" command takes an optional argument to
provide a top margin on the first page that's different from that on
all other pages.  For an explanation of this, see
section~\ref{sec:extra-room}.


To move the bottom of the printed region (and any footer that's
present) upwards, you use the command \verb"\extrafootheight".  This
command takes one argument, and moves the bottom of the text and the
footer up by this amount (keeping the distance between footer and text
constant).  Thus, to increase the bottom margin by three quarters of an
inch, you would give the command
\begin{center}
  \verb"\extrafootheight{.75in}"
\end{center}
To decrease the bottom margin by one half inch, you would give the
command
\begin{center}
  \verb"\extrafootheight{-.5in}"
\end{center}
The \verb"\extrafootheight" command takes an optional argument to
provide a bottom margin on the first page that's different from that
on all other pages.  For an explanation of this, see
section~\ref{sec:extra-room}.



%--------------------------------------------------------------------
%---------------------------------------------------------------------
\section{Headers and footers}


The following sections explain all of the technicalities of the
commands that deal with headers and footers.  There are a number of
things to explain here, and so you may find it easier to skip this
section and instead look at the examples in
sections~\ref{sec:beginexamples} through~\ref{sec:endexamples} (on
pages~\pageref{sec:beginexamples} through~\pageref{sec:endexamples}).
You can then refer back to the technical sections for the full story
on whatever isn't clear from the examples.

%---------------------------------------------------------------------
\subsection{Page styles: Headers and/or footers}

It's the \verb"\pagestyle" command that determines whether the exam
will have headers, footers, both, or neither.  The contents of the
header and footer are specified using the commands described in
sections~\ref{sec:header} through~\ref{sec:rules}, but it's the
\verb"\pagestyle" command that determines whether the header and
footer that you construct will actually be placed onto the page.  The
\verb"\pagestyle" command should be given after the
\verb"\documentstyle" command, and before the \verb"\begin{document}".

To have both a header and a footer, give the command
%
\begin{center}
\verb"\pagestyle{headandfoot}"
\end{center}
%
If you want every page to have a header but no footer, give the
command
%
\begin{center}
\verb"\pagestyle{head}"
\end{center}
%
To give every page a foot but no head, give the command
%
\begin{center}
\verb"\pagestyle{foot}"
\end{center}
%
Finally, to omit both the header and the footer from the page, give
the command
%
\begin{center}
\verb"\pagestyle{empty}"
\end{center}


\bigskip


As is true in all \LaTeX{} document styles, you can change the page
style used on a single page by giving the command
%
\begin{center}
\verb"\thispagestyle{somestyle}"
\end{center}
%
somewhere on that page (where \verb"somestyle" is the style that you
want to use on that page).  This is most often needed if you use the
\verb"\maketitle" command, since that command inserts a
\verb"\thispagestyle{plain}" immediately following the title.  If you
use the \verb"\maketitle" command and you want the entire document to
use \verb"\pagestyle{headandfoot}", then you'll need to put the
command \verb"\thispagestyle{headandfoot}" immediately after the
\verb"\maketitle" command to override the \verb"\thispagestyle{plain}"
that is inserted by \verb"\maketitle".
 

%---------------------------------------------------------------------
\subsection{The three parts of the header} 
\label{sec:header}
The header is specified in three parts:
%
\begin{itemize}
\item
One part to be left justified.

\item
One part to be centered.

\item
One part to be right justified.
\end{itemize}
%
There are two different ways in which you can specify the three parts
of the header.  The first uses the commands \verb"\lhead",
\verb"\chead", and \verb"\rhead", each of which takes an optional
argument to specify a different header for the first page (see
section~\ref{sec:lhead}). The second uses the single command
\verb"\header" to specify all three parts of the header, or the
commands \verb"\firstpageheader" and \verb"\runningheader" to specify
a different header for the first page (see
section~\ref{sec:runningheader}).


%--------------------------------------------------------------------
\subsubsection{Using lhead, chead and rhead}
\label{sec:lhead}

The command \verb"\lhead{Text}" puts ``Text'' into the left justified
part of the header on every page.  The command \verb"\lhead[Text
1]{Text 2}" puts ``Text~1'' into the left justified header on the
first page and ``Text~2'' into the left justified header on all other
pages.  The commands \verb"\chead" and \verb"\rhead" have similar
effects on the centered and right justified parts of the header.


For example, to put the header 
\samplehead{Math 115}{Second Exam}{July 4, 1776}{}
on every page of the exam, you would give the commands
%
\begin{verbatim}
\lhead{Math 115}
\chead{Second Exam}
\rhead{July 4, 1776}
\end{verbatim}

If you want any of the three parts to have a special version to be
used only on the first page, then you just include that special
version as an optional argument (enclosed in square brackets) to the
command.  For example, if you want the above header for the first
page, but on all pages after the first you want to have the header
\samplehead{Math 115}{Second Exam (Continued)}{July 4, 1776}{}
then you would give the commands
%
\begin{verbatim}
\lhead{Math 115}
\chead[Second Exam]{Second Exam (Continued)}
\rhead{July 4, 1776}
\end{verbatim}


You can leave one or more of the three parts empty.  To have the
header
\samplehead{Math 115}{Second Exam}{July 4, 1776}{}
on the first page, with the header
\samplehead{Math 115}{}{Second Exam (Continued)}{}
on all other pages, you would give the commands
%
\begin{verbatim}
\pagestyle{headandfoot}
\lhead{Math 115}
\chead[Second Exam]{}
\rhead[July 4, 1776]{Second Exam Continued)}
\end{verbatim}
%

Any of the three parts of the header can have multiple lines.  To
specify where the line breaks should go, you just type \verb"\\". 
Thus, to have the header
\samplehead{\bf\large Math 115\\Professor Hilbert}{}
       {\bf\large First Exam\\July 4, 1776}{}
appear on every page, you would give the commands
%
\begin{verbatim}
\lhead{\bf\large Math 115\\Professor Hilbert}
\chead{}
\rhead{\bf\large First Exam\\July 4, 1776}
\end{verbatim}

%--------------------------------------------------------------------
\subsubsection{Using header, firstpageheader and runningheader}
\label{sec:runningheader}


The command \verb"\header{Text 1}{Text 2}{Text 3}" puts ``Text~1''
into the left justified header, ``Text~2'' into the centered header
and ``Text~3'' into the right justified header on every page.  If you
want the header on the first page to be different from that on the
other pages, then you should use the commands \verb"\firstpageheader"
and \verb"\runningheader", which also take three arguments and affect
either the first page or all pages except the first.


For example, to put the header
\samplehead{Math 115}{Second Exam}{July 4, 1776}{}
on every page of the exam, you would give the command
%
\begin{verbatim}
\header{Math 115}{Second Exam}{July 4, 1776}
\end{verbatim}

If you want to have different header on the first page from the header
on all other pages, you would use the commands \verb"\firstpageheader"
and \verb"\runningheader" instead of \verb"\header".
For example, if you want the above header for the first
page, but on all pages after the first you want to have the header
\samplehead{Math 115}{Second Exam (Continued)}{July 4, 1776}{}
then you would give the commands
%
\begin{verbatim}
\firstpageheader{Math 115}{Second Exam}{July 4, 1776}
\runningheader{Math 115}{Second Exam (Continued)}{July 4, 1776}
\end{verbatim}


You can leave one or more of the three parts empty.  To have the
header
\samplehead{Math 115}{Second Exam}{July 4, 1776}{}
on the first page, with the header
\samplehead{Math 115}{}{Second Exam (Continued)}{}
on all other pages, you would give the commands
%
\begin{verbatim}
\firstpageheader{Math 115}{Second Exam}{July 4, 1776}
\runningheader{Math 115}{}{Second Exam (Continued)}
\end{verbatim}
%

Any of the three parts of the header can have multiple lines.  To
specify where the line breaks should go, you just type \verb"\\". 
Thus, to have the header
\samplehead{\bf\large Math 115\\Professor Hilbert}{}
       {\bf\large First Exam\\July 4, 1776}{}
appear on every page, you would give the command
%
\begin{verbatim}
\header{\bf\large Math 115\\Professor Hilbert}%
       {}%
       {\bf\large First Exam\\July 4, 1776}
\end{verbatim}

%---------------------------------------------------------------------
\subsubsection*{Leaving extra room for multiple line headers}

See section~\ref{sec:extra-room} for a description of the
\verb"\extraheadheight" command.


%---------------------------------------------------------------------

\subsection{The three parts of the footer}
\label{sec:footer}

The footer is composed of three parts, the whole setup being similar
to that for the header (see section~\ref{sec:header}).  There are two
different ways in which you can specify the three parts of the footer.
The first uses the commands \verb"\lfoot", \verb"\cfoot", and
\verb"\rfoot", each of which takes an optional argument to specify a
different footer for the first page (see section~\ref{sec:lfoot}). The
second uses the single command \verb"\footer" to specify all three
parts of the footer, or the commands \verb"\firstpagefooter" and
\verb"\runningfooter" to specify a different footer for the first page
(see section~\ref{sec:runningfooter}).





%--------------------------------------------------------------------
\subsubsection{Using lfoot, cfoot and rfoot}
\label{sec:lfoot}

The command \verb"\lfoot{Text}" puts ``Text'' into the left justified
part of the footer on every page.  The command
\verb"\lfoot[Text 1]{Text 2}" puts ``Text~1'' into the left justified
footer on the first page and ``Text~2'' into the left justified footer
on all other pages.  The commands \verb"\cfoot" and \verb"\rfoot" have
similar effects on the centered and right justified parts of the
footer. 


For example, to have an empty footer on the first page and the footer
\samplefoot{}{}{Page 3 of 5}{}
on all pages after the first, you would give the commands
%
\begin{verbatim}
\lfoot{}
\cfoot{}
\rfoot[]{Page \thepage\ of \numpages}
\end{verbatim}
%
(For an explanation of the \verb"\numpages" command, see
section~\ref{sec:numpages}.)  

%--------------------------------------------------------------------

\subsubsection{Using footer, firstpagefooter and runningfooter}
\label{sec:runningfooter}

The command \verb"\footer{Text 1}{Text 2}{Text 3}" puts ``Text~1''
into the left justified footer, ``Text~2'' into the centered footer
and ``Text~3'' into the right justified footer on every page.  If you
want the footer on the first page to be different from that on the
other pages, then you should use the commands \verb"\firstpagefooter"
and \verb"\runningfooter", which also take three arguments and affect
either the first page or all pages except the first.


For example, to have an empty footer on the first page and the footer
\samplefoot{}{}{Page 3 of 5}{}
on all pages after the first, you would give the commands
%
\begin{verbatim}
\firstpagefooter{}{}{}
\runningfooter{}{Page \thepage\ of \numpages}{}
\end{verbatim}
%
(For an explanation of the \verb"\numpages" command, see
section~\ref{sec:numpages}.)  


%---------------------------------------------------------------------
\subsubsection*{Leaving extra room for multiple line footers}

See section~\ref{sec:extra-room} for a description of the
\verb"\extrafootheight" command.




%---------------------------------------------------------------------
\subsection{Leaving extra room for multiple line headers and footers}
\label{sec:extra-room}

\subsubsection*{Headers}
If you specify more than one or two lines for any part of the header,
then you may want to move the header down slightly so that it doesn't
run off of the top of the paper.  The command for this is
\verb"\extraheadheight".  You can also use the \verb"\extraheadheight"
command to adjust the size of the text area.  The
\verb"\extraheadheight" command never changes the distance between the
header and the text.

For example, to move the header and the text a half inch
down from the top of the page, you would give the command
%
\begin{center}
\verb"\extraheadheight{.5in}"
\end{center}
%
You can also specify a negative distance to \verb"extraheadheight" to
move the header up closer to the top of the paper.  For example, the
command
%
\begin{center}
\verb"\extraheadheight{-.25in}"
\end{center}
%
moves the header one quarter inch closer to the top of the paper.

If you want to have a different value for \verb"\extraheadheight" on
the first page from that on the pages after the first, then use the
same syntax as in the \verb"\lhead", \verb"\chead", and \verb"\rhead"
commands: Include an optional argument giving the extra head height
for the first page, and the required argument will apply only to
those pages after the first.  For example, the command
%
\begin{center}
\verb"\extraheadheight[.5in]{.25in}"
\end{center}
%
gives a half inch of extra head height on the first page and a
quarter inch of extra head height on all pages after the first. 
If you say
%
\begin{center}
\verb"\extraheadheight[.5in]{}"
\end{center}
%
then this will be interpreted as if it was
%
\begin{center}
\verb"\extraheadheight[.5in]{0in}"
\end{center}
%
Note that the braces {\em must\/} appear.


If you give an \verb"\extraheadheight" command, it should be after the
\verb"\documentstyle" command but before the \verb"\begin{document}"
command.  The \verb"\extraheadheight" command can also be used to
change the size of the text region (see section~\ref{sec:pagesize}).




\subsubsection*{Footers}
To leave extra room for multiple line footers, you use the command
\verb"\extrafootheight".  Thus, to move the footer one half inch
higher up on the paper, you would give the command
%
\begin{center}
\verb"\extrafootheight{.5in}"
\end{center}
%
If you wanted to move the footer an eighth of an inch lower down on
the paper, you would give the command
%
\begin{center}
\verb"\extrafootheight{-.125in}"
\end{center}

If you want to have a different value for \verb"\extrafootheight" on
the first page from that on the pages after the first, then use the
same syntax as in the \verb"\lfoot", \verb"\cfoot", and \verb"\rfoot"
commands: Include an optional argument giving the extra foot height
for the first page, and the required argument will apply only to
those pages after the first.  For example, the command
%
\begin{center}
\verb"\extrafootheight[.5in]{.25in}"
\end{center}
%
gives a half inch of extra foot height on the first page and a
quarter inch of extra foot height on all pages after the first. 
If you say
%
\begin{center}
\verb"\extrafootheight[.5in]{}"
\end{center}
%
then this will be interpreted as if it was
%
\begin{center}
\verb"\extrafootheight[.5in]{0in}"
\end{center}
%
Note that the braces {\em must\/} appear.


If you give an \verb"\extrafootheight" command, it should be after the
\verb"\documentstyle" command but before the \verb"\begin{document}"
command.  The \verb"\extrafootheight" command can also be used to
change the size of the text region (see section~\ref{sec:pagesize}).






%---------------------------------------------------------------------
\subsection{Horizontal rules}
\label{sec:rules}

The \verb"exam" document style make it easy to put a horizontal rule
under the header and one above the footer.  It is also easy to do
this for the pages after the first page without affecting the first
page.

\begin{itemize}
\item
The command \verb"\runningheadrule" puts a horizontal rule below the
header on all pages after the first.

\item
The command
\verb"\firstpageheadrule" puts a rule under the header of only the
first page.

\item
The command \verb"\headrule" is equivalent to the two
commands \verb"\firstpageheadrule" and \verb"\runningheadrule".

\item
The command \verb"\runningfootrule" puts a horizontal rule above the
footer on all pages after the first.

\item
The command
\verb"\firstpagefootrule" puts a rule above the footer of only the
first page.

\item
The command \verb"\footrule" is equivalent to the two
commands \verb"\firstpagefootrule" and \verb"\runningfootrule".

\end{itemize}
%
For example, to have the header
\samplehead{Math 115}{First Exam}{July 4, 1776}{}
on the first page, with the header
\samplehead{Math 115}{First Exam}{July 4, 1776}{\hrule}
on all pages after the first, give the commands
%
\begin{verbatim}
\runningheadrule
\lhead{Math 115}
\chead{First Exam}
\rhead{July 4, 1776}
\end{verbatim}


\bigskip

To have no footer on the first page, and the footer
\samplefoot{\hrule}{}{Page 3 of 5}{}
on all pages after the first, you would give the commands
%
\begin{verbatim}
\runningfootrule
\lfoot{}
\cfoot[]{Page \thepage\ of \numpages}
\rfoot{}
\end{verbatim}






%---------------------------------------------------------------------
\subsection{Listing the number of pages in the exam}
\label{sec:numpages}

The \verb"exam" document style defines the command \verb"\numpages"
so that it will expand to the number of pages in the exam.  Thus, to
have the footer
\samplefoot{}{}{Page \thepage\ of \numpages}{}
you should give the commands
%
\begin{verbatim}
\lfoot{}
\cfoot{Page \thepage\ of \numpages}
\rfoot{}
\end{verbatim}
%
For a description of the commands \verb"\lfoot", \verb"\cfoot", and
\verb"\rfoot", see section~\ref{sec:footer}.

As with all other cross referencing commands in \LaTeX, you'll have to
run the file through \LaTeX{} {\em twice\/} to be sure that
\verb"\numpages" is correct.

%---------------------------------------------------------------------
\subsection{Testing for the last page}
\label{sec:lastpage}

If you want to vary the text that appears in the header or footer on
the last page of the exam, you  should use the command
\verb"\iflastpage".  The command
%
\begin{center}
\verb"\iflastpage{Text 1}{Text 2}"
\end{center}
%
expands to `Text~1' on the last page, and to `Text~2' on all
pages before the last.  Thus, to have the footer
\samplefoot{}{}{Please go on to the next page\ldots}{}
on all pages before the last page, and the footer
\samplefoot{}{}{End of exam}{}
on the last page, you would give the commands
%
\begin{verbatim}
\lfoot{}
\cfoot{\iflastpage{End of exam}{Please go on to the next page\ldots}}
\rfoot{}
\end{verbatim}
%
For a description of the commands \verb"\lfoot", \verb"\cfoot", and
\verb"\rfoot", see section~\ref{sec:footer}.

As with all other cross referencing commands in \LaTeX, you'll have to
run the file through \LaTeX{} {\em twice\/} to be sure that
\verb"\iflastpage" correctly detects the last page.

%--------------------------------------------------------------------
\subsection{Treating odd and even numbered pages differently}

If you'd like odd and even numbered pages to be treated differently
(perhaps because you'll be printing onto both sides of the paper), you
should use the \verb"\oddeven" command.

The \verb"\oddeven" command takes two arguments.  If the current page
number is odd it expands to the first argument; otherwise, it expands
to the second argument.

For example, to have the page number printed in the right head on odd
numbered pages and in the left head on even numbered pages, you would
use the commands
\begin{center}
\begin{verbatim}
\rhead{\oddeven{\thepage}{}}
\lhead{\oddeven{}{\thepage}}
\chead{}
\end{verbatim}
\end{center}
If you wanted the footer of the even numbered pages to be empty and
the footer of the odd numbered pages to contain the message ``Please
continue\dots'', except that the last page of the exam should have an empty
footer whether its page number is even or odd, then you would use the
commands 
\begin{center}
\begin{verbatim}
\lfoot{}
\rfoot{}
\cfoot{\oddeven{\iflastpage{}{Please continue\dots}}{}}
\end{verbatim}
\end{center}
(see section~\ref{sec:lastpage} for an explanation of
\verb"\iflastpage"). 

Although the \verb"\oddeven" command can be used anywhere in the
document (i.e., not just in headers and footers), it is reliable only
in headers and footers.  This is because \LaTeX{} generally processes
more text than can fit on the current page before it outputs a page.
When the \verb"\oddeven" command is encountered it will act as though
it will appear on the current page whether it appears on that page or
on the following page.

%--------------------------------------------------------------------
\subsection{Examples}

\begin{example}
\label{sec:beginexamples}
To have the header
\samplehead{Math 115}{First Exam}{July 4, 1776}{}
on the first page, the header
\samplehead{Math 115}{First Exam, Page 2 of 5}{July 4, 1776}{\hrule}
on all pages after the first, and no footer on any page, give the
commands
%
\begin{verbatim}
\pagestyle{head}
\runningheadrule
\lhead{Math 115}
\chead[First Exam]{First Exam, Page \thepage\ of \numpages}
\rhead{July 4, 1776}
\end{verbatim}
%
Alternatively, you could give the commands
%
\begin{verbatim}
\pagestyle{head}
\runningheadrule
\firstpageheader{Math 115}{First Exam}{July 4, 1776}
\runningheader{Math 115}%
              {First Exam, Page \thepage\ of \numpages}%
              {July 4, 1776}
\end{verbatim}
%
\end{example}


\begin{example}
To have the header
\samplehead{\large\bf Mathematics 115\\
            First Exam, July 4, 1776}%
           {}{\large\bf Name:\enspace\hbox to 2in{\hrulefill}}{}
on the first page, the header
\samplehead{\large\bf Mathematics 115\\
            First Exam, July 4, 1776}%
           {}{}{}
on all pages after the first, an empty foot on the first page, and
the footer
\samplefoot{}{}{Page 2}{}
on all pages after the first, give the commands
%
\begin{verbatim}
\pagestyle{headandfoot}
\lhead{\large\bf Mathematics 115\\ First Exam, July 4, 1776}
\chead{}
\rhead[\large\bf Name:\enspace\hbox to 2in{\hrulefill}]{}
\lfoot{}
\cfoot[]{Page \thepage}
\rfoot{}
\end{verbatim}
%
Alternatively, you could give the commands
\begin{verbatim}
\pagestyle{headandfoot}
\firstpageheader{\large\bf Mathematics 115\\
                 First Exam, July 4, 1776}%
                {}{\large\bf Name:\enspace\hbox to 2in{\hrulefill}}
\runningheader{\large\bf Mathematics 115\\
               First Exam, July 4, 1776}{}{}
\firstpagefooter{}{}{}
\runningfooter{}{Page \thepage}{}
\end{verbatim}
\end{example}

\begin{example}
To have the header
\samplehead{}{Wellesley College\\
              Second Semester Final Examination, Spring 1993\\
              Mathematics 115}{}{}
on the first page, the header
\samplehead{}{Wellesley College\\
              Second Semester Final Examination, Spring 1993\\
              Mathematics 115 (Continued)}{}{}
on all pages after the first, the footer
\samplefoot{}{}{Page 3 of 10}{Please go on to the next page\ldots}
on all pages {\em except the last\/} page, and the footer
\samplefoot{}{}{Page 10 of 10}{End of exam.}
on the last page, give the commands
%
\begin{verbatim}
\pagestyle{headandfoot}
\extraheadheight{.25in}
\lhead{}
\chead[Wellesley College\\
       Second Semester Final Examination, Spring 1993\\
       Mathematics 115]
      {Wellesley College\\
       Second Semester Final Examination, Spring 1993\\
       Mathematics 115 (Continued)}
\rhead{}
\lfoot{}
\cfoot{Page \thepage\ of \numpages}
\rfoot{\iflastpage{End of exam.}{Please go on to the next page\ldots}}
\end{verbatim}
%
Alternatively, you could give the commands
\begin{verbatim}
\pagestyle{headandfoot}
\extraheadheight{.25in}
\firstpageheader{}{Wellesley College\\
                   Second Semester Final Examination, Spring 1993\\
                   Mathematics 115}{}
\runningheader{}{Wellesley College\\
                 Second Semester Final Examination, Spring 1993\\
                 Mathematics 115 (Continued)}{}
\footer{}{Page \thepage\ of \numpages}%
   {\iflastpage{End of exam.}{Please go on to the next page\ldots}}
\end{verbatim}

\end{example}

\begin{example}
\label{sec:endexamples}
To have the header
\samplehead{Math 115}{First Exam}{July 4, 1776}{}
on the first page, no header on the pages after the first, no footer
on the first page, and the footer
\samplefoot{\hrule}{Math 115}{First Exam}{Page 2 of 5}
on all pages after the first, give the commands
%
\begin{verbatim}
\pagestyle{headandfoot}
\runningfootrule
\lhead[Math 115]{}
\chead[First Exam]{}
\rhead[July 4, 1776]{}
\lfoot[]{Math 115}
\cfoot[]{First Exam}
\rfoot[]{Page \thepage\ of \numpages}
\end{verbatim}
%
Alternatively, you could give the commands
\begin{verbatim}
\pagestyle{headandfoot}
\runningfootrule
\firstpageheader{Math 115}{First Exam}{July 4, 1776}
\runningheader{}{}{}
\firstpagefooter{}{}{}
\runningfooter{Math 115}{First Exam}{Page \thepage\ of \numpages}
\end{verbatim}
%
\end{example}
%--------------------------------------------------------------------


\end{document}