Path: utzoo!attcan!uunet!mailrus!ncar!boulder!grunwald From: grunwald@foobar.colorado.edu (Dirk Grunwald) Newsgroups: comp.text.tex Subject: Re: LaTeX style file for tests/questionnaires Message-ID: <22105@boulder.Colorado.EDU> Date: 11 Jun 90 17:19:12 GMT References: <26047.2672706f@ccavax.camb.com> Sender: news@boulder.Colorado.EDU Reply-To: grunwald@foobar.colorado.edu Organization: University of Colorado at Boulder Lines: 378 In-reply-to: tinkelman@ccavax.camb.com's message of 10 Jun 90 20:08:14 GMT Here's something I whipped together last semester. Example included. Please let me know if you improve on it, because it's pretty bare-bones right now. #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'class-example.tex' <<'END_OF_FILE' X\documentstyle[class]{article} X\def\ClassName{Csci} X\def\ClassNumber{2555} X\def\ClassExam{Final~Exam} X\handedout{whenver} %% included in headers/footers X\Solutions %% optionally include solutions X %% can also say \answerstrue X\begin{document} X X\begin{center} XExample of Class Style: X X\listofproblems %% a table of problems & point values X\end{center} X X\begin{problems} X\problem \Points{20} X This is the question X\begin{answer} XThis is the answer X\end{answer} X X\problem X\begin{enumerate} X \item\Points{10}[labelname] X X This ia a sub-probem with an optional label name for reference X X \begin{answer}[3in] X This is an answer that will leave 3in of space when answers X aren't being printed. X \end{answer} X X \item\Points{5} X \ifanswers include some non-boxed in answer X \else \vskip 2in \fi X X X \item\Points{3} X This problem refers to the label in problem \ref{labelname}. X\end{enumerate} X\end{problems} X\end{document} END_OF_FILE if test 924 -ne `wc -c <'class-example.tex'`; then echo shar: \"'class-example.tex'\" unpacked with wrong size! fi # end of 'class-example.tex' fi if test -f 'class.sty' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'class.sty'\" else echo shar: Extracting \"'class.sty'\" \(7398 characters\) sed "s/^X//" >'class.sty' <<'END_OF_FILE' X%% X%% class.sty: Homework & Exam Style: X%% X%% X%% This style is used for homeworks and exams. You should X%% define \ClassName to be the class name and X%% \ClassNumber to be the class number. If this is an X%% exam, you should define \ClassExam to be the kind of X%% exam (final, midterm, whatever). If you're making an X%% exam, you should also say \pagestyle{examheaders} X%% and \thispagestyle{firstexamheader} in your document preamble. X%% X%% \listofproblems will print a table listing the problem X%% numbers, the page they appear on and the number of X%% points they're worth. You're also left with space for X%% to enter the final problem score. Points information X%% is recorded in the file \currentjob.lop, much like X%% table of contents and list of figures data. X%% X%% The ``problems'' environment is currently an alias for X%% ``enumerate''; however, you should you \problem rather X%% than \item for the top level problems. This will add X%% formatting info to the list-of-problems. X%% X%% Before each problem, \Points{} will print X%% ``[Points ]'' and record the points in the .lop X%% file. An optional argument, \Points{}[