@@ -156,6 +156,7 @@ program code.
156156\item[-s] toggles slides.
157157\item[-w] toggles NOWEB source code.
158158\item[-l] toggles letter.
159+ \item[-e] toggles exam.
159160\item[-p] toggles preamble.
160161\item[-a] toggles abstract.
161162\item[-c] toggles contents.
@@ -215,16 +216,21 @@ long_usage="${long_usage}\n-c\ttoggles contents"
215216 shift;;
216217@
217218
218- We also have the letter, which is the same as for notes and the slides.
219+ We also have the letter and exam, which are the same as for notes and the
220+ slides.
219221<<variables>>=
220- options="${options}l "
221- usage="${usage} [-l]"
222+ options="${options}le "
223+ usage="${usage} [-l] [-e] "
222224long_usage="${long_usage}\n-l\ttoggles letter"
225+ long_usage="${long_usage}\n-e\ttoggles exam"
223226@ Then we do the same when processing this too.
224227<<arguments handler code>>=
225228-l)
226229 files="${files} letter.tex"
227230 shift;;
231+ -e)
232+ files="${files} exam.tex"
233+ shift;;
228234@
229235
230236Next, there are the standard files part of any repository: general
@@ -364,9 +370,12 @@ done
364370@ Now the question is what values to substitute.
365371
366372There are some values that we can substitute automatically, e.g.\ dates.
367- We will substitute [[<year>]] with the current year.
373+ We will substitute [[<year>]] with the current year, [[<date>]] with the
374+ current date and [[<iso-date>]] with the current date in ISO-format.
368375<<run sed(1) on file>>=
369376sed -i "s/<year>/$(date +%Y)/g" ${f}
377+ sed -i "s/<date>/$(date +%y%m%d)/g" ${f}
378+ sed -i "s/<iso-date>/$(date +%Y-%m-%d)/g" ${f}
370379@
371380
372381\subsection{Getting the values to substitute}
@@ -504,6 +513,17 @@ sed -i "s/<submodule_prefix>/${submodule_prefix## }/g" ${f}
504513\lstinputlisting[language={[latex]tex}]{letter.tex}
505514
506515
516+ \section{Template for exams}
517+
518+ \subsection{Main file for exam}
519+
520+ \lstinputlisting[language={[latex]tex}]{exam.tex}
521+
522+ \subsection{Makefile for exams}
523+
524+ \lstinputlisting{Makefile.exam}
525+
526+
507527\section{Template for NOWEB programs}
508528
509529\subsection{NOWEB source code}
0 commit comments