summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mathexam/mathexam.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-08-18 18:35:29 +0000
committerKarl Berry <karl@freefriends.org>2007-08-18 18:35:29 +0000
commitde5c7660489022ca4eaf6e610370ade975c45fd6 (patch)
tree77cc65eb4316861aecd15f0fc309fbf919035f60 /Master/texmf-dist/tex/latex/mathexam/mathexam.sty
parentd39bc0334b38efc0575b9d46454fde0da5c1f1f6 (diff)
new package mathexam
git-svn-id: svn://tug.org/texlive/trunk@4759 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mathexam/mathexam.sty')
-rw-r--r--Master/texmf-dist/tex/latex/mathexam/mathexam.sty95
1 files changed, 95 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/mathexam/mathexam.sty b/Master/texmf-dist/tex/latex/mathexam/mathexam.sty
new file mode 100644
index 00000000000..a5a05ce4f9d
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/mathexam/mathexam.sty
@@ -0,0 +1,95 @@
+%%
+%% This is file `mathexam.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% mathexam.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2007 by Jan Hlavacek
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.2 of this license
+%% or (at your option) any later version. The latest version of this
+%% license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.2 or later is part of all distributions of LaTeX version
+%% 1999/12/01 or later.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{mathexam}
+ [2007/07/30 v1.00 Package for typesetting exams]
+\newif\ifExamHdr
+\ExamHdrtrue
+\DeclareOption{nohdr}{\ExamHdrfalse}
+\ProcessOptions
+\ifExamHdr
+\RequirePackage{fancyhdr}
+\RequirePackage{lastpage}
+\RequirePackage{ifthen}
+\fi
+\newcommand{\ExamName}[1]{\def\@xamname{#1}}
+\newcommand{\ExamClass}[1]{\def\@xamclass{#1}}
+\newcommand{\ExamHead}[1]{\def\@xamrighthdr{#1}}
+\def\@xamname{\relax}
+\def\@xamclass{\relax}
+\def\@xamrighthdr{\relax}
+\ifExamHdr
+\pagestyle{fancy}
+
+\lhead{\@xamclass}
+\chead{\@xamname}
+\rhead{Page \thepage\ of \pageref{LastPage}}
+
+\rfoot{\ifthenelse{\value{page}=\pageref{LastPage}}{The End.}{Cont.}}
+\cfoot{}
+\AtBeginDocument{
+\begin{center}
+ \large\scshape \@xamclass \hfill \@xamname \hfill \@xamrighthdr
+\end{center}}
+
+\thispagestyle{empty}
+\fi
+\newcommand{\answ@r}[1][\fill]{%
+ \nopagebreak\vspace{#1}\par\nopagebreak\hfill\hbox to
+ .5\columnwidth{Answer:\hrulefill}\vspace{\baselineskip}}
+
+\newcommand{\addansw@r}[1][\baselineskip]{%
+ \nopagebreak\vspace{#1}\par\nopagebreak\hfill\hbox to
+ .5\columnwidth{Answer:\hrulefill}\vspace{\baselineskip}}
+\newcommand{\answ@rstar}[2][\fill]{%
+ \nopagebreak\vspace{#1}\par\nopagebreak\hfill\hbox to
+ .5\columnwidth{#2\hrulefill}\vspace{\baselineskip}}
+
+\newcommand{\addansw@rstar}[2][\baselineskip]{%
+ \nopagebreak\vspace{#1}\par\nopagebreak\hfill\hbox to
+ .5\columnwidth{#2\hrulefill}\vspace{\baselineskip}}
+\def\answer{%
+ \def\e@t*{}%
+ \def\n@xt{\if\noexpand\myn@@xt*%
+ \expandafter\expandafter\expandafter\answ@rstar\expandafter\e@t\else%
+ \expandafter\answ@r\fi}%
+ \futurelet\myn@@xt\n@xt}
+
+\def\addanswer{%
+ \def\e@t*{}%
+ \def\n@xt{\if\noexpand\myn@@xt*%
+ \expandafter\expandafter\expandafter\addansw@rstar\expandafter\e@t\else%
+ \expandafter\addansw@r\fi}%
+ \futurelet\myn@@xt\n@xt}
+\newcommand{\noanswer}[1][\fill]{\nopagebreak\vspace{#1}\par}
+\newcommand{\ExamNameLine}{%
+\par
+\vspace{\baselineskip}
+Name:\hrulefill\relax
+\par}
+\newcommand{\ExamInstrBox}[1]{\begin{center}\vspace{\baselineskip}%
+ \fbox{\fbox{\parbox{.8\hsize}{#1}}}\end{center}}
+
+\endinput
+%%
+%% End of file `mathexam.sty'.