summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/stex/problem
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-11-12 00:31:31 +0000
committerKarl Berry <karl@freefriends.org>2010-11-12 00:31:31 +0000
commit70e387eb63ce4723858c48592208e193dec294f3 (patch)
tree61ec42df871a70687151ed4a6d1bc6a5c81dc53c /Master/texmf-dist/tex/latex/stex/problem
parent2cee8f6dcf8e9596b5cfe9d1f3e55c61b261a320 (diff)
stex 0.9.3 (11nov10)
git-svn-id: svn://tug.org/texlive/trunk@20410 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/problem')
-rw-r--r--Master/texmf-dist/tex/latex/stex/problem/problem.sty27
-rw-r--r--Master/texmf-dist/tex/latex/stex/problem/problem.sty.ltxml47
2 files changed, 40 insertions, 34 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/problem/problem.sty b/Master/texmf-dist/tex/latex/stex/problem/problem.sty
index aec05910e0e..2a69e3f75e6 100644
--- a/Master/texmf-dist/tex/latex/stex/problem/problem.sty
+++ b/Master/texmf-dist/tex/latex/stex/problem/problem.sty
@@ -8,6 +8,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{problem}[2010/06/25 v0.9c Semantic Markup for Problems]
+\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}}
\newif\ifexnotes\exnotesfalse\DeclareOption{notes}{\exnotestrue}
\newif\ifhints\hintsfalse\DeclareOption{hints}{\hintstrue}
\newif\ifsolutions\solutionsfalse\DeclareOption{solutions}{\solutionstrue}
@@ -20,10 +21,10 @@
\RequirePackage{xcomment}
\RequirePackage{sref}
\srefaddidkey[prefix=prob.]{problem}
-\omdaddkey{problem}{pts}
-\omdaddkey{problem}{min}
-\omdaddkey{problem}{title}
-\omdaddkey{problem}{refnum}
+\addmetakey{problem}{pts}
+\addmetakey{problem}{min}
+\addmetakey*{problem}{title}
+\addmetakey{problem}{refnum}
\newsavebox{\probbox}
\newcounter{problem}[section]
\def\prob@number{\ifx\inclprob@refnum\@empty
@@ -35,18 +36,18 @@
\ifx\problem@title\@empty{:\quad}\else{\quad(\problem@title)\hfill\\}\fi
\else\quad(\inclprob@title)\hfill\\\fi}% else show the outside title
\ifboxed
-\newenvironment{problem}[1][]{\omdsetkeys{problem}{#1}\sref@target%
+\newenvironment{problem}[1][]{\metasetkeys{problem}{#1}\sref@target%
\stepcounter{problem}\show@pts\show@min\record@problem%
-\begin{lrbox}{\probbox}\begin{minipage}{.9\textwidth}}
+\begin{lrbox}{\probbox}\begin{minipage}{.9\textwidth}\ignorespaces}
{\end{minipage}\end{lrbox}
\setbox0=\hbox{\begin{minipage}{.9\textwidth}%
\noindent\textbf\prob@heading\rm%
\end{minipage}}
\smallskip\noindent\fbox{\vbox{\box0\vspace*{.2em}\usebox\probbox}}\smallskip}
\else
-\newenvironment{problem}[1][]{\omdsetkeys{problem}{#1}\sref@target%
+\newenvironment{problem}[1][]{\metasetkeys{problem}{#1}\sref@target%
\stepcounter{problem}\show@pts\show@min\record@problem%
-\par\noindent\textbf\prob@heading\rm}
+\par\noindent\textbf\prob@heading\rm\ignorespaces}
{\smallskip}
\fi%boxed
\def\record@problem{\protected@write\@auxout{}%
@@ -81,13 +82,13 @@
\immediate\openout\problem@file=\jobname-problems.tex
\AtEndDocument{\closeout\problem@file}
\fi
-\omdaddkey{inclprob}{pts}
-\omdaddkey{inclprob}{min}
-\omdaddkey{inclprob}{title}
-\omdaddkey{inclprob}{refnum}
+\addmetakey{inclprob}{pts}
+\addmetakey{inclprob}{min}
+\addmetakey*{inclprob}{title}
+\addmetakey{inclprob}{refnum}
\clear@inclprob@keys
\newcommand{\includeproblem}[2][]{%
-\bgroup\omdsetkeys{inclprob}{#1}\input{#2}\ifsolutions\newpage\fi\egroup
+\bgroup\metasetkeys{inclprob}{#1}\input{#2}\ifsolutions\newpage\fi\egroup
\ifextract\def\@test{#1}
\def\prob@num{\ifx\inclprob@refnum\@empty\thesection.\theproblem\else\inclprob@refnum\fi}
\def\inclprob@keys{#1\ifx\@test\@empty\else,\fi refnum=\prob@num}
diff --git a/Master/texmf-dist/tex/latex/stex/problem/problem.sty.ltxml b/Master/texmf-dist/tex/latex/stex/problem/problem.sty.ltxml
index 0ef5044333e..39b1fee29e1 100644
--- a/Master/texmf-dist/tex/latex/stex/problem/problem.sty.ltxml
+++ b/Master/texmf-dist/tex/latex/stex/problem/problem.sty.ltxml
@@ -1,3 +1,12 @@
+RawTeX('
+\newif\ifexnotes\exnotesfalse
+\newif\ifhints\hintsfalse
+\newif\ifsolutions\solutionsfalse
+\newif\ifpts\ptsfalse
+\newif\ifmin\minfalse
+\newif\ifboxed\boxedfalse
+\newif\ifextract\extractfalse
+');
# -*- CPERL -*-
package LaTeXML::Package::Pool;
use strict;
@@ -7,15 +16,14 @@ RegisterNamespace('prob'=>"http://omdoc.org/ontology/problems#");
RegisterDocumentNamespace('prob'=>"http://omdoc.org/ontology/problems#");
DefCMPEnvironment('{problem} OptionalKeyVals:problem',
"<omdoc:exercise ?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')()"
- . "prob:dummy='for the namespace'"
- . "?#locator(stex:srcref='#locator')()>"
- . "?&KeyVal(#1,'title')(<dc:title ?#locator(stex:srcref='#locator')()>&KeyVal(#1,'title')</dc:title>)()"
- . "?&KeyVal(#1,'min')(<omdoc:meta property='prob:solvedinminutes' "
- . "?#locator(stex:srcref='#locator')()>&KeyVal(#1,'min')</omdoc:meta>)()"
- . "?&KeyVal(#1,'pts')(<omdoc:meta property='prob:points' "
- . "?#locator(stex:srcref='#locator')()>&KeyVal(#1,'pts')</omdoc:meta>)()"
- . "<omdoc:CMP ?#locator(stex:srcref='#locator')()><omdoc:p>#body"
- ."</omdoc:exercise>\n");
+ . "?#locator(stex:srcref='#locator')()>"
+ . "?&KeyVal(#1,'title')(<dc:title ?#locator(stex:srcref='#locator')()>&KeyVal(#1,'title')</dc:title>)()"
+ . "?&KeyVal(#1,'min')(<omdoc:meta property='prob:solvedinminutes' prob:dummy='for the namespace' "
+ . "?#locator(stex:srcref='#locator')()>&KeyVal(#1,'min')</omdoc:meta>)()"
+ . "?&KeyVal(#1,'pts')(<omdoc:meta property='prob:points' prob:dummy='for the namespace' "
+ . "?#locator(stex:srcref='#locator')()>&KeyVal(#1,'pts')</omdoc:meta>)()"
+ . "<omdoc:CMP ?#locator(stex:srcref='#locator')()><omdoc:p>#body"
+ ."</omdoc:exercise>\n");
DefKeyVal('soln','id','Semiverbatim');
DefKeyVal('soln','height','Semiverbatim');
DefKeyVal('soln','for','Semiverbatim');
@@ -26,14 +34,12 @@ DefCMPEnvironment('{solution} OptionalKeyVals:soln',
DefCMPEnvironment('{exnote}',
"<omdoc:hint ?#locator(stex:srcref='#locator')()>"
. "<omdoc:CMP ?#locator(stex:srcref='#locator')()>"
- . "<omdoc:p>#body<omdoc:p>"
- . "</omdoc:CMP>"
+ . "<omdoc:p>#body"
."</omdoc:hint>");
DefCMPEnvironment('{hint}',
"<omdoc:hint ?#locator(stex:srcref='#locator')()>"
. "<omdoc:CMP ?#locator(stex:srcref='#locator')()>"
- . "<omdoc:p>#body</omdoc:p>"
- . "</omdoc:CMP>"
+ . "<omdoc:p>#body"
."</omdoc:hint>");
DefConstructor('\pts{}',"");
DefConstructor('\min{}',"");
@@ -41,14 +47,13 @@ DefKeyVal('prob','pts','Semiverbatim');
DefKeyVal('prob','min','Semiverbatim');
DefKeyVal('prob','title','Semiverbatim');
DefConstructor('\includeproblem OptionalKeyVals:prob Semiverbatim',
- "<omdoc:ref xref='#2' ?#locator(stex:srcref='#locator')() "
- . "prob:dummy='for the namespace'>"
- . "?&KeyVal(#1,'title')(<dc:title ?#locator(stex:srcref='#locator')()>&KeyVal(#1,'title')</dc:title>)()"
- . "?&KeyVal(#1,'min')(<omdoc:meta property='prob:solvedinminutes' "
- . "?#locator(stex:srcref='#locator')()>&KeyVal(#1,'min')</omdoc:meta>)()"
- . "?&KeyVal(#1,'pts')(<omdoc:meta property='prob:points' "
- . "?#locator(stex:srcref='#locator')()>&KeyVal(#1,'pts')</omdoc:meta>)()"
- ."</omdoc:ref>");
+ "<omdoc:ref type='cite' xref='#2' ?#locator(stex:srcref='#locator')()>"
+ . "?&KeyVal(#1,'title')(<dc:title ?#locator(stex:srcref='#locator')()>&KeyVal(#1,'title')</dc:title>)()"
+ . "?&KeyVal(#1,'min')(<omdoc:meta property='prob:solvedinminutes' prob:dummy='for the namespace' "
+ . "?#locator(stex:srcref='#locator')()>&KeyVal(#1,'min')</omdoc:meta>)()"
+ . "?&KeyVal(#1,'pts')(<omdoc:meta property='prob:points' prob:dummy='for the namespace' "
+ . "?#locator(stex:srcref='#locator')()>&KeyVal(#1,'pts')</omdoc:meta>)()"
+ ."</omdoc:ref>");
Tag('omdoc:exercise',afterOpen=>\&numberIt);
Tag('omdoc:solution',afterOpen=>\&numberIt);
Tag('omdoc:hint',afterOpen=>\&numberIt);