diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-07 20:49:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-07 20:49:10 +0000 |
commit | ddfe3a4eaf95167482e923d4da3de2917a7dbfbb (patch) | |
tree | 0acc1bb60b37392451f5e79e00c33c487c19abcf /Master/texmf-dist/source/latex/stex/hwexam | |
parent | a04ae5a947a6b06bc717719f6ad63e6de5cb5af6 (diff) |
stex (7apr16)
git-svn-id: svn://tug.org/texlive/trunk@40320 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/stex/hwexam')
-rw-r--r-- | Master/texmf-dist/source/latex/stex/hwexam/hwexam.dtx | 486 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/stex/hwexam/hwexam.ins | 8 |
2 files changed, 243 insertions, 251 deletions
diff --git a/Master/texmf-dist/source/latex/stex/hwexam/hwexam.dtx b/Master/texmf-dist/source/latex/stex/hwexam/hwexam.dtx index f31807d13e5..4a53b2b1c94 100644 --- a/Master/texmf-dist/source/latex/stex/hwexam/hwexam.dtx +++ b/Master/texmf-dist/source/latex/stex/hwexam/hwexam.dtx @@ -1,17 +1,16 @@ % \iffalse meta-comment % An Infrastructure for marking up Assignments -% $URL: https://svn.kwarc.info/repos/stex/trunk/sty/hwexam/hwexam.dtx $ -% $Rev: 1999 $; last modified by $Author: kohlhase $ -% $Date: 2012-01-28 08:32:11 +0100 (Sat, 28 Jan 2012) $ % Copyright (c) 2007 Michael Kohlhase, all rights reserved % this file is released under the % LaTeX Project Public License (LPPL) +% The original of this file is in the public repository at +% http://github.com/KWARC/sTeX/ % \fi % % \iffalse %<package|cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01] -%<package>\ProvidesPackage{hwexam}[2012/01/28 v0.9b homework assignments and exams] -%<cls>\ProvidesClass{hwexam}[2012/01/28 v0.9b assignment and exam documents] +%<package>\ProvidesPackage{hwexam}[2016/04/07 v1.1 homework assignments and exams] +%<cls>\ProvidesClass{hwexam}[2016/04/07 v1.1 assignment and exam documents] % %<*driver> \documentclass{ltxdoc} @@ -19,12 +18,12 @@ \usepackage{hwexam} \usepackage[show]{ed} \usepackage[hyperref=auto,style=alphabetic]{biblatex} -\bibliography{kwarc} -\usepackage[eso-foot,today]{svninfo} -\svnInfo $Id: hwexam.dtx 1999 2012-01-28 07:32:11Z kohlhase $ -\svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/hwexam/hwexam.dtx $ +\addbibresource{kwarcpubs.bib} +\addbibresource{extpubs.bib} +\addbibresource{kwarccrossrefs.bib} +\addbibresource{extcrossrefs.bib} \usepackage{stex-logo} -\usepackage{../ctansvn} +\usepackage{ctangit} \usepackage{hyperref} \makeindex \floatstyle{boxed} @@ -34,18 +33,20 @@ \begin{document}\DocInput{hwexam.dtx}\end{document} %</driver> % \fi -%\CheckSum{432} +%\CheckSum{464} % % \changes{v0.9}{2006/09/18}{First Version with Documentation} % \changes{v0.9a}{2010/06/25}{more semantic headers for exams} % \changes{v0.9b}{2010/09/20}{adding \texttt{assignment.cls}} % \changes{v0.9c}{2010/09/20}{renaming from \texttt{assignment} to \texttt{hwexam} to % avoid name clashes with existing \texttt{assignment.cls} on CTAN.} +% \changes{v1.0}{2013/12/12}{adding MathHub support} +% \changes{v1.1}{2015/11/04}{moving MathHub support out to separate package} % % \GetFileInfo{hwexam.sty} % % \MakeShortVerb{\|} -%\def\scsys#1{{{\sc #1}}\index{#1@{\sc #1}}} +% \def\scsys#1{{{\sc #1}}\index{#1@{\sc #1}}} % \def\latexml{\scsys{LaTeXML}} % % \title{\texttt{hwexam.sty/cls}: An Infrastructure for formatting Assignments @@ -56,8 +57,8 @@ % \maketitle % % \begin{abstract} -% The |hwexam| packge and class allows individual course assignment sheets and -% compond assignment documents using problem files marked up with the |problem| package. +% The |hwexam| package and class allows individual course assignment sheets and +% compound assignment documents using problem files marked up with the |problem| package. % \end{abstract} % \setcounter{tocdepth}{2}\tableofcontents\newpage % @@ -72,6 +73,9 @@ % % \subsection{Package and Class Options}\label{sec:user:options} % +% The |hwexam| class takes the \DescribeMacro{mh}|mh| option that turns on MathHub +% support. +% % The |hwexam| package and class take the options |solutions|, |notes|, |hints|, |pts|, % |min|, and |boxed| that are just passed on to the |problems| package (cf. its % documentation for a description of the intended behavior). @@ -99,7 +103,7 @@ % \subsection{Typesetting Exams} % % Furthermore, the |hwexam| package takes the option -% \DescribeMacro{multiple}|multiple| that allows to combine multiple assigment sheets into +% \DescribeMacro{multiple}|multiple| that allows to combine multiple assignment sheets into % a compound document (the assignment sheets are treated as section, there is a table of % contents, etc.). % @@ -154,14 +158,13 @@ % are just as for the |assignment| environment and (if given) overwrite the ones specified % in the |assignment| environment in the included file. % -% % \section{Limitations}\label{sec:limitations} % % In this section we document known limitations. If you want to help alleviate them, % please feel free to contact the package author. Some of them are currently discussed in -% the \sTeX TRAC~\cite{sTeX:online}. +% the \sTeX GitHub repository~\cite{sTeX:github:on}. % \begin{compactenum} -% \item none reported yet +% \item none reported yet. % \end{compactenum} % % \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography}\newpage @@ -173,15 +176,6 @@ % the |document| environment and pre-loads some convenience packages, whereas the package % provides the concrete functionality. % -% |hwexam.dtx| generates four files: |hwexam.cls| (all the code between -% {\textsf{$\langle$*cls$\rangle$}} and {\textsf{$\langle$/cls$\rangle$}}), |hwexam.sty| -% (between {\textsf{$\langle$*package$\rangle$}} and -% {\textsf{$\langle$/package$\rangle$}}) and their {\latexml} bindings (between -% {\textsf{$\langle$*ltxml.cls$\rangle$}} and {\textsf{$\langle$/ltxml.cls$\rangle$}} and -% {\textsf{$\langle$*ltxml.sty$\rangle$}} and {\textsf{$\langle$/ltxml.sty$\rangle$ -% respetively}}). We keep the corresponding code fragments together, since the -% documentation applies to both of them and to prevent them from getting out of sync. -% % \subsection{Class Options}\label{sec:impl:cls:options} % % To initialize the |hwexam| class, we declare and process the necessary options by @@ -189,68 +183,38 @@ % % \begin{macrocode} %<*cls> -\DeclareOption{test}{\PassOptionsToPackage{\CurrentOption}{hwexam}} -\DeclareOption{multiple}{\PassOptionsToPackage{\CurrentOption}{hwexam}} -\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} -\DeclareOption{extrefs}{\PassOptionsToPackage{\CurrentOption}{sref}} -\DeclareOption{notes}{\PassOptionsToPackage{\CurrentOption}{problem}} -\DeclareOption{hints}{\PassOptionsToPackage{\CurrentOption}{problem}} -\DeclareOption{solutions}{\PassOptionsToPackage{\CurrentOption}{problem}} -\DeclareOption{pts}{\PassOptionsToPackage{\CurrentOption}{problem}} -\DeclareOption{min}{\PassOptionsToPackage{\CurrentOption}{problem}} -\DeclareOption{boxed}{\PassOptionsToPackage{\CurrentOption}{problem}} -\DeclareOption{extract}{\PassOptionsToPackage{\CurrentOption}{problem}} -\DeclareOption*{\PassOptionsToClass{\CurrentOption}{omdoc}} +\DeclareOption*{ + \PassOptionsToClass{\CurrentOption}{omdoc} + \PassOptionsToPackage{\CurrentOption}{stex} + \PassOptionsToPackage{\CurrentOption}{hwexam} + \PassOptionsToPackage{\CurrentOption}{tikzinput} +} \ProcessOptions -%</cls> -%<*ltxml.cls> -# -*- CPERL -*- -package LaTeXML::Package::Pool; -use strict; -use LaTeXML::Package; -use LaTeXML::Util::Pathname; -use Cwd qw(cwd abs_path); -DeclareOption('test',,sub {PassOptions('hwexam','sty',ToString(Digest(T_CS('\CurrentOption')))); }); -DeclareOption('multiple',sub {PassOptions('hwexam','sty',ToString(Digest(T_CS('\CurrentOption')))); }); -DeclareOption('showmeta',sub {PassOptions('metakeys','sty',ToString(Digest(T_CS('\CurrentOption')))); }); -DeclareOption('extrefs',sub {PassOptions('sref','sty',ToString(Digest(T_CS('\CurrentOption')))); }); -DeclareOption('notes',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); -DeclareOption('hints',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); -DeclareOption('solutions',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); -DeclareOption('pts',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); -DeclareOption('min',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); -DeclareOption('boxed',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); -DeclareOption('extract',sub {PassOptions('problem','sty',ToString(Digest(T_CS('\CurrentOption')))); }); -DeclareOption(undef,sub {PassOptions('omdoc','cls',ToString(Digest(T_CS('\CurrentOption')))); }); -ProcessOptions(); -%</ltxml.cls> % \end{macrocode} % -% We load |article.cls|, and the desired packages. For the {\latexml} bindings, we make +% We load |omdoc.cls|, and the desired packages. For the {\latexml} bindings, we make % sure the right packages are loaded. % % \begin{macrocode} -%<*cls> \LoadClass{omdoc} \RequirePackage{stex} \RequirePackage{hwexam} +\RequirePackage{tikzinput} \RequirePackage{graphicx} \RequirePackage{a4wide} \RequirePackage{amssymb} \RequirePackage{amstext} \RequirePackage{amsmath} +% \end{macrocode} +% Finally, we register another keyword for the |document| environment. We give a default +% assignment type to prevent errors +% \begin{macrocode} +\newcommand\assig@default@type{\hwexam@assignment@kw} +\addmetakey[\assig@default@type]{document}{hwexamtype} +\def\document@hwexamtype{\assig@default@type} %</cls> -%<*ltxml.cls> -LoadClass('omdoc'); -RequirePackage('stex'); -RequirePackage('hwexam'); -RequirePackage('graphicx'); -RequirePackage('amssymb'); -RequirePackage('amstext'); -RequirePackage('amsmath'); -%</ltxml.cls> % \end{macrocode} -% +% % \section{Implementation: The hwexam Package} % % \subsection{Package Options} @@ -261,56 +225,54 @@ RequirePackage('amsmath'); % % \begin{macrocode} %<*package> -\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\newif\if@hwexam@mh@\@hwexam@mh@false +\DeclareOption{mh}{\@hwexam@mh@true} \newif\iftest\testfalse -\newif\ifsolutions\solutionsfalse -\DeclareOption{test}{\testtrue\solutionsfalse} +\DeclareOption{test}{\testtrue} \newif\ifmultiple\multiplefalse \DeclareOption{multiple}{\multipletrue} \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{problem}} \ProcessOptions -%</package> % \end{macrocode} % Then we make sure that the necessary packages are loaded (in the right versions). % \begin{macrocode} -%<*package> \RequirePackage{keyval}[1997/11/10] +\if@hwexam@mh@\RequirePackage{hwexam-mh}\fi \RequirePackage{problem} -%</package> % \end{macrocode} % -% Here comes the equivalent header information for {\latexml}, we also initialize the -% package inclusions. Since {\latexml} does not handle options yet, we have nothing to -% do. +% \begin{macro}{\hwexam@*@kw} +% For multilinguality, we define internal macros for keywords that can be specialized in +% |*.ldf| files. % \begin{macrocode} -%<*ltxml> -# -*- CPERL -*- -package LaTeXML::Package::Pool; -use strict; -use LaTeXML::Package; -RequirePackage('problem'); -%</ltxml> +\AfterBabelLanguage{ngerman}{\input{hwexam-ngerman.ldf}} +\newcommand\hwexam@assignment@kw{Assignment} +\newcommand\hwexam@given@kw{Given} +\newcommand\hwexam@due@kw{Due} % \end{macrocode} +% \end{macro} +% +% \subsection{Assignments} % -% Then we register the namespace of the requirements ontology +% Then we set up a counter for problems and make the problem counter inherited from +% |problem.sty| depend on it. Furthermore, we specialize the |\prob@label| macro to take +% the assignment counter into account. % \begin{macrocode} -%<*ltxml> -RegisterNamespace('assig'=>"http://omdoc.org/ontology/assignments#"); -RegisterDocumentNamespace('assig'=>"http://omdoc.org/ontology/assignments#"); -%</ltxml> +\newcounter{assignment} +\numberproblemsin{assignment} +\renewcommand\prob@label[1]{\arabic{assignment}.#1} % \end{macrocode} % -% \subsection{Assignments} -% % We will prepare the keyval support for the |assignment| environment. % % \begin{macrocode} -%<*package> +\srefaddidkey{assig} \addmetakey{assig}{number} \addmetakey*{assig}{title} \addmetakey{assig}{type} \addmetakey{assig}{given} \addmetakey{assig}{due} +\addmetakey[false]{assig}{loadmodules}[true] % \end{macrocode} % % The next three macros are intermediate functions that handle the case gracefully, where @@ -320,145 +282,168 @@ RegisterDocumentNamespace('assig'=>"http://omdoc.org/ontology/assignments#"); % assignment. Its arguments specify the brackets. % % \begin{macrocode} -\def\given@due#1#2{% -\ifx\assig@given\@empty\else\ifx\assig@due\@empty\else{#1}\fi\fi% -\ifx\assig@given\@empty\else{Given {\assig@given}}\fi% -\ifx\assig@given\@empty\else\ifx\assig@due\@empty\else{, }\fi\fi% -\ifx\assig@due\@empty\else{Due {\assig@due}}\fi% -\ifx\assig@given\@empty\else{\ifx\assig@due\@empty\else{#2}\fi}\fi} -% \end{macrocode} -% -% With them, we can define the central |assignment| environment. This has two forms -% (separated by |\ifmultiple|) in one we make a title block for an assignment sheet, and -% in the other we make a section heading and add it to the table of -% contents. -% -% \begin{macro}{assignment@titleblock} -% This macro prints the title block of a section. If the |multiple| package option is -% given we make a section heading out of this, and if not, a title block. Note that as -% |problem|s are numbered by section, we also set the section counter in the latter -% case. -% \begin{macrocode} -\ifmultiple -\def\assignment@titleblock{% -\@ifundefined{assig@number}{\stepcounter{section}}{\setcounter{section}{\assig@number}}% -\section*{\protect\document@hwexamtype~\arabic{section}:~\assig@title\given@due{\\(})}% -\addcontentsline{toc}{section}{\document@hwexamtype~{\arabic{section}}:~\assig@title}% -\setcounter{problem}{0}} +\newcommand\given@due[2]{% +\ifx \inclassig@given\@empty + \ifx \assig@given\@empty + \ifx \inclassig@due\@empty + \ifx \assig@due\@empty% all empty do nothing + \else #1% + \fi + \else #1% + \fi + \else #1% + \fi +\else #1% +\fi +\ifx\inclassig@given\@empty + \ifx\assig@given\@empty% do nothing + \else \hwexam@given@kw\xspace \assig@given% + \fi +\else \hwexam@given@kw\xspace \inclassig@given% +\fi +\ifx \inclassig@due\@empty + \ifx \assig@due\@empty% do nothing + \else + \ifx \inclassig@given\@empty + \ifx \assig@given\@empty% do nothing + \else ,~% + \fi + \else ,~% + \fi + \fi \else -\def\assignment@titleblock{% -\setcounter{section}{\assig@number} -\begin{center}\bf -\Large\@title\\ -\document@hwexamtype~\assig@number:~\assig@title\strut\\ -\large{\given@due()} -\end{center}} + \ifx \inclassig@given\@empty + \ifx \assig@given\@empty% do nothing + \else ,~% + \fi + \else ,~% + \fi +\fi +\ifx \inclassig@due\@empty + \ifx \assig@due\@empty% do nothing + \else \hwexam@due@kw\xspace \assig@due% + \fi +\else \hwexam@due@kw\xspace \inclassig@due% +\fi +\ifx \inclassig@given\@empty + \ifx \assig@given\@empty + \ifx \inclassig@due\@empty + \ifx \assig@due\@empty% all empty do nothing + \else #2% + \fi + \else #2% + \fi + \else #2% + \fi +\else #2% \fi +} % \end{macrocode} -% \end{macro} % -% \begin{macro}{assignment@process@keys} -% this macro collects the keys from its arugment and corrects them from the outside. +% \begin{macro}{\assignment@title} +% This macro prints the title of an assignment, the local title is overwritten, if there +% is one from the |\includeassignment|. |\assignment@title| takes three arguments the +% first is the fallback when no title is given at all, the second and third go around +% the title, if one is given. % \begin{macrocode} -\def\assignment@process@keys#1{\metasetkeys{assig}{#1} -\ifx\inclassig@title\@empty\else\def\assig@title{\inclassig@title}\fi -\ifx\inclassig@type\@empty\else\def\assig@type{\inclassig@type}\fi -\ifx\inclassig@number\@empty\else\def\assig@number{\inclassig@number}\fi -\ifx\inclassig@due\@empty\else\def\assig@due{\inclassig@due}\fi -\ifx\inclassig@given\@empty\else\def\assig@given{\inclassig@given}\fi} +\newcommand\assignment@title[3] +{\ifx\inclassig@title\@empty% if there is no outside title +\ifx\assig@title\@empty{#1}\else{#2\assig@title{#3}}\fi +\else{#2}\inclassig@title{#3}\fi}% else show the outside title % \end{macrocode} -% for this to work we need to define the |\inclassig| macros in case no -% |\includeassignment| is ever called. +% \end{macro} +% +% \begin{macro}{\assignment@number} +% Like |\assignment@title| only for the number, and no around part. % \begin{macrocode} -\def\inclassig@title{} -\def\inclassig@type{} -\def\inclassig@number{} -\def\inclassig@due{} -\def\inclassig@given{} +\newcommand\assignment@number% +{\ifx\inclassig@number\@empty% if there is no outside number +\ifx\assig@number\@empty\else\assig@number\fi +\else\inclassig@number\fi}% else show the outside number % \end{macrocode} % \end{macro} -% +% +% With them, we can define the central |assignment| environment. This has two forms +% (separated by |\ifmultiple|) in one we make a title block for an assignment sheet, and +% in the other we make a section heading and add it to the table of contents. We first +% define an assignment counter +% % \begin{environment}{assignment} +% For the |assignment| environment we delegate the work to the |@assignment| environment +% that depends on whether |multiple| option is given. % \begin{macrocode} -\newenvironment{assignment}[1][]{\assignment@process@keys{#1}% -\assignment@titleblock}{} -%</package> +\newenvironment{assignment}[1][]{\metasetkeys{assig}{#1}\sref@target% +\edef\@@num{\assignment@number}% +\ifx\@@num\@empty\stepcounter{assignment}\else\setcounter{assignment}{\@@num}\fi% +\setcounter{problem}{0}% +\def\current@section@level{\document@hwexamtype}% +\sref@label@id{\document@hwexamtype \thesection}% +\begin{@assignment}} +{\end{@assignment}} % \end{macrocode} -% +% In the multi-assignment case we just use the |omdoc| environment for suitable +% sectioning. % \begin{macrocode} -%<*ltxml> -DefEnvironment('{assignment} OptionalKeyVals:assig', - "<omdoc:omgroup ?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')() " - . "assig:dummy='for the namespace'>" - . "<omdoc:metadata>" - . "<dc:title>" - . "Assignment ?&KeyVal(#1,'num')(&KeyVal(#1,'num').)()" - . "?&KeyVal(#1,'title')((&KeyVal(#1,'title')))" - . "</dc:title>" - . "?&KeyVal(#1,'given')(<omdoc:meta property='assig:given'>&KeyVal(#1,'given')</omdoc:meta>)()" - . "?&KeyVal(#1,'due')(<omdoc:meta property='assig:due'>&KeyVal(#1,'due')</omdoc:meta>)()" - . "?&KeyVal(#1,'pts')(<omdoc:meta property='assig:pts'>&KeyVal(#1,'pts')</omdoc:meta>)()" - . "</omdoc:metadata>" - . "#body" - ."</omdoc:omgroup>\n", - afterDigest=> sub { - my ($stomach, $kv) = @_; - my $kvi = LookupValue('inclassig'); - my @keys = qw(id num title pts given due); - my @vals = $kvi && map($kvi->getValue($_), @keys); - foreach my $i(0..$#vals) { - $kv->setValue($keys[$i],$vals[$i]) if $vals[$i]; - }});#$ -%</ltxml> +\def\@@asstitle{\protect\document@hwexamtype~\arabic{assignment}% +\assignment@title{}{\;(}{)\;} -- \given@due{}{}} +\ifmultiple +\newenvironment{@assignment}% +{\ifx\assig@loadmodules\@true +\begin{omgroup}[loadmodules]{\@@asstitle} +\else +\begin{omgroup}{\@@asstitle} +\fi} +{\end{omgroup}} % \end{macrocode} -% \end{environment} -% +% for the single-page case we make a title block from the same components. % \begin{macrocode} -%<*package> -\def\assig@default@type{Assignment} -\addmetakey[\assig@default@type]{document}{hwexamtype} -%</package> +\else +\newenvironment{@assignment} +{\begin{center}\bf +\Large\@title\strut\\ +\document@hwexamtype~\arabic{assignment}\assignment@title{\;}{:\;}{\\}% +\large\given@due{--\;}{\;--} +\end{center}} +{} +\fi% multiple % \end{macrocode} +% \end{environment} % % \subsection{Including Assignments} % -% The next command is essentially a glorified |\include| statement, it just sets some -% internal macros first that overwrite the local points, \ednote{these keys should be done -% with \texttt{\textbackslash addmetakey}} -% +% \begin{macro}{\in*assignment} +% This macro is essentially a glorified |\include| statement, it just sets some internal +% macros first that overwrite the local points Importantly, it resets the |inclassig| +% keys after the input. % \begin{macrocode} -%<*package> \addmetakey{inclassig}{number} -\addmetakey{inclassig}{title} +\addmetakey*{inclassig}{title} \addmetakey{inclassig}{type} \addmetakey{inclassig}{given} \addmetakey{inclassig}{due} -\newcommand{\includeassignment}[2][]{\metasetkeys{inclassig}{#1}\include{#2}} -\newcommand{\inputassignment}[2][]{\metasetkeys{inclassig}{#1}\input{#2}} -%</package> -%<*ltxml> -DefMacro('\includeassignment [] {}', sub { - my ($stomach, $arg1, $arg2) = @_; - AssignValue('inclassig',$arg1) if $arg1; - (Invocation(T_CS('\input'),$arg2)->unlist); -}); -DefMacro('\inputassignment [] {}','\input{#2}'); -%</ltxml> +\addmetakey{inclassig}{mhrepos} +\clear@inclassig@keys%initially +\newcommand\includeassignment[2][]{\metasetkeys{inclassig}{#1}% +\include{#2}\clear@inclassig@keys} +\newcommand\inputassignment[2][]{\metasetkeys{inclassig}{#1}% +\input{#2}\clear@inclassig@keys} % \end{macrocode} -% +% \end{macro} +% % \subsection{Typesetting Exams} % +% \begin{macro}{\quizheading} % \begin{macrocode} -%<*package> \addmetakey{quizheading}{tas} \newcommand\quizheading[1]{\def\@tas{#1}% \large\noindent NAME: \hspace{8cm} MAILBOX:\\[2ex]% \ifx\@tas\@empty\else% \noindent TA: \@for\@I:=\@tas\do{{\Large$\Box$}\@I\hspace*{1em}}\\[2ex]\fi} -%</package> % \end{macrocode} +% \end{macro} +% +% \begin{macro}{\testheading} % \begin{macrocode} -%<*package> \addmetakey{testheading}{min} \addmetakey{testheading}{duration} \addmetakey{testheading}{reqpts} @@ -486,57 +471,56 @@ bonus points. \vfill one problem.}\vfill\par\correction@table \\[3ex] \end{center}} {\newpage} -%</package> -%<*ltxml> -DefEnvironment('{testheading}OptionalKeyVals:omdoc',''); -%</ltxml> % \end{macrocode} -% +% \end{macro} +% +% \begin{macro}{\testspace} % \begin{macrocode} -%<*package> -\def\testspace#1{\iftest\vspace*{#1}\fi} -\def\testnewpage{\iftest\newpage\fi} -\def\testemptypage{\iftest\begin{center}This page was intentionally left +\newcommand\testspace[1]{\iftest\vspace*{#1}\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\testnewpage} +% \begin{macrocode} +\newcommand\testnewpage{\iftest\newpage\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\testemptypage} +% \begin{macrocode} +\newcommand\testemptypage[1][]{\iftest\begin{center}This page was intentionally left blank for extra space\end{center}\vfill\eject\else\fi} -%</package> -%<*ltxml> -DefConstructor('\testspace{}',''); -DefConstructor('\testnewpage',''); -DefConstructor('\testemptypage',''); -%</ltxml> % \end{macrocode} -% +% \end{macro} +% % \begin{macro}{\@problem} % This macro acts on a problem's record in the |*.aux| file. Here we redefine it to % generate the correction table. % \begin{macrocode} -%<*package> -\def\@problem#1#2#3{\stepcounter{assignment@probs} -\def\@test{#2}\ifx\@test\@empty\else\addtocounter{assignment@totalpts}{#2}\fi -\def\@test{#3}\ifx\@test\@empty\else\addtocounter{assignment@totalmin}{#3}\fi +\renewcommand\@problem[3]{\stepcounter{assignment@probs} +\def\@@pts{#2}\ifx\@@pts\@empty\else\addtocounter{assignment@totalpts}{#2}\fi +\def\@@min{#3}\ifx\@@min\@empty\else\addtocounter{assignment@totalmin}{#3}\fi \xdef\correction@probs{\correction@probs & #1}% \xdef\correction@pts{\correction@pts & #2} \xdef\correction@reached{\correction@reached &}} -%</package> % \end{macrocode} % \end{macro} % % \begin{macro}{\correction@table} % This macro generates the correction table % \begin{macrocode} -%<*package> \newcounter{assignment@probs} \newcounter{assignment@totalpts} \newcounter{assignment@totalmin} -\def\correction@probs{prob.}% -\def\correction@pts{total}% -\def\correction@reached{reached}% +\newcommand\correction@probs{prob.}% +\newcommand\correction@pts{total}% +\newcommand\correction@reached{reached}% \stepcounter{assignment@probs} -\def\correction@table{\begin{tabular}{|l|*{\theassignment@probs}{c|}|p{3cm}|}\hline% -&\multicolumn{\theassignment@probs}{c||}% +\newcommand\correction@table{\begin{tabular}{|l|*{\theassignment@probs}{c|}|l|}\hline% +&\multicolumn{\theassignment@probs}{c||}%| {\footnotesize To be used for grading, do not write here} &\\\hline \correction@probs & Sum & grade\\\hline -\correction@pts &\theassignment@totalpts & \strut\hspace{3cm}\strut\\\hline +\correction@pts &\theassignment@totalpts & \\\hline \correction@reached & & \\[.7cm]\hline \end{tabular}} %</package> @@ -553,26 +537,42 @@ DefConstructor('\testemptypage',''); % \font\uhrfont=../assignments/uhr % \font\warnschildfont=../assignments/achtung % -% \def\bierglas{{\bierfont\char65}} -% \def\denker{{\denkerfont\char65}} -% \def\uhr{{\uhrfont\char65}} -% \def\warnschild{{\warnschildfont\char 65}} -% \def\hardA{\warnschild} -% \def\longA{\uhr} -% \def\thinkA{\denker} -% \def\discussA{\bierglas} +% \newcommand\bierglas{{\bierfont\char65}} +% \newcommand\denker{{\denkerfont\char65}} +% \newcommand\uhr{{\uhrfont\char65}} +% \newcommand\warnschild{{\warnschildfont\char 65}} +% \newcommand\hardA{\warnschild} +% \newcommand\longA{\uhr} +% \newcommand\thinkA{\denker} +% \newcommand\discussA{\bierglas} % \end{verbatim} -% -% Finally, we need to terminate the file with a success mark for perl. -% \begin{macrocode} -%<ltxml>1; -% \end{macrocode} % \Finale \endinput % \iffalse -% LocalWords: GPL structuresharing STR +% LocalWords: GPL structuresharing STR iffalse cls NeedsTeXFormat hwexam hwexam.dtx sc %%% Local Variables: %%% mode: doctex %%% TeX-master: t %%% End: % \fi +% LocalWords: texttt scsys sc latexml fileversion filedate maketitle setcounter newpage +% LocalWords: tocdepth tableofcontents pts showmeta showmeta showignores omdoc extrefs +% LocalWords: testspace testnewpage testemptypage testheading testheading reqpts reqpts +% LocalWords: exfig makeatletter makeatother vspace hrule vspace vspace noindent textsf +% LocalWords: includeassignment includeassignment HorIacJuc cscpnrr11 importmodule baz +% LocalWords: includemhassignment includemhassignment importmhmodule foobar ldots sref +% LocalWords: mhcurrentrepos mh-variants mh-variant compactenum printbibliography Cwd +% LocalWords: langle rangle langle rangle ltxml.cls ltxml.sty respetively metakeys qw +% LocalWords: cwd stex graphicx amssymb amstext amsmath newif iftest testfalse testtrue +% LocalWords: ifsolutions solutionsfalse ifmultiple multiplefalse multipletrue keyval +% LocalWords: ltxml assig srefaddidkey addmetakey ifx assignment@titleblock stepcounter +% LocalWords: document@hwexamtype importmodules metasetkeys inclassig@title inclassig +% LocalWords: inclassig@title inclassig@type inclassig@type inclassig@number xspace kv +% LocalWords: inclassig@number inclassig@due inclassig@due inclassig@given ignorespaces +% LocalWords: inclassig@given newenvironment currentsectionlevel OptionalKeyVals kvi +% LocalWords: omgroup vals hwexamtype ednote textbackslash newcommand inputassignment +% LocalWords: unlist quizheading tas hspace hfill textbf newcount vfill addtocounter +% LocalWords: theassignment@totalmin theassignment@totalpts assignment@probs xdef hline +% LocalWords: assignment@totalpts assignment@totalmin correction@probs correction@probs +% LocalWords: newcounter theassignment@probs footnotesize mh@currentrepos endinput +% LocalWords: inclassig@mhrepos inclassig@mhrepos doctex inputmhassignment diff --git a/Master/texmf-dist/source/latex/stex/hwexam/hwexam.ins b/Master/texmf-dist/source/latex/stex/hwexam/hwexam.ins index fc8f40b0953..07e07e95936 100644 --- a/Master/texmf-dist/source/latex/stex/hwexam/hwexam.ins +++ b/Master/texmf-dist/source/latex/stex/hwexam/hwexam.ins @@ -32,12 +32,4 @@ \Msg{* if your TeX distribution uses such a database.} \Msg{*} -\nopreamble\nopostamble -\generate{\file{hwexam.sty.ltxml}{\from{hwexam.dtx}{ltxml}}} -\generate{\file{hwexam.cls.ltxml}{\from{hwexam.dtx}{ltxml.cls}}} - -\Msg{*} -\Msg{* You probably need to move the generated files hwexam.{sty,cls}.ltxml into a directory searched by LaTeXML.} -\Msg{*} - \endbatchfile |