summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/stex/sproof
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/sproof
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/sproof')
-rw-r--r--Master/texmf-dist/tex/latex/stex/sproof/sproof.sty49
-rw-r--r--Master/texmf-dist/tex/latex/stex/sproof/sproof.sty.ltxml24
2 files changed, 41 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty b/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty
index 6a101124b4b..ba420ee064e 100644
--- a/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty
+++ b/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty
@@ -8,15 +8,17 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{sproof}[2010/06/25 v0.9f Semantic Markup for Proofs]
+\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}}
+\ProcessOptions
\RequirePackage{sref}
\srefaddidkey{spf}
-\omdaddkey{spf}{display}
-\omdaddkey{spf}{for}
-\omdaddkey{spf}{from}
-\omdaddkey[\sproof@box]{spf}{proofend}
-\omdaddkey{spf}{type}
-\omdaddkey{spf}{title}
-\omdaddkey{spf}{continues}
+\addmetakey*{spf}{display}
+\addmetakey{spf}{for}
+\addmetakey{spf}{from}
+\addmetakey*[\sproof@box]{spf}{proofend}
+\addmetakey{spf}{type}
+\addmetakey*{spf}{title}
+\addmetakey{spf}{continues}
\def\spf@flow{flow}
\newenvironment{pst@with@label}[1]{\edef\pst@label{#1}\advance\count10 by 1\count\count10=1}
{\advance\count10 by -1}
@@ -26,43 +28,46 @@
\def\spf@proofend{\sproof@box}
\def\sproofend{\ifx\spf@proofend\@empty\else\hfil\null\nobreak\hfill\spf@proofend\par\smallskip\fi}
\def\sProofEndSymbol#1{\def\sproof@box{#1}}
-\newcommand{\spfsketch}[2][]{\omdsetkeys{spf}{#1}\sref@target
-\ifx\spf@display\spf@flow\else{\stDMemph{\ifx\spf@type\@empty{Proof}\else\spf@type\fi}:}\fi{ #2}%
-\sref@label@id{this \ifx\spf@type\@empty{Proof}\else\spf@type\fi}}
-\newenvironment{@proof}[2][]{\omdsetkeys{spf}{#1}\sref@target
+\def\spf@proofsketch@kw{Proof Sketch}
+\newcommand{\spfsketch}[2][]{\metasetkeys{spf}{#1}\sref@target
+\ifx\spf@display\spf@flow\else{\stDMemph{\ifx\spf@type\@empty\spf@proofsketch@kw\else\spf@type\fi}:}\fi{ #2}%
+\sref@label@id{this \ifx\spf@type\@empty\spf@proofsketch@kw\else\spf@type\fi}}
+\def\spf@proof@kw{Proof}
+\newenvironment{@proof}[2][]{\metasetkeys{spf}{#1}\sref@target
\count10=10
-\ifx\spf@display\spf@flow\else{\stDMemph{\ifx\spf@type\@empty{Proof}\else\spf@type\fi}:}\fi{ #2}%
-\sref@label@id{this \ifx\spf@type\@empty{Proof}\else\spf@type\fi}
+\ifx\spf@display\spf@flow\else{\stDMemph{\ifx\spf@type\@empty\spf@proof@kw\else\spf@type\fi}:}\fi{ #2}%
+\sref@label@id{this \ifx\spf@type\@empty\spf@proof@kw\else\spf@type\fi}
\def\pst@label{}\newcount\pst@count% initialize the labeling mechanism
\begin{description}\begin{pst@with@label}{P}}
{\end{pst@with@label}\end{description}}
\newenvironment{sproof}[2][]{\begin{@proof}[#1]{#2}}{\sproofend\end{@proof}}
\newenvironment{sProof}[2][]{\begin{@proof}[#1]{#2}}{\end{@proof}}
-\newcommand{\spfidea}[2][]{\omdsetkeys{spf}{#1}%
+\newcommand{\spfidea}[2][]{\metasetkeys{spf}{#1}%
\stDMemph{\ifx\spf@type\@empty{Proof Idea}\else\spf@type\fi:} #2\sproofend}
-\newenvironment{spfstep}[1][]{\omdsetkeys{spf}{#1}
+\newenvironment{spfstep}[1][]{\metasetkeys{spf}{#1}
\ifx\spf@display\spf@flow\else\item[\the@pst@label]\fi
\ifx\spf@title\@empty\else{(\stDMemph{\spf@title})}\fi}
{\next@pst@label}
-\newenvironment{sproofcomment}[1][]{\omdsetkeys{spf}{#1}
+\newenvironment{sproofcomment}[1][]{\metasetkeys{spf}{#1}
\ifx\spf@display\spf@flow\else\item[\the@pst@label]\fi}
{\next@pst@label}
-\newenvironment{spfcases}[2][]{\omdsetkeys{spf}{#1}
+\newenvironment{spfcases}[2][]{\metasetkeys{spf}{#1}
\def\@test{#2}\ifx\@test\empty\else
\ifx\spf@display\spf@flow {#2}\else\item[\the@pst@label]{#2} \fi\fi
\begin{pst@with@label}{\pst@label.\number\count\count10}}
{\end{pst@with@label}\next@pst@label}
-\newenvironment{spfcase}[2][]{\omdsetkeys{spf}{#1}
+\newenvironment{spfcase}[2][]{\metasetkeys{spf}{#1}
\ifx\spf@display\spf@flow\else\item[\the@pst@label]\fi
\def\@test{#2}\ifx\@test\@empty\else{\stDMemph{#2}:}\fi
\begin{pst@with@label}{\pst@label.\number\count\count10}}
{\ifx\spf@display\spf@flow\else\sproofend\fi\end{pst@with@label}\next@pst@label}
-\newenvironment{subproof}{\begin{pst@with@label}{\pst@label.\number\count\count10}}
+\newenvironment{subproof}[1][]%
+{\begin{pst@with@label}{\pst@label.\number\count\count10}}
{\ifx\spf@display\spf@flow\else\sproofend\fi\end{pst@with@label}}
\srefaddidkey{just}
-\omdaddkey{just}{method}
-\omdaddkey{just}{premises}
-\omdaddkey{just}{args}
+\addmetakey{just}{method}
+\addmetakey{just}{premises}
+\addmetakey{just}{args}
\newenvironment{justification}[1][]{}{}
\newcommand{\premise}[2][]{#2}
\newcommand{\justarg}[2][]{#2}
diff --git a/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty.ltxml b/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty.ltxml
index 91dc3034627..7b4e21cfa68 100644
--- a/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty.ltxml
+++ b/Master/texmf-dist/tex/latex/stex/sproof/sproof.sty.ltxml
@@ -3,13 +3,12 @@ package LaTeXML::Package::Pool;
use strict;
use LaTeXML::Package;
RequirePackage('sref');
+DeclareOption('showmeta','');
DefConstructor('\sproofend',"");
DefConstructor('\spfsketch OptionalKeyVals:pf{}',
"<omdoc:proof "
. "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()>\n"
- . "?#2(<omdoc:omtext>"
- . "<omdoc:CMP><omdoc:p>#2</omdoc:p></omdoc:CMP>"
- . "</omdoc:omtext>\n)()"
+ . "?#2(<omdoc:omtext><omdoc:CMP><omdoc:p>#2\n)()"
. "</omdoc:proof>\n");
DefConstructor('\sProofEndSymbol {}','');
DefCMPEnvironment('{sproof} OptionalKeyVals:pf{}',
@@ -17,7 +16,7 @@ DefCMPEnvironment('{sproof} OptionalKeyVals:pf{}',
. "?&KeyVal(#1,'for')(for='&hash_wrapper(&KeyVal(#1,'for'))')()"
. "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()>\n"
. "?#2(<omdoc:omtext>"
- . "<omdoc:CMP><omdoc:p>#2</omdoc:p></omdoc:CMP>"
+ . "<omdoc:CMP><omdoc:p>#2</omdoc:CMP>"
. "</omdoc:omtext>\n)()"
. "#body"
. "</omdoc:proof>\n");
@@ -27,7 +26,7 @@ DefCMPConstructor('\spfidea OptionalKeyVals:pf {}',
"<omdoc:proof "
. "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()"
. "?&KeyVal(#1,'for')(for='&hash_wrapper(&KeyVal(#1,'for'))')()>\n"
- . "<omdoc:omtext><omdoc:CMP><omdoc:p>#2</omdoc:p></omdoc:CMP></omdoc:omtext>\n"
+ . "<omdoc:omtext><omdoc:CMP><omdoc:p>#2</omdoc:omtext>\n"
. "</omdoc:proof>\n");
DefCMPEnvironment('{spfstep} OptionalKeyVals:pf',
"<omdoc:derive "
@@ -40,24 +39,29 @@ DefCMPEnvironment('{spfstep} OptionalKeyVals:pf',
DefCMPEnvironment('{sproofcomment} OptionalKeyVals:pf',
"<omdoc:omtext "
. "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()>"
- . "<omdoc:CMP><omdoc:p>#body</omdoc:p></omdoc:CMP>"
+ . "<omdoc:CMP><omdoc:p>#body</omdoc:CMP>"
. "</omdoc:omtext>");
DefEnvironment('{spfcases} OptionalKeyVals:pf {}',
"<omdoc:derive "
. "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()>\n"
- . "<omdoc:CMP><omdoc:p>#2</omdoc:p></omdoc:CMP>\n"
+ . "<omdoc:CMP><omdoc:p>#2</omdoc:CMP>\n"
. "<omdoc:method xref='#proof-by-cases'>#body</omdoc:method>"
. "</omdoc:derive>\n");
DefEnvironment('{spfcase} OptionalKeyVals:pf{}',
"<omdoc:proof "
. "?&defined(&KeyVal(#1,'id'))(xml:id='&KeyVal(#1,'id')')()>\n"
. "?#2(<omdoc:omtext>"
- . "<omdoc:CMP><omdoc:p>#2</omdoc:p></omdoc:CMP>"
+ . "<omdoc:CMP><omdoc:p>#2</omdoc:CMP>"
. "</omdoc:omtext>\n)()"
. "#body"
. "</omdoc:proof>\n");
-DefEnvironment('{subproof}',
- "<omdoc:proof>\n #body\n</omdoc:proof>\n");
+DefEnvironment('{subproof}[]',
+ "<omdoc:derive>"
+ . "?#1(<omdoc:CMP><omdoc:p>#1</omdoc:CMP>)()"
+ . "<omdoc:method>"
+ . "<omdoc:proof>\n #body\n</omdoc:proof>"
+ . "</omdoc:method>"
+ ."</omdoc:derive>");
DefKeyVal('just','id','Semiverbatim');
DefKeyVal('just','method','Semiverbatim');
DefKeyVal('just','premises','Semiverbatim');