newexam+shield.sty 4.05 KB
Newer Older
Loïc Barrault's avatar
Loïc Barrault committed
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

\newenvironment{mainfont}{\begin{sf}}{\end{sf}}
\newcommand{\mybf}{\bf\sf}

%% \renewenvironment{mainfont}{\begin{tt}}{\end{tt}}
%% \renewcommand{\mybf}{\bf\tt}
\usepackage{graphicx}

\pagestyle{empty}

\setlength{\parskip}{2mm}
\setlength{\parindent}{0mm}
\setlength{\topmargin}{-25mm}
\setlength{\textheight}{270mm}
\setlength{\oddsidemargin}{-5mm}
\setlength{\textwidth}{166mm}

\newcommand{\examsection}[1]%
   {\begin{center}{\mybf SECTION #1}\end{center}}

\newlength{\mymarklength}

\newcommand{\mymarktext}[1]{%
   \settowidth{\mymarklength}{#1}%
   \addtolength{\mymarklength}{-3mm}%
   \rule{\mymarklength}{0mm}%
   \hfill
   \makebox[0mm][l]{\hspace*{-1\mymarklength}\hspace*{2mm}#1}}

\newcommand{\mymark}[1]{\mymarktext{[#1 marks]}}
\newcommand{\mymarkone}{\mymarktext{[1 mark]}}

\newcommand{\mypercent}[1]{\mymarktext{[#1\%]}}

\newcounter{questionnumber}
\newcounter{qupartnumber}[questionnumber]
\newcounter{exitemnumber}[qupartnumber]

\newenvironment{question}%
    {\stepcounter{questionnumber}%
     \begin{list}{}{\setlength{\leftmargin}{6mm}
                    \setlength{\labelwidth}{4mm}
                    \setlength{\labelsep}{2mm}
                    \setlength{\topsep}{4mm}
                    \setlength{\rightmargin}{4mm}}%
     \item[{\mybf\arabic{questionnumber}.}]}%
    {\end{list}}

\newenvironment{qupart}%
    {\stepcounter{qupartnumber}%
     \begin{list}{}{\setlength{\leftmargin}{10mm}
                    \setlength{\labelwidth}{4mm}
                    \setlength{\labelsep}{6mm}
                    \setlength{\topsep}{-1mm}
                    \setlength{\itemsep}{0mm}
                    \setlength{\rightmargin}{0mm}}%
     \item[{\alph{qupartnumber})}]}%
    {\end{list}}


\newenvironment{exlist}{\begin{list}{}{%
    \setlength{\leftmargin}{12mm}
    \setlength{\labelwidth}{8mm}
    \setlength{\labelsep}{4mm}
    \setlength{\topsep}{3mm}
    \setlength{\itemsep}{3mm}
    \setlength{\rightmargin}{0mm}}}{\end{list}}

\newcommand{\exitem}%
    {\stepcounter{exitemnumber}%
     \item[{(\roman{exitemnumber})}]}

\newenvironment{exam}%
    {\newpage \begin{mainfont} \dataProvidedText\myheader \\[5mm]
%     {\centerline{\includegraphics[height=3cm]{/home/robertg/images/shield.bw.eps}}\\[1mm]
     {\centerline{\includegraphics[height=3cm]{shield.eps}}\\[1mm]
     \centerline{\mybf\universitytext}\\[9mm]
     \departmenttext \\[3mm]
     \examdatetext \hspace*{10mm} \examtimetext \\[3mm]
     \examtitletext \\[3mm] \rubrictext}}%
    {\myfooter{}\end{mainfont} }

\newcommand{\questionsend}%
   {\begin{center}\ \\ {\mybf END OF QUESTION PAPER}\end{center}}

\newcommand{\myheader}%
   {\hfill{\mybf\pressmarktext}%
    \rule[-1.5em]{0mm}{1em}}

\newcommand{\myfooter}[1]%
   {\stepcounter{mypage}\vfill
    \rule[1em]{0mm}{1em}%
    {\mybf
     \makebox[0mm][l]{\pressmarktext} \hfill%
     \makebox[0mm]{\themypage} \hfill%
     \makebox[0mm][r]{#1}}\newpage}

%% \renewcommand{\myfooter}[1]%
%%    {\vfill\myfootertext{#1}\newpage}
%%
%% \newcommand{\myfootertext}[1]%
%%    {\stepcounter{mypage}%
%%     \rule[1em]{0mm}{1em}%
%%     {\mybf
%%      \makebox[0mm][l]{\pressmarktext} \hfill%
%%      \makebox[0mm]{\themypage} \hfill%
%%      \makebox[0mm][r]{#1}}\newpage}

\newcounter{mypage}

\newcommand{\continued}%
   {\myfooter{CONTINUED}\newpage\myheader}
\newcommand{\turnover}%
   {\myfooter{TURN OVER}\newpage\myheader}


\newcommand{\examtitletext}{}
\newcommand{\examtitle}[1]{\renewcommand{\examtitletext}{#1}}
\newcommand{\degreestext}{}
\newcommand{\degrees}[1]{\renewcommand{\degreestext}{#1}}
\newcommand{\departmenttext}{}
\newcommand{\department}[1]{\renewcommand{\departmenttext}{#1}}
\newcommand{\pressmarktext}{}
\newcommand{\pressmark}[1]{\renewcommand{\pressmarktext}{#1}}
\newcommand{\examdatetext}{}
\newcommand{\examdate}[1]{\renewcommand{\examdatetext}{#1}}
\newcommand{\examtimetext}{}
\newcommand{\examtime}[1]{\renewcommand{\examtimetext}{#1}}
\newcommand{\rubrictext}{}
\newcommand{\rubric}[1]{\renewcommand{\rubrictext}{#1}}
\newcommand{\universitytext}{{\bf THE UNIVERSITY OF SHEFFIELD}}
\newcommand{\university}[1]{\renewcommand{\universitytext}{#1}}