%% %% This is file `problem.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% problem.dtx (with options: `package') %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{problem}[2019/03/20 v1.3 Semantic Markup for Problems] \newif\if@problem@mh@\@problem@mh@false \DeclareOption{mh}{\@problem@mh@true} \newif\ifexnotes\exnotesfalse \DeclareOption{notes}{\exnotestrue} \newif\ifhints\hintsfalse \DeclareOption{hints}{\hintstrue} \newif\ifsolutions\solutionsfalse \DeclareOption{solutions}{\solutionstrue} \newif\ifpts\ptsfalse \DeclareOption{pts}{\ptstrue} \newif\ifmin\minfalse \DeclareOption{min}{\mintrue} \newif\ifboxed\boxedfalse \DeclareOption{boxed}{\boxedtrue} \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{omtext}} \ProcessOptions \if@problem@mh@\RequirePackage{problem-mh}\fi \RequirePackage{omtext} \RequirePackage{comment} \RequirePackage{mdframed} \RequirePackage[base]{babel} \AfterBabelLanguage{ngerman}{\input{problem-ngerman.ldf}} \AfterBabelLanguage{arabic}{\input{problem-arabic.ldf}} \def\prob@problem@kw{Problem} \def\prob@solution@kw{Solution} \srefaddidkey[prefix=prob.]{problem} \addmetakey{problem}{pts} \addmetakey{problem}{min} \addmetakey*{problem}{title} \addmetakey{problem}{refnum} \newcounter{problem} \newcommand\numberproblemsin[1]{\@addtoreset{problem}{#1}} \newcommand\prob@label[1]{#1} \newcommand\prob@number{% \ifx\inclprob@refnum\@empty% if there is no outside refnumb \ifx\problem@refnum\@empty\prob@label\theproblem% \else\prob@label\problem@refnum\fi% \else\prob@label\inclprob@refnum\fi} \newcommand\prob@title[3]{% \ifx\inclprob@title\@empty% if there is no outside title \ifx\problem@title\@empty{#1}\else{#2\problem@title{#3}}\fi \else{#2}\inclprob@title{#3}\fi}% else show the outside title \def\prob@heading{\prob@problem@kw~\prob@number\prob@title{ }{ (}{)\strut\\}% \sref@label@id{\prob@problem@kw~\prob@number}} \newenvironment{problem}[1][]{\metasetkeys{problem}{#1}\sref@target% \@in@omtexttrue% we are in a statement (for inline definitions) \stepcounter{problem}\record@problem% \def\current@section@level{\prob@problem@kw}% \par\noindent\textbf\prob@heading\show@pts\show@min\rmfamily\noindent\ignorespaces} {\smallskip} \ifboxed\surroundwithmdframed{problem}\fi \def\record@problem{\protected@write\@auxout{}% {\string\@problem{\prob@number}% {\ifx\inclprob@pts\@empty\problem@pts\else\inclprob@pts\fi}% {\ifx\inclprob@min\@empty\problem@min\else\inclprob@min\fi}}} \def\@problem#1#2#3{} \srefaddidkey{soln} \addmetakey{soln}{for} \addmetakey{soln}{height} \addmetakey{soln}{creators} \addmetakey{soln}{contributors} \addmetakey{soln}{srccite} \newcommand\@startsolution[1][]{\metasetkeys{soln}{#1}% \@in@omtexttrue% we are in a statement. \ifboxed\else\hrule\fi\smallskip\noindent{\textbf\prob@solution@kw: }\begin{small}% \def\current@section@level{\prob@solution@kw}% \ignorespaces} \newcommand\startsolutions{\specialcomment{solution}{\@startsolution}% {\ifboxed\else\hrule\medskip\fi\end{small}}% \ifboxed\surroundwithmdframed{solution}\fi} \newcommand\stopsolutions{\excludecomment{solution}} \ifsolutions\startsolutions\else\stopsolutions\fi \ifexnotes \newenvironment{exnote}[1][]% {\par\smallskip\hrule\smallskip\noindent\textbf{Note: }\small} {\smallskip\hrule} \else%ifexnotes \excludecomment{exnote} \fi%ifexnotes \ifhints \newenvironment{hint}[1][]% {\par\smallskip\hrule\smallskip\noindent\textbf{Hint: }\small} {\smallskip\hrule} \newenvironment{exhint}[1][]% {\par\smallskip\hrule\smallskip\noindent\textbf{Hint: }\small} {\smallskip\hrule} \else%ifhints \excludecomment{hint} \excludecomment{exhint} \fi%ifhints \newenvironment{mcb} {\begin{enumerate}} {\end{enumerate}} \srefaddidkey{mcc} \addmetakey{mcc}{feedback} \addmetakey[T]{mcc}{T} \addmetakey[F]{mcc}{F} \addmetakey[Yes]{mcc}{Ttext} \addmetakey[No]{mcc}{Ftext} \newcommand\mcc[2][]{% \metasetkeys{mcc}{#1}% \item #2% \ifsolutions\\% \ifcsstring{mcc@T}{T}{}{\mcc@Ttext}% \ifcsstring{mcc@F}{F}{}{\mcc@Ftext}% \ifx\mcc@feedback\@empty!\else, \mcc@feedback\fi% \fi} %solutions \addmetakey{inclprob}{pts} \addmetakey{inclprob}{min} \addmetakey*{inclprob}{title} \addmetakey{inclprob}{refnum} \addmetakey{inclprob}{mhrepos} \clear@inclprob@keys%initially \newcommand\includeproblem[2][]{\metasetkeys{inclprob}{#1}% \input{#2}\clear@inclprob@keys} \def\pts#1{\ifpts\marginpar{#1 pt}\fi} \def\min#1{\ifmin\marginpar{#1 min}\fi} \AtEndDocument{\ifpts\message{Total: \arabic{pts} points}\fi \ifmin\message{Total: \arabic{min} minutes}\fi} \newcounter{pts} \def\show@pts{\ifx\inclprob@pts\@empty% \ifx\problem@pts\@empty\else% \ifpts\marginpar{\problem@pts pt\smallskip}\addtocounter{pts}{\problem@pts}\fi% \fi\else% inclprob@pts nonempty \ifpts\marginpar{\inclprob@pts pt\smallskip}\addtocounter{pts}{\inclprob@pts}\fi% \fi} \newcounter{min} \def\show@min{\ifx\inclprob@min\@empty% \ifx\problem@min\@empty\else% \ifmin\marginpar{\problem@min min}\addtocounter{min}{\problem@min}\fi% \fi\else% \ifmin\marginpar{\inclprob@min min}\addtocounter{min}{\inclprob@min}\fi \fi} \endinput %% %% End of file `problem.sty'.