diff options
Diffstat (limited to 'Master/texmf-dist/source')
23 files changed, 2054 insertions, 1072 deletions
diff --git a/Master/texmf-dist/source/latex/stex/assignment/assignment.dtx b/Master/texmf-dist/source/latex/stex/assignment/assignment.dtx deleted file mode 100644 index b2cc124ff7a..00000000000 --- a/Master/texmf-dist/source/latex/stex/assignment/assignment.dtx +++ /dev/null @@ -1,428 +0,0 @@ -% \iffalse meta-comment -% An Infrastructure for marking up Assignments -% $URL: https://svn.kwarc.info/repos/stex-content/sty/assignment/assignment.dtx $ -% $Rev: 2871 $; last modified by $Author: kohlhase $ -% $Date: 2010-05-29 07:43:20 +0200 (Sat, 29 May 2010) $ -% Copyright (c) 2007 Michael Kohlhase, all rights reserved -% this file is released under the -% LaTeX Project Public License (LPPL) -% \fi -% -% \iffalse -%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] -%<package>\ProvidesPackage{assignment}[2010/06/25 v0.9a assignment documents] -% -%<*driver> -\documentclass{ltxdoc} -\usepackage{url,array,float} -\usepackage[show]{ed} -\usepackage{hyperref} -\usepackage{assignment} -\makeindex -\floatstyle{boxed} -\newfloat{exfig}{thp}{lop} -\floatname{exfig}{Example} -\begin{document}\DocInput{assignment.dtx}\end{document} -%</driver> -% \fi -%\CheckSum{323} -% -% \changes{v0.9}{2006/09/18}{First Version with Documentation} -% -% \GetFileInfo{assignment.sty} -% -% \MakeShortVerb{\|} -%\def\scsys#1{{{\sc #1}}\index{#1@{\sc #1}}} -% \def\latexml{\scsys{LaTeXML}} -% -% \title{An Infrastructure for formatting Assignments\thanks{Version {\fileversion} (last revised -% {\filedate})}} -% \author{Michael Kohlhase\\ -% Jacobs University, Bremen\\ -% \url{http://kwarc.info/kohlhase}} -% \maketitle -% -% \begin{abstract} -% The |assignment| packge allows individual course assignment sheets and compond -% assignment documents using problem files marked up with the |problem| package. -% \end{abstract} -% \setcounter{tocdepth}{2}\tableofcontents\newpage -% -%\section{Introduction}\label{sec:intro} -% -% The |assignment| package supplies an infrastructure that allows to format nice-looking -% assignment sheets by simply including problems from problem files marked up with the -% |problem| package. It is designed to be compatible with |problems.sty|, and inherits -% some of the functionality. -% -% \section{The User Interface} -% -% \subsection{Assignments} -% \DescribeEnv{assignment} This package supplies the |assignment| environment that groups -% problems into assignment sheets. It takes an optional KeyVal argument with the keys -% \DescribeMacro{number}|number| (for the assignment number; if none is given, 1 is -% assumed as the default or --- in multi-assignment documents --- the ordinal of the -% |assignment| environment), \DescribeMacro{title}|title| (for the assignment title; this -% is referenced in the title of the assignment sheet), \DescribeMacro{type}|type| (for the -% assignment type; e.g. ``quiz'', or ``homework''), \DescribeMacro{given}|given| (for the -% date the assignment was given), and \DescribeMacro{due}|due| (for the date the -% assignment is due). -% -% \DescribeMacro{\CourseTitle} |\Coursetitle{|\meta{title}|}| can be used to specify the -% title of the course. It is usually specified in the driver file. -% -% \DescribeMacro{\AssignmentType} Similarly, |\AssignmentType{|\meta{type}|}| can be used -% to specify the default assignment type. -% -% The |assignment| package takes the options \DescribeMacro{solutions}|solutions|, -% \DescribeMacro{notes}|notes|, \DescribeMacro{hints}|hints|, \DescribeMacro{pts}|pts|, -% \DescribeMacro{min}|min|, and \DescribeMacro{boxed}|boxed| that are just passed on to -% the |problems| package (cf. its documentation for a description of the intended -% behavior). -% -% \subsection{Typesetting Exams} -% -% Furthermore, the |assignment| package takes the option -% \DescribeMacro{multiple}|multiple| that allows to combine multiple assigment sheets into -% a compound document (the assignment sheets are treated as section, there is a table of -% contents, etc.). -% -% Finally, there is the option \DescribeMacro{test}|test| that modifies the behavior to -% facilitate formatting tests. Only in |test| mode, the macros |\testspace|, -% |\testnewpage|, and |\testemptypage| have an effect: they generate space for the -% students to solve the given problems. Thus they can be left in the {\LaTeX} source. -% -% \DescribeMacro{\testspace}|\testspace| takes an argument that expands to a dimension, -% and leaves vertical space accordingly. \DescribeMacro{\testnewpage}|\testnewpage| makes -% a new page in |test| mode, and \DescribeMacro{\testemptypage}|\testemptypage| generates -% an empty page with the cautionary message that this page was intentionally left empty. -% -% Finally, the \DescribeMacro{\testheading}|\testheading| takes a keyword argument where -% the keys |duation| specifies a string that specifies the duration of the test, |min| -% specifies the equivalent in number of minutes, and |reqpts| the points that are required -% for a perfect grade. -% \begin{exfig}[ht] -% \makeatletter -% \@problem{1.1}{4}{10} -% \@problem{2.1}{4}{8} -% \@problem{2.2}{6}{10} -% \@problem{2.3}{6}{10} -% \@problem{3.1}{4}{8} -% \@problem{3.2}{4}{8} -% \@problem{3.3}{2}{4} -% \makeatother -% \begin{verbatim} -% \testheading{duration=one hour,min=60,reqpts=27} -% \end{verbatim} -% \vspace*{-3ex}\hrule\vspace*{.5ex} formats to\vspace*{1ex} \hrule\par\noindent\vspace*{2ex} -% \testheading{duration=one hour,min=60,reqpts=27} -% \caption{A generated test heading.}\label{fig:testheading} -% \end{exfig} -% -% \subsection{Including Assignments} -% -% The \DescribeMacro{\includeassignment}|\includeassignment| macro can be used to include -% an assignment from another file. It takes an optional KeyVal argument and a second -% argument which is a path to the file containing the problem (the macro assumes that -% there is only one |assignment| environment in the included file). The keys -% \DescribeMacro{number}|number|, \DescribeMacro{title}|title|, -% \DescribeMacro{type}|type|,\DescribeMacro{given}|given|, and \DescribeMacro{due}|due| -% are just as for the |assignment| environment and (if given) overwrite the ones specified -% in the |assignment| environment in the included file. -% -% \StopEventually{\newpage\PrintChanges} -% \newpage -% -% \section{The Implementation} -% -% \subsection{Package Options} -% -% The first step is to declare (a few) package options that handle whether certain -% information is printed or not. Some come with their own conditionals that are set by the -% options, the rest is just passed on to the |problems| package. -% -% \begin{macrocode} -%<*package> -\newif\iftest\testfalse -\newif\ifsolutions\solutionsfalse -\DeclareOption{test}{\testtrue\solutionsfalse} -\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] -\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{macrocode} -%<*ltxml> -# -*- CPERL -*- -package LaTeXML::Package::Pool; -use strict; -use LaTeXML::Package; -RequirePackage('problem'); -%</ltxml> -% \end{macrocode} -% -% Then we register the namespace of the requirements ontology -% \begin{macrocode} -%<*ltxml> -RegisterNamespace('assig'=>"http://omdoc.org/ontology/assignments#"); -RegisterDocumentNamespace('assig'=>"http://omdoc.org/ontology/assignments#"); -%</ltxml> -% \end{macrocode} -% -% \subsection{Assignments} -% -% We will prepare the keyval support for the |assignment| environment. -% -% \begin{macrocode} -%<*package> -\omdaddkey{assig}{number} -\omdaddkey{assig}{title} -\omdaddkey{assig}{type} -\omdaddkey{assig}{given} -\omdaddkey{assig}{due} -%</package> -% \end{macrocode} -% -% The next macro just sets the internal token register to the intended string. -% -% \begin{macrocode} -%<*package> -\def\AssignmentType#1{\gdef\assig@default@type{#1}} -\def\assig@default@type{Assignment} -%</package> -%<*ltxml> -%</ltxml> -% \end{macrocode} -% -% The next three macros are intermediate functions that handle the case gracefully, where -% the respective token registers are undefined. -% -% \begin{macrocode} -%<*package> -\def\Assig@Type{\ifx\assig@type\@empty\assig@default@type\else\assig@type\fi} -\def\Assig@Title{\ifx\assig@title\@empty\else\assig@title~\fi} -% \end{macrocode} -% -% The |\given@due| macro prints information about the given and due status of the -% 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} -%</package> -% \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{environment}{assignment} -% \begin{macrocode} -%<*package> -\newenvironment{assignment}[1][]% keyval args -{\omdsetkeys{assig}{#1}% collect the keys and correct them from the outside -\@ifundefined{incl@assig@title}{}{\def\assig@title{\incl@assig@title}} -\@ifundefined{incl@assig@type}{}{\def\assig@type{\incl@assig@type}} -\@ifundefined{incl@assig@num}{}{\def\assig@num{\incl@assig@num}} -\@ifundefined{incl@assig@due}{}{\def\assig@due{\incl@assig@due}} -\@ifundefined{incl@assig@given}{}{\def\assig@given{\incl@assig@given}} -\@ifundefined{assig@num}{\stepcounter{section}}% -{\setcounter{section}{\assig@num}\setcounter{problem}{0}} -\ifmultiple% -\section*{\Assig@Type~\arabic{section}:~\Assig@Title\given@due{\\(})} - \addcontentsline{toc}{section}{\Assig@Type~{\arabic{section}}:~\Assig@Title} -\else -\begin{center} -\Large\Course@Title\\ -{\bf{\Assig@Type}~{\arabic{section}}:~\Assig@Title\strut\\\large{\given@due()}} -\end{center} -\fi%ifmultiple -}{} -%</package> -% \end{macrocode} -% -% \begin{macrocode} -%<*ltxml> -DefEnvironment('{assignment} OptionalKeyVals:assig', - "<omdoc:omgroup ?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')() " - . "assig:dummy='for the namespace'" - . "?#locator(stex:srcref='#locator')()>" - . "<omdoc:metadata ?#locator(stex:srcref='#locator')()>" - . "<dc:title ?#locator(stex:srcref='#locator')()>" - . "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"); -%</ltxml> -% \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, -% -% \begin{macrocode} -%<*package> -\define@key{incl@assig}{number}{\def\incl@assig@num{#1}} -\define@key{incl@assig}{title}{\def\incl@assig@title{#1}} -\define@key{incl@assig}{type}{\def\incl@assig@type{#1}} -\define@key{incl@assig}{given}{\def\incl@assig@given{#1}} -\define@key{incl@assig}{due}{\def\incl@assig@due{#1}} -\newcommand{\includeassignment}[2][]{\bgroup\setkeys{incl@assig}{#1}\include{#2}\egroup} -%</package> -%<*ltxml> -DefMacro('\includeassignment [] {}','\input{#2}'); -%</ltxml> -% \end{macrocode} -% -% \begin{macrocode} -%<*package> -\def\CourseTitle#1{\gdef\Course@Title{#1}} -%</package> -%<*ltxml> -DefConstructor('\CourseTitle{}',''); -%</ltxml> -% \end{macrocode} -% -% \subsection{Typesetting Exams} -% -% \begin{macrocode} -%<*package> -\omdaddkey{testheading}{min} -\omdaddkey{testheading}{duration} -\omdaddkey{testheading}{reqpts} -\def\testheading#1{\omdsetkeys{testheading}{#1} -{\noindent\large NAME: \\[1ex] MATRICULATION NUMBER:\\[2ex] - {\textbf{You have -\ifx\test@heading@duration\@empty\testheading@min minutes\else\testheading@duration\fi -(sharp) for the test}};\\ Write the solutions to the sheet.}\par\noindent - -\newcount\check@time\check@time=\testheading@min -\advance\check@time by -\theassignment@totalmin -The scheduled time for solving this exam is {\theassignment@totalmin} minutes, -leaving you {\the\check@time} minutes for revising your exam. - -\newcount\bonus@pts\bonus@pts=\theassignment@totalpts -\advance\bonus@pts by -\testheading@reqpts -You can reach {\theassignment@totalpts} points if you solve all problems. You will only need -{\testheading@reqpts} points for a perfect score, i.e.\ {\the\bonus@pts} points are -bonus points. \vfill -\begin{center} - {\Large\em -% You have ample time, so take it slow and avoid rushing to mistakes!\\[2ex] - Different problems test different skills and knowledge, so do not get stuck on - one problem.}\vfill\par\correction@table -\end{center}\newpage} -%</package> -%<*ltxml> -DefConstructor('\testheading{}',''); -%</ltxml> -% \end{macrocode} -% -% \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 - blank for extra space\end{center}\vfill\eject\else\fi} -%</package> -%<*ltxml> -DefConstructor('\testspace{}',''); -DefConstructor('\testnewpage',''); -DefConstructor('\testemptypage',''); -%</ltxml> -% \end{macrocode} -% -% \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 -\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}% -\stepcounter{assignment@probs} -\def\correction@table{\begin{tabular}{|l|*{\theassignment@probs}{c|}|p{3cm}|}\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@reached & & \\[.7cm]\hline -\end{tabular}} -%</package> -% \end{macrocode} -% \end{macro} -% -% \subsection{Leftovers} -% -% at some point, we may want to reactivate the logos font, then we use -% \begin{verbatim} -% here we define the logos that characterize the assignment -% \font\bierfont=../assignments/bierglas -% \font\denkerfont=../assignments/denker -% \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} -% \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 -%%% Local Variables: -%%% mode: doctex -%%% TeX-master: t -%%% End: -% \fi diff --git a/Master/texmf-dist/source/latex/stex/bin/checksum b/Master/texmf-dist/source/latex/stex/bin/checksum index 7e521deaa7c..9f0e533a8d4 100755 --- a/Master/texmf-dist/source/latex/stex/bin/checksum +++ b/Master/texmf-dist/source/latex/stex/bin/checksum @@ -26,7 +26,10 @@ $path = abs_path($path); my ($volume,$dir,$file) = File::Spec->splitpath( $path ); my @lines = `cd $dir; pdflatex "\\nonstopmode\\input{$file}"` if ($mode eq "update"); my ($checksum) = map {$_=~/^\* The checksum should be (\d+)!/; $1;} grep ($_ =~ /^\* The checksum should be (\d+)!/,@lines) if @lines; - +if (!$checksum) { +#One more possible error message: + ($checksum) = map {$_=~/^! Package doc Error: Checksum not passed \((\d+)<>(\d+)\)\./; $2;} grep ($_ =~ /^! Package doc Error: Checksum not passed \((\d+)<>(\d+)\)\./,@lines) if @lines; +} open(IN,"<$path") or die "Cannot open DTX source: $path\n"; @lines = (); while (<IN>) { @@ -38,8 +41,8 @@ print OUT join("",@lines); close(OUT); ######### Subroutines ############ sub update { - my $checksum=$_[1]||"1"; - $_[0]=~s/\\CheckSum\{\d*\}/\\CheckSum{$checksum}/; + my $checksum=$_[1]; + $_[0]=~s/\\CheckSum\{\d*\}/\\CheckSum{$checksum}/ if $checksum; $_[0]; } diff --git a/Master/texmf-dist/source/latex/stex/bin/grep-rerun b/Master/texmf-dist/source/latex/stex/bin/grep-rerun new file mode 100755 index 00000000000..f73ef082fbb --- /dev/null +++ b/Master/texmf-dist/source/latex/stex/bin/grep-rerun @@ -0,0 +1,59 @@ +#!/usr/bin/perl -w +####################################################################################### +# A tool for updating .dtx files with a correspodning checksum counter # +# Copyright (c) 2010, Deyan Ginev, released under the Gnu General Public License (GPL)# +# see http://www.gnu.org/copyleft/gpl.html # +# $URL: https://svn.kwarc.info/repos/stex/trunk/bin/gre-rerun$ # +####################################################################################### + +use strict; + +use Getopt::Long; +use Pod::Usage; +use File::Spec; +use Cwd qw(abs_path); + +####### start of program ####### +my ($errlog,$pattern)=@ARGV; +my %rerun_set = (); +open(IN,"<",$errlog); +my ($errvol,$errdir)=File::Spec->splitpath($errlog); +my $currpath=abs_path($errdir); +while (<IN>) { + #Entering, update path + if (/^Entering (.+)$/) { + $currpath.="/$1"; + } + #Leaving, update path + elsif (/^Leaving (.+)$/) { + $currpath =~ s/(\/$1)$//; + } + #Matching error, note source + elsif (/$pattern/) { + my ($name) = split(/:/,$_); + ($name) = split(/\./,$name); + $rerun_set{$currpath."/".$name.".tex"}=1; + } +} +#Perform rerun of affected sources: +print STDERR scalar(keys %rerun_set)." sources to rerun:\n"; +foreach (sort keys %rerun_set) { + my ($vol,$dir,$file) = File::Spec->splitpath( $_ ); + print STDERR "Trying $_\n"; + $file=~s/\.tex$/.omdoc/; + print STDERR `cd $dir; make $file -B`; +} +close(IN); + + +__END__ + + +=head1 SYNOPSIS + +grep-rerun <errlog filename> <grep pattern> + +Purpose: + Given an error log file, generated via the sTeX Makefiles, and an error pattern, fetches and reconverts all sources that suffered this error. +Example: + grep-rerun latex.errlog "Fatal:" diff --git a/Master/texmf-dist/source/latex/stex/bin/sms b/Master/texmf-dist/source/latex/stex/bin/sms index 4599f3e2763..360be4ea814 100755 --- a/Master/texmf-dist/source/latex/stex/bin/sms +++ b/Master/texmf-dist/source/latex/stex/bin/sms @@ -1,14 +1,17 @@ #!/usr/bin/perl -w ####################################################################################### # A tool for creating STeX Module Signatures (SMS) files. # -# Copyright (c) 2005, Ioan Sucan, released under the Gnu General Public License (GPL) # +# Copyright (c) 2005, Ioan Sucan; (c) 2010, Deyan Ginev, +# released under the Gnu General Public License (GPL) # # see http://www.gnu.org/copyleft/gpl.html # # $URL: svn://kwarc.eecs.iu-bremen.de/repos/kwarc/projects/content/bin/sms$ # # $Date: 2006-10-22 20:01:47 +0200 (Sun, 22 Oct 2006) $ $Rev: 10669 $ # ####################################################################################### use strict; - +use File::Spec::Functions qw(rel2abs); +use File::Basename; +use lib dirname(rel2abs($0)); #Assumption: Modparse is in the same folder as the sms binary. use Getopt::Long; use Modparse; use Pod::Usage; diff --git a/Master/texmf-dist/source/latex/stex/bin/stexml b/Master/texmf-dist/source/latex/stex/bin/stexml new file mode 100755 index 00000000000..2c0586b9130 --- /dev/null +++ b/Master/texmf-dist/source/latex/stex/bin/stexml @@ -0,0 +1,2 @@ +exec latexmlc $1 --path=../../../stex/sty --path=../../../stex/rnc --path=../../../stex/rnc/omdoc --path=../../../stex/sty/modules --path=../../../stex/sty/statements --path=../../../stex/sty/sproof --path=../../../stex/sty/omtext --path=../../../stex/sty/omdoc --path=../../../stex/sty/sref --path=../../../stex/sty/presentation --path=../../../stex/sty/dcm --path=../../../stex/sty/reqdoc --path=../../../stex/sty/metakeys --path=../../../stex/sty/mikoslides --path=../../../stex/sty/problem --path=../../../stex/sty/assignment --path=../../../stex/sty/etc --path=../../../sty --path=../../../sty/ded --path=../../../sty/ed --local --mode=standard --destination=#dir/#name.tex.xml --postdest=#dir/#name.omdoc --log=#dir/#name.ltxlog --post --stylesheet=../../../stex/xsl/omdocpost.xsl \ + --openmath --pmml
\ No newline at end of file diff --git a/Master/texmf-dist/source/latex/stex/bin/stexmlmod b/Master/texmf-dist/source/latex/stex/bin/stexmlmod new file mode 100755 index 00000000000..55dd1f6ab37 --- /dev/null +++ b/Master/texmf-dist/source/latex/stex/bin/stexmlmod @@ -0,0 +1,2 @@ +exec latexmlc --preamble=../../../lib/pre.tex $1 --path=../../../stex/sty --path=../../../stex/rnc --path=../../../stex/rnc/omdoc --path=../../../stex/sty/modules --path=../../../stex/sty/statements --path=../../../stex/sty/sproof --path=../../../stex/sty/omtext --path=../../../stex/sty/omdoc --path=../../../stex/sty/sref --path=../../../stex/sty/presentation --path=../../../stex/sty/dcm --path=../../../stex/sty/reqdoc --path=../../../stex/sty/metakeys --path=../../../stex/sty/mikoslides --path=../../../stex/sty/problem --path=../../../stex/sty/assignment --path=../../../stex/sty/etc --path=../../../sty --path=../../../sty/ded --path=../../../sty/ed --local --mode=fragment --destination=#dir/#name.tex.xml --postdest=#dir/#name.omdoc --log=#dir/#name.ltxlog --post --stylesheet=../../../stex/xsl/omdocpost.xsl \ + --openmath --pmml diff --git a/Master/texmf-dist/source/latex/stex/cmathml/cmathml.dtx b/Master/texmf-dist/source/latex/stex/cmathml/cmathml.dtx index 6e6645d5164..9d121dc25d9 100644 --- a/Master/texmf-dist/source/latex/stex/cmathml/cmathml.dtx +++ b/Master/texmf-dist/source/latex/stex/cmathml/cmathml.dtx @@ -22,17 +22,18 @@ \usepackage{../ctansvn} \usepackage{hyperref} \usepackage[eso-foot,today]{svninfo} -\svnInfo $Id: cmathml.dtx 1502 2010-07-20 08:17:00Z kohlhase $ +\svnInfo $Id: cmathml.dtx 1671 2010-11-06 07:05:15Z kohlhase $ \svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/cmathml/cmathml.dtx $ \makeindex \floatstyle{boxed} \newfloat{exfig}{thp}{lop} \floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{cmathml.dtx}\end{document} %</driver> % \fi % -%\CheckSum{1586} +%\iffalse\CheckSum{1586}\fi % % \changes{v0.1}{2006/01/10}{Initial Version} % \changes{v0.2}{2006/01/16}{Added big operators} @@ -744,6 +745,16 @@ % |\Ccomplement| & 1 & |\Ccomplement{\Cnaturalnumbers}| & $\Ccomplement{\mathbb{N}}$\\\hline %\end{cmtab} % +% +% \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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% % \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography}\newpage % % \section{The Implementation}\label{sec:impl} diff --git a/Master/texmf-dist/source/latex/stex/cnx/cnx.dtx b/Master/texmf-dist/source/latex/stex/cnx/cnx.dtx index f851073fead..55a197b6501 100644 --- a/Master/texmf-dist/source/latex/stex/cnx/cnx.dtx +++ b/Master/texmf-dist/source/latex/stex/cnx/cnx.dtx @@ -20,17 +20,18 @@ \bibliography{kwarc} \usepackage{ctansvn} \usepackage[eso-foot,today]{svninfo} -\svnInfo $Id: cnx.dtx 1502 2010-07-20 08:17:00Z kohlhase $ +\svnInfo $Id: cnx.dtx 1671 2010-11-06 07:05:15Z kohlhase $ \svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/cnx/cnx.dtx $ \makeindex \floatstyle{boxed} \newfloat{exfig}{thp}{lop} \floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{cnx.dtx}\end{document} %</driver> % \fi % -%\CheckSum{432} +%\iffalse\CheckSum{432}\fi % % \changes{v0.1}{2005/12/06}{Initial Version} % \changes{v0.2}{2006/01/11}{Namespaces now work} @@ -98,6 +99,12 @@ % enclosed in curly braces, as in |\foo[args={a,comma,separated,list}]|. Note that the % order the key/value pairs appear in a KeyVal Argument is immaterial. % +% \subsection{Package Options}\label{sec:user:options} +% +% The |cnx| package takes a single option: \DescribeMacro{showmeta}|showmeta|. If this is +% set, then the metadata keys are shown (see~\cite{Kohlhase:metakeys:ctan} for details and +% customization options). +% % \subsection{Document Structure} % % \begin{exfig} @@ -324,6 +331,16 @@ % a caption, and tell {\latexml} that\ednote{err, exactly what does it tell latexml?} the % original of the images has the MIME type |image/jpeg|. % +% +% \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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% % \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography}\newpage % % \section{The Implementation} @@ -335,6 +352,22 @@ % since the documentation applies to both of them and to prevent them from getting out of % sync. % +% \subsection{Package Options}\label{sec:impl:options} +% +% We declare some switches which will modify the behavior according to the package +% options. Generally, an option |xxx| will just set the appropriate switches to true +% (otherwise they stay false). First we have the general options +% \begin{macrocode} +%<*package> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{omdoc}} +% \end{macrocode} +% Finally, we need to declare the end of the option declaration section to {\LaTeX}. +% \begin{macrocode} +\ProcessOptions +%</package> +% \end{macrocode} +% % We first make sure that the |sref|~\ctancite{Kohlhase:sref} and |graphicx| packages are % loaded. % \begin{macrocode} @@ -372,7 +405,7 @@ package LaTeXML::Package::Pool; use strict; use LaTeXML::Package; -RequirePackage('omd'); +RequirePackage('metakeys'); % \end{macrocode} % We set up the necessary namespaces, the first one is the default one for {\cnxml} % \begin{macrocode} @@ -447,9 +480,9 @@ Let('\thedocument@ID','\@empty'); % \begin{environment}{cnxmodule} % \begin{macrocode} %<*cls> -\omdaddkey{cnxmodule}{name} +\addmetakey{cnxmodule}{name} \srefaddidkey{cnxmodule}{id} -\newenvironment{cnxmodule}[1][]{\omdsetkeys{cnxmodule}{#1}}{} +\newenvironment{cnxmodule}[1][]{\metasetkeys{cnxmodule}{#1}}{} %</cls> %<*ltxml> DefKeyVal('cnxmodule','name','Semiverbatim'); @@ -493,19 +526,19 @@ DefEnvironment('{ccontent}',"<cnx:content>#body</cnx:content>"); \newenvironment{csection}[2][]% {\stepcounter{section}\strut\\[1.5ex]\noindent% {\Large\bfseries\arabic{section}.~{#2}}\\[1.5ex] -\omdsetkeys{sectioning}{#1}} +\metasetkeys{sectioning}{#1}} {} \newcounter{subsection}[section] \newenvironment{csubsection}[2][] {\refstepcounter{subsection}\strut\\[1ex]\noindent% {\large\bfseries{\arabic{section}.\arabic{subsection}.~#2\\[1ex]}}% -\omdsetkeys{sectioning}{#1}}% +\metasetkeys{sectioning}{#1}}% {} \newcounter{subsubsection}[subsection] \newenvironment{csubsubsection}[2][] {\refstepcounter{subsubsection}\strut\\[.5ex]\noindent {\bfseries\arabic{section}.\arabic{subsection}.\arabic{subsubsecction}~#2\\[.5ex]}% -\omdsetkeys{sectioning}{#1}}{} +\metasetkeys{sectioning}{#1}}{} %</cls> %<*ltxml> DefKeyVal('sectioning','id','Semiverbatim'); @@ -532,7 +565,7 @@ DefEnvironment('{csubsubsection}OptionalKeyVals:sectioning{}', % \begin{macrocode} %<*cls> \srefaddidkey{para}{id} -\newenvironment{cpara}[1][]{\omdsetkeys{para}{#1}}{\par} +\newenvironment{cpara}[1][]{\metasetkeys{para}{#1}}{\par} %</cls> %<*ltxml> DefKeyVal('para','id','Semiverbatim'); @@ -558,9 +591,9 @@ Tag('cnx:para', autoClose=>1, autoOpen=>1); % \begin{macrocode} %<*cls> \srefaddidkey{note} -\omdaddkey{note}{type} +\addmetakey{note}{type} \newenvironment{cnote}[1][]% -{\omdsetkeys{note}{#1}\par\noindent\strut\hfill\begin{minipage}{10cm}{\bfseries\note@type}:~}% +{\metasetkeys{note}{#1}\par\noindent\strut\hfill\begin{minipage}{10cm}{\bfseries\note@type}:~}% {\end{minipage}\hfill\strut\par} %</cls> %<*ltxml> @@ -578,7 +611,7 @@ DefEnvironment('{cnote}OptionalKeyVals:note','<cnx:note %&KeyVals(#1)>#body</cnx %<*cls> \srefaddidkey{equation}{id} \newenvironment{cequation}[1][]% -{\omdsetkeys{equation}{#1}\begin{displaymath}} +{\metasetkeys{equation}{#1}\begin{displaymath}} {\end{displaymath}} %</cls> %<*ltxml> @@ -602,10 +635,10 @@ DefEnvironment('{cequation} OptionalKeyVals:equation', % \begin{macrocode} %<*cls> \srefaddidkey{cquote} -\omdaddkey{cquote}{type} -\omdaddkey{cquote}{src} +\addmetakey{cquote}{type} +\addmetakey{cquote}{src} \newenvironment{cquote}[1][]{% -\omdsetkeys{cquote}{#1}\begin{center}\begin{minipage}{.8\textwidth}}{\end{minipage}\end{center}} +\metasetkeys{cquote}{#1}\begin{center}\begin{minipage}{.8\textwidth}}{\end{minipage}\end{center}} %</cls> %<*ltxml> DefKeyVal('cquote','id','Semiverbatim'); @@ -765,8 +798,8 @@ DefConstructor('\ref Semiverbatim', "<cnx:cnxn target='#1'>&LookupValue('LABEL@# % \begin{macrocode} %<*cls> \srefaddidkey{example} -\omdaddkey{example}{name} -\newenvironment{cexample}[1][]{\omdsetkeys{example}{#1} +\addmetakey{example}{name} +\newenvironment{cexample}[1][]{\metasetkeys{example}{#1} {\ifx\example@name\@empty\else\noindent\bfseries{\example@name}\fi}} {} %</cls> @@ -789,14 +822,14 @@ DefEnvironment('{cexample}OptionalKeyVals:example', %<*cls> \newcounter{cexercise} \srefaddidkey{cexercise} -\omdaddkey{cexercise}{name} -\newenvironment{cexercise}[1][]{\omdsetkeys{cexercise}{#1} +\addmetakey{cexercise}{name} +\newenvironment{cexercise}[1][]{\metasetkeys{cexercise}{#1} {\ifx\cexercise@name\@empty\else\stepcounter{cexercise}\noindent\bfseries{\cexercise@name~\arabic{cexercise}}\fi}} {} \srefaddidkey{cproblem} -\newenvironment{cproblem}[1][]{\omdsetkeys{cproblem}{#1}}{}{} +\newenvironment{cproblem}[1][]{\metasetkeys{cproblem}{#1}}{}{} \srefaddidkey{csolution} -\newenvironment{csolution}[1][]{\omdsetkeys{csolution}{#1}}{\par\noindent\bfseries{Solution}}{} +\newenvironment{csolution}[1][]{\metasetkeys{csolution}{#1}}{\par\noindent\bfseries{Solution}}{} %</cls> %<*ltxml> DefKeyVal('cexercise','id','Semiverbatim'); @@ -827,9 +860,9 @@ DefEnvironment('{csolution}OptionalKeyVals:cproblem', % \begin{macrocode} %<*cls> \srefaddidkey{rule} -\omdaddkey{rule}{name} -\omdaddkey{rule}{type} -\newenvironment{crule}[1][]{\omdsetkeys{rule}{#1}% +\addmetakey{rule}{name} +\addmetakey{rule}{type} +\newenvironment{crule}[1][]{\metasetkeys{rule}{#1}% {\noindent\bfseries{\rule@type:}\ifx\rule@name\@empty\else~(\rule@name)\fi}}% {} %</cls> @@ -850,7 +883,7 @@ DefEnvironment('{crule}OptionalKeyVals:rule', % \begin{macrocode} %<*cls> \srefaddidkey{statement} -\newenvironment{statement}[1][]{\omdsetkeys{statement}{#1}}{} +\newenvironment{statement}[1][]{\metasetkeys{statement}{#1}}{} %</cls> %<*ltxml> DefKeyVal('statement','id','Semiverbatim'); @@ -863,7 +896,7 @@ DefEnvironment('{statement} OptionalKeyVals:statement','<cnx:statement %&KeyVals % \begin{macrocode} %<*cls> \srefaddidkey{proof} -\newenvironment{proof}[1][]{\omdsetkeys{proof}{#1}}{} +\newenvironment{proof}[1][]{\metasetkeys{proof}{#1}}{} %</cls> %<*ltxml> DefKeyVal('proof','id','Semiverbatim'); @@ -876,9 +909,9 @@ DefEnvironment('{proof}OptionalKeyVals:proof','<cnx:proof %&KeyVals(#1)>#body</c % \begin{macrocode} %<*cls> \srefaddidkey{definition} -\omdaddkey{definition}{term} -\omdaddkey{definition}{seealso} -\newenvironment{definition}[1][]{\omdsetkeys{definition}{#1}{\noindent\bfseries{Definition:}}}{} +\addmetakey{definition}{term} +\addmetakey{definition}{seealso} +\newenvironment{definition}[1][]{\metasetkeys{definition}{#1}{\noindent\bfseries{Definition:}}}{} %</cls> %<*ltxml> DefKeyVal('definition','id','Semiverbatim'); @@ -898,7 +931,7 @@ DefEnvironment('{definition}OptionalKeyVals:definition', % \begin{macrocode} %<*cls> \srefaddidkey{meaning} -\newenvironment{cmeaning}[1][]{\omdsetkeys{meaning}{#1}}{} +\newenvironment{cmeaning}[1][]{\metasetkeys{meaning}{#1}}{} %</cls> %<*ltxml> DefKeyVal('meaning','id','Semiverbatim'); @@ -912,11 +945,11 @@ DefEnvironment('{cmeaning}OptionalKeyVals:meaning','<cnx:meaning %&KeyVals(#1)># % \begin{macro}{cnxn} % \begin{macrocode} %<*cls> -\omdaddkey{cnxn}{document} -\omdaddkey{cnxn}{target} -\omdaddkey{cnxn}{strength} +\addmetakey{cnxn}{document} +\addmetakey{cnxn}{target} +\addmetakey{cnxn}{strength} \newcommand{\cnxn}[2][]% keys, link text -{\omdsetkeys{cnxn}{#1}{\underline{#2}}\footnote{{\ttfamily\@ifx\cnxn@document\@empty\cnxn@document\fi\#\cnxn@target}}} +{\metasetkeys{cnxn}{#1}{\underline{#2}}\footnote{{\ttfamily\@ifx\cnxn@document\@empty\cnxn@document\fi\#\cnxn@target}}} \newcommand\@makefntext[1]{\parindent 1em\noindent\hb@xt@1.8em{\hss\@makefnmark}#1} %</cls> %<*ltxml> @@ -931,8 +964,8 @@ DefConstructor('\cnxn OptionalKeyVals:cnxn {}','<cnx:cnxn %&KeyVals(#1)>#1</cnx: % \begin{macro}{link} % \begin{macrocode} %<*cls> -\omdaddkey{link}{src} -\newcommand{\link}[2][]{\omdsetkeys{link}{#1}\underline{#2}} +\addmetakey{link}{src} +\newcommand{\link}[2][]{\metasetkeys{link}{#1}\underline{#2}} %</cls> %<*ltxml> DefKeyVal('link','src','Semiverbatim'); @@ -950,13 +983,13 @@ DefConstructor('\link OptionalKeyVals:link {}','<cnx:link %&KeyVals(#1)>#2</cnx: % \begin{macrocode} %<*cls> \srefaddidkey{cfigure} -\omdaddkey{cfigure}{type} -\omdaddkey{cfigure}{caption} +\addmetakey{cfigure}{type} +\addmetakey{cfigure}{caption} \newcounter{figure} \newcommand{\cfigure}[3][]{% cnx_keys, graphicx_keys, path \begin{center}% \includegraphics[#2]{#3}% -\omdsetkeys{cfigure}{#1}\sref@target% +\metasetkeys{cfigure}{#1}\sref@target% \ifx\cfigure@caption\@empty\else \par\noindent Figure\refstepcounter{figure} {\arabic{figure}}: \cfigure@caption% \protected@edef\@currentlabel{\arabic{figure}}% @@ -981,8 +1014,8 @@ DefConstructor('\cfigure OptionalKeyVals:cfigure Semiverbatim Semiverbatim', % \begin{macro}{ccite} % \begin{macrocode} %<*cls> -\omdaddkey{ccite}{src} -\newcommand{\ccite}[2][]{\omdsetkeys{ccite}{#1}\emph{#2}} +\addmetakey{ccite}{src} +\newcommand{\ccite}[2][]{\metasetkeys{ccite}{#1}\emph{#2}} %</cls> %<*ltxml> DefKeyVal('ccite','src','Semiverbatim'); @@ -1007,9 +1040,9 @@ DefConstructor('\term[]{}',"<cnx:term>#2</cnx:term>"); % \begin{environment}{metadata} % \begin{macrocode} %<*cls> -\omdaddkey{metadata}{version} -\omdaddkey{metadata}{created} -\omdaddkey{metadata}{revised} +\addmetakey{metadata}{version} +\addmetakey{metadata}{created} +\addmetakey{metadata}{revised} \newsavebox{\metadatabox} \newenvironment{metadata}[1][]% {\noindent\hfill\begin{lrbox}{\metadatabox} @@ -1062,13 +1095,13 @@ DefEnvironment('{maintainerlist}',"<md:maintainerlist>#body</md:maintainerlist>" % \begin{macrocode} %<*cls> \srefaddidkey{auth} -\omdaddkey{auth}{honorific} -\omdaddkey{auth}{firstname} -\omdaddkey{auth}{other} -\omdaddkey{auth}{surname} -\omdaddkey{auth}{lineage} -\omdaddkey{auth}{email} -\newcommand{\cnxauthor}[1][]{\omdsetkeys{auth}{#1}\auth@first~\auth@sur,} +\addmetakey{auth}{honorific} +\addmetakey{auth}{firstname} +\addmetakey{auth}{other} +\addmetakey{auth}{surname} +\addmetakey{auth}{lineage} +\addmetakey{auth}{email} +\newcommand{\cnxauthor}[1][]{\metasetkeys{auth}{#1}\auth@first~\auth@sur,} %</cls> %<*ltxml> DefKeyVal('auth','id','Semiverbatim'); @@ -1091,7 +1124,7 @@ DefConstructor('\cnxauthor OptionalKeyVals:auth', % \begin{macro}{maintainer} % \begin{macrocode} %<*cls> -\newcommand{\maintainer}[1][]{\omdsetkeys{auth}{#1}\auth@first~\auth@sur,} +\newcommand{\maintainer}[1][]{\metasetkeys{auth}{#1}\auth@first~\auth@sur,} %</cls> %<*ltxml> DefConstructor('\maintainer OptionalKeyVals:auth', @@ -1161,12 +1194,12 @@ DefEnvironment('{cnxabstract} OptionalKeyVals:cnxabstract', % LocalWords: def-cmean cnxn keyval hh ss authorlist maintainerlist cnxauthor % LocalWords: firstname keywordlist cnxabstract cexercise cproblem csolution % LocalWords: cfigure cfigure cgraphics graphicx printbibliography textsf sref -% LocalWords: langle textsf langle ltxml ctancite sref cls setlength omd ltx +% LocalWords: langle textsf langle ltxml ctancite sref cls setlength ltx % LocalWords: paperheight paperwidth size10.clo pagenumbering ltxml.dtd enumi % LocalWords: itemizei idprefix itemizeii itemizeiii itemizeiv itemizev enumii % LocalWords: itemizevi enumiii enumiv enumv enumvi theenumi theenumii Sucan -% LocalWords: theenumiii theenumiv theequation textwidth thedocument omdaddkey -% LocalWords: environement srefaddidkey newenvironment omdsetkeys Semiverbatim +% LocalWords: theenumiii theenumiv theequation textwidth thedocument +% LocalWords: environement srefaddidkey newenvironment Semiverbatim % LocalWords: OptionalKeyVals newcounter stepcounter noindent bfseries % LocalWords: refstepcounter subsubsection whatsit findnodes hfill % LocalWords: displaymath cquote emph eqnarray envionment endeqnarray csname diff --git a/Master/texmf-dist/source/latex/stex/dcm/dcm.dtx b/Master/texmf-dist/source/latex/stex/dcm/dcm.dtx index c78aeb8566f..ba7bdc3df31 100644 --- a/Master/texmf-dist/source/latex/stex/dcm/dcm.dtx +++ b/Master/texmf-dist/source/latex/stex/dcm/dcm.dtx @@ -1,8 +1,8 @@ % \iffalse meta-comment % An Infrastructure for marking up Dublin Core Metadata in LaTeX documents % $URL: https://svn.kwarc.info/repos/stex/trunk/sty/dcm/dcm.dtx $ -% $Rev: 1502 $; last modified by $Author: kohlhase $ -% $Date: 2010-07-20 10:17:00 +0200 (Tue, 20 Jul 2010) $ +% $Rev: 1671 $; last modified by $Author: kohlhase $ +% $Date: 2010-11-06 08:05:15 +0100 (Sat, 06 Nov 2010) $ % Copyright (c) 2007 Michael Kohlhase, all rights reserved % this file is released under the % LaTeX Project Public License (LPPL) @@ -21,8 +21,9 @@ \bibliography{kwarc} \usepackage{../ctansvn} \usepackage{hyperref} +\usepackage{stex-logo} \usepackage[eso-foot,today]{svninfo} -\svnInfo $Id: dcm.dtx 1502 2010-07-20 08:17:00Z kohlhase $ +\svnInfo $Id: dcm.dtx 1671 2010-11-06 07:05:15Z kohlhase $ \svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/dcm/dcm.dtx $ \makeindex \floatstyle{boxed} @@ -32,11 +33,12 @@ url=http://dfki.de/jdoe]{John Doe} \DCMperson[id=miko,affiliation={Jacobs University, Bremen}, url=http://kwarc.info/kohlhase]{Michael Kohlhase} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{dcm.dtx}\end{document} %</driver> % \fi % -%\CheckSum{667} +%\iffalse\CheckSum{667}\fi % % \changes{v0.1}{2007/01/02}{First Hack for OMDoc spec} % \changes{v0.2}{2008/06/17}{First Version with Documentation} @@ -72,6 +74,12 @@ % % \DCMsection[id=user,creators={miko,jdoe}]{The User Interface} % +% \DCMsubsection[id=user.options]{Package Options} +% +% The |dcm| package takes a single option: \DescribeMacro{showmeta}|showmeta|. If this is +% set, then the metadata keys are shown (see~\cite{Kohlhase:metakeys:ctan} for details and +% customization options). +% % \DCMsubsection{Persons} % % The |dcm| package recognizes that from a metadata perspective, persons are complex @@ -261,10 +269,39 @@ % \end{tabular} % \end{center} % +% +% \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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% % \StopEventually{\printbibliography} % % \DCMsection[creators=jdoe,id=impl]{The Implementation} -% +% +% The |dcm| package generates two files: the {\LaTeX} package (all the code between +% {\textsf{$\langle$*package$\rangle$}} and {\textsf{$\langle$/package$\rangle$}}) and the +% {\latexml} bindings (between {\textsf{$\langle$*ltxml$\rangle$ and +% $\langle$/ltxml$\rangle$}}). We keep the corresponding code fragments together, +% since the documentation applies to both of them and to prevent them from getting out of +% sync. +% +% \DCMsubsection[id=impl.options]{Package Options} +% The first step is to declare (a few) package options that handle whether certain +% information is printed or not. They all come with their own conditionals that are set by +% the options. +% +% \begin{macrocode} +%<*package> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\ProcessOptions +%</package> +% \end{macrocode} +% % The first measure is to ensure that the |KeyVal| package is loaded (in the right % version). For {\latexml} we also initialize the package inclusions. % \begin{macrocode} @@ -288,22 +325,22 @@ RequirePackage('sref'); % % \begin{macrocode} %<*package> -\omdaddkey{dcm@person}{id} -\omdaddkey{dcm@person}{birthdate} -\omdaddkey{dcm@person}{email} -\omdaddkey{dcm@person}{url} -\omdaddkey{dcm@person}{affiliation} -\omdaddkey{dcm@person}{personaltitle} -\omdaddkey{dcm@person}{academictitle} -\omdaddkey{dcm@person}{department} -\omdaddkey{dcm@person}{workaddress} -\omdaddkey{dcm@person}{privaddress} -\omdaddkey{dcm@person}{worktel} -\omdaddkey{dcm@person}{privtel} -\omdaddkey{dcm@person}{workfax} -\omdaddkey{dcm@person}{privfax} -\omdaddkey{dcm@person}{worktelfax} -\omdaddkey{dcm@person}{privtelfax} +\addmetakey{dcm@person}{id} +\addmetakey{dcm@person}{birthdate} +\addmetakey{dcm@person}{email} +\addmetakey{dcm@person}{url} +\addmetakey{dcm@person}{affiliation} +\addmetakey{dcm@person}{personaltitle} +\addmetakey{dcm@person}{academictitle} +\addmetakey{dcm@person}{department} +\addmetakey{dcm@person}{workaddress} +\addmetakey{dcm@person}{privaddress} +\addmetakey{dcm@person}{worktel} +\addmetakey{dcm@person}{privtel} +\addmetakey{dcm@person}{workfax} +\addmetakey{dcm@person}{privfax} +\addmetakey{dcm@person}{worktelfax} +\addmetakey{dcm@person}{privtelfax} %</package> % \end{macrocode} % @@ -347,7 +384,7 @@ sub ExportMetadata { % \begin{macro}{DCMPerson} % \begin{macrocode} %<*package> -\newcommand{\DCMperson}[2][]{\omdsetkeys{dcm@person}{#1} +\newcommand{\DCMperson}[2][]{\metasetkeys{dcm@person}{#1} \ifx\dcm@person@id\@empty\@latex@warning{key 'id' undefined in DCMperson}\else \dcm@pers@def{name}{#2} \dcm@pers@def{email}{\dcm@person@email} @@ -389,7 +426,6 @@ DefKeyVal('dcm@person','worktelfax','Semiverbatim'); DefKeyVal('dcm@person','privtelfax','Semiverbatim'); DefConstructor('\DCMperson OptionalKeyVals:dcm@person {}','', -beforeDigest=> sub { AssignValue(inPreamble=>0); }, afterDigest=>sub { my ($stomach,$whatsit)=@_; my $keys=$whatsit->getArg(1); @@ -447,7 +483,7 @@ DefEnvironment('{DCmetadata}[]', "<omdoc:metadata>#body</omdoc:metadata>"); % % \begin{macrocode} %<*package> -\def\dc@mtabline#1#2{\xdef\tab@line{}% +\def\dcm@tabline#1#2{\xdef\tab@line{}% \@for\@p:={#1}\do{\xdef\tab@line{\tab@line&\dcm@pers@ref\@p{#2}}} \tab@line} \def\dcm@atabline#1#2#3{\xdef\tab@line{}% @@ -767,13 +803,14 @@ DefConstructor('\DCMabstract{}',"<dc:description>#1</dc:description>"); % \DCMsubsection{Augmented Sectioning Macros} % % \begin{macro}{\dcm@sect@clear@keys} -% We first define the sectioning keys with the infrastructure from the |omd| package~\ctancite{Kohlhase:omd} +% We first define the sectioning keys with the infrastructure from the |metakeys| +% package~\ctancite{Kohlhase:metakeys} % \begin{macrocode} %<*package> \srefaddidkey{dcm@sect} -\omdaddkey{dcm@sect}{short} -\omdaddkey{dcm@sect}{creators} -\omdaddkey{dcm@sect}{contributors} +\addmetakey{dcm@sect}{short} +\addmetakey{dcm@sect}{creators} +\addmetakey{dcm@sect}{contributors} %</package> % \end{macrocode} % \end{macro} @@ -785,7 +822,7 @@ DefConstructor('\DCMabstract{}',"<dc:description>#1</dc:description>"); % |\dcm@section@*@style| macro specified \meta{style}. % \begin{macrocode} %<*package> -\def\dcm@section#1#2#3{\def\dcm@sect@type{#1}\omdsetkeys{dcm@sect}{#3}\sref@target% +\def\dcm@section#1#2#3{\def\dcm@sect@type{#1}\metasetkeys{dcm@sect}{#3}\sref@target% \ifx\dcm@sect@short\@empty\csname #1\endcsname{#2}% \else\csname #1\endcsname[\dcm@sect@short]{#2}\fi~% \@ifundefined{sect@style} % @@ -970,6 +1007,7 @@ RawTeX('\def\ISOtimestamp{\count1=\time\divide\count1 by 60 % hours \def\dcm@section@heading{Section} \def\dcm@subsection@heading{Subsection} \def\dcm@subsubsection@heading{Subsubsection} +\def\dcm@paragraph@heading{Paragraph} %</package> % \end{macrocode} % @@ -1020,8 +1058,8 @@ Tag('dc:title',afterOpen=>\&numberIt,afterClose=>\&locateIt); % LocalWords: DCMlicensenotice DCMlicensenotice DCMcopyrightnotice titlepage % LocalWords: DCMcopyrightnotice DCMcclicense DCMcclicense user.blockstyles % LocalWords: DCMchapter DCMchatper DCMsubsubsection DCMsubsubsection ltxml -% LocalWords: user.conig makeatletter printbibliography omdaddkey expandafter -% LocalWords: xdef csname endcsname newcommand omdsetkeys ifx ifundefined affs +% LocalWords: user.conig makeatletter printbibliography expandafter +% LocalWords: xdef csname endcsname newcommand ifx ifundefined affs % LocalWords: Semiverbatim whatsit newenvironment mtabline providecommand vfil % LocalWords: DCMsubtitle cclicense defdcm impl.blockstyles newcounter vskip % LocalWords: stepcounter tabularnewline theauthors lineskip textbf noindent diff --git a/Master/texmf-dist/source/latex/stex/hwexam/hwexam.dtx b/Master/texmf-dist/source/latex/stex/hwexam/hwexam.dtx new file mode 100644 index 00000000000..f7abb4011cc --- /dev/null +++ b/Master/texmf-dist/source/latex/stex/hwexam/hwexam.dtx @@ -0,0 +1,566 @@ +% \iffalse meta-comment +% An Infrastructure for marking up Assignments +% $URL: https://svn.kwarc.info/repos/stex/trunk/sty/hwexam/hwexam.dtx $ +% $Rev: 1671 $; last modified by $Author: kohlhase $ +% $Date: 2010-11-06 08:05:15 +0100 (Sat, 06 Nov 2010) $ +% Copyright (c) 2007 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% \fi +% +% \iffalse +%<package|cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01] +%<package>\ProvidesPackage{hwexam}[2010/06/25 v0.9b homework assignments and exams] +%<cls>\ProvidesClass{hwexam}[2010/06/25 v0.9b assignment and exam documents] +% +%<*driver> +\documentclass{ltxdoc} +\usepackage{url,float} +\usepackage{hwexam} +\usepackage[show]{ed} +\usepackage[hyperref=auto,style=alphabetic]{biblatex} +\bibliography{kwarc} +\usepackage[eso-foot,today]{svninfo} +\svnInfo $Id: hwexam.dtx 1671 2010-11-06 07:05:15Z kohlhase $ +\svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/hwexam/hwexam.dtx $ +\usepackage{stex-logo} +\usepackage{../ctansvn} +\usepackage{hyperref} +\makeindex +\floatstyle{boxed} +\newfloat{exfig}{thp}{lop} +\floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} +\begin{document}\DocInput{hwexam.dtx}\end{document} +%</driver> +% \fi +%\iffalse\CheckSum{323}\fi +% +% \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.} +% +% \GetFileInfo{hwexam.sty} +% +% \MakeShortVerb{\|} +%\def\scsys#1{{{\sc #1}}\index{#1@{\sc #1}}} +% \def\latexml{\scsys{LaTeXML}} +% +% \title{\texttt{hwexam.sty/cls}: An Infrastructure for formatting Assignments +% and Exams\thanks{Version {\fileversion} (last revised {\filedate})}} +% \author{Michael Kohlhase\\ +% Jacobs University, Bremen\\ +% \url{http://kwarc.info/kohlhase}} +% \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. +% \end{abstract} +% \setcounter{tocdepth}{2}\tableofcontents\newpage +% +%\section{Introduction}\label{sec:intro} +% +% The |hwexam| package and class supplies an infrastructure that allows to format +% nice-looking assignment sheets by simply including problems from problem files marked up +% with the |problem| package~\cite{Kohlhase:problem:ctan}. It is designed to be +% compatible with |problems.sty|, and inherits some of the functionality. +% +% \section{The User Interface} +% +% \subsection{Package and Class Options}\label{sec:user:options} +% +% 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). +% +% If the \DescribeMacro{showmeta}|showmeta| option is set, then the metadata keys are +% shown (see~\cite{Kohlhase:metakeys:ctan} for details and customization options). +% +% The |hwexam| class additionally accepts the options |report|, |book|, |chapter|, |part|, +% and |showignores|, of the |omdoc| package~\cite{Kohlhase:smomdl:ctan} on which it is +% based and passes them on to that. For the |extrefs| option +% see~\cite{Kohlhase:sref:ctan}. +% +% \subsection{Assignments} +% +% \DescribeEnv{assignment} This package supplies the |assignment| environment that groups +% problems into assignment sheets. It takes an optional KeyVal argument with the keys +% \DescribeMacro{number}|number| (for the assignment number; if none is given, 1 is +% assumed as the default or --- in multi-assignment documents --- the ordinal of the +% |assignment| environment), \DescribeMacro{title}|title| (for the assignment title; this +% is referenced in the title of the assignment sheet), \DescribeMacro{type}|type| (for the +% assignment type; e.g. ``quiz'', or ``homework''), \DescribeMacro{given}|given| (for the +% date the assignment was given), and \DescribeMacro{due}|due| (for the date the +% assignment is due). +% +% \subsection{Typesetting Exams} +% +% Furthermore, the |hwexam| package takes the option +% \DescribeMacro{multiple}|multiple| that allows to combine multiple assigment sheets into +% a compound document (the assignment sheets are treated as section, there is a table of +% contents, etc.). +% +% Finally, there is the option \DescribeMacro{test}|test| that modifies the behavior to +% facilitate formatting tests. Only in |test| mode, the macros |\testspace|, +% |\testnewpage|, and |\testemptypage| have an effect: they generate space for the +% students to solve the given problems. Thus they can be left in the {\LaTeX} source. +% +% \DescribeMacro{\testspace}|\testspace| takes an argument that expands to a dimension, +% and leaves vertical space accordingly. \DescribeMacro{\testnewpage}|\testnewpage| makes +% a new page in |test| mode, and \DescribeMacro{\testemptypage}|\testemptypage| generates +% an empty page with the cautionary message that this page was intentionally left empty. +% +% Finally, the \DescribeEnv{testheading}|\testheading| takes an optional keyword argument +% where the keys \DescribeMacro{duration}|duration| specifies a string that specifies the +% duration of the test, \DescribeMacro{min}|min| specifies the equivalent in number of +% minutes, and \DescribeMacro{reqpts}|reqpts| the points that are required for a perfect +% grade. +% \begin{exfig}[ht] +% \makeatletter +% \@problem{1.1}{4}{10} +% \@problem{2.1}{4}{8} +% \@problem{2.2}{6}{10} +% \@problem{2.3}{6}{10} +% \@problem{3.1}{4}{8} +% \@problem{3.2}{4}{8} +% \@problem{3.3}{2}{4} +% \makeatother +% \begin{verbatim} +% \title{320101 General Computer Science (Fall 2010)} +% \begin{testheading}[duration=one hour,min=60,reqpts=27] +% Good luck to all students! +% \end{testheading} +% \end{verbatim} +% \vspace*{-3ex}\hrule\vspace*{.5ex} formats to\vspace*{1ex} +% \hrule\par\noindent\vspace*{2ex} +% \title{320101 General Computer Science (Fall 2010)} +% \begin{testheading}[duration=one hour,min=60,reqpts=27] +% good luck +% \end{testheading} +% \caption{A generated test heading.}\label{fig:testheading} +% \end{exfig} +% +% \subsection{Including Assignments} +% +% The \DescribeMacro{\includeassignment}|\includeassignment| macro can be used to include +% an assignment from another file. It takes an optional KeyVal argument and a second +% argument which is a path to the file containing the problem (the macro assumes that +% there is only one |assignment| environment in the included file). The keys +% \DescribeMacro{number}|number|, \DescribeMacro{title}|title|, +% \DescribeMacro{type}|type|, \DescribeMacro{given}|given|, and \DescribeMacro{due}|due| +% 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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% +% \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography}\newpage +% \newpage +% +% \section{Implementation: The hwexam Class}\label{sec:impl:cls} +% +% The functionality is spread over the |hwexam| class and package. The class provides +% 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 +% passing them to the respective packages and classes they come from. +% +% \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}} +\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 +% sure the right packages are loaded. +% +% \begin{macrocode} +%<*cls> +\LoadClass{omdoc} +\RequirePackage{stex} +\RequirePackage{hwexam} +\RequirePackage{graphicx} +\RequirePackage{a4wide} +\RequirePackage{amssymb} +\RequirePackage{amstext} +\RequirePackage{amsmath} +%</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} +% +% The first step is to declare (a few) package options that handle whether certain +% information is printed or not. Some come with their own conditionals that are set by the +% options, the rest is just passed on to the |problems| package. +% +% \begin{macrocode} +%<*package> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\newif\iftest\testfalse +\newif\ifsolutions\solutionsfalse +\DeclareOption{test}{\testtrue\solutionsfalse} +\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] +\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{macrocode} +%<*ltxml> +# -*- CPERL -*- +package LaTeXML::Package::Pool; +use strict; +use LaTeXML::Package; +RequirePackage('problem'); +%</ltxml> +% \end{macrocode} +% +% Then we register the namespace of the requirements ontology +% \begin{macrocode} +%<*ltxml> +RegisterNamespace('assig'=>"http://omdoc.org/ontology/assignments#"); +RegisterDocumentNamespace('assig'=>"http://omdoc.org/ontology/assignments#"); +%</ltxml> +% \end{macrocode} +% +% \subsection{Assignments} +% +% We will prepare the keyval support for the |assignment| environment. +% +% \begin{macrocode} +%<*package> +\addmetakey{assig}{number} +\addmetakey*{assig}{title} +\addmetakey{assig}{type} +\addmetakey{assig}{given} +\addmetakey{assig}{due} +% \end{macrocode} +% +% The next three macros are intermediate functions that handle the case gracefully, where +% the respective token registers are undefined. +% +% The |\given@due| macro prints information about the given and due status of the +% 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*{\document@hwexamtype~\arabic{section}:~\assig@title\given@due{\\(})}% +\addcontentsline{toc}{section}{\document@hwexamtype~{\arabic{section}}:~\assig@title}% +\setcounter{problem}{0}} +\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}} +\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{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} +% \end{macrocode} +% for this to work we need to define the |\inclassig| macros in case no +% |\includeassignment| is ever called. +% \begin{macrocode} +\def\inclassig@title{} +\def\inclassig@type{} +\def\inclassig@number{} +\def\inclassig@due{} +\def\inclassig@given{} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{assignment} +% \begin{macrocode} +\newenvironment{assignment}[1][]{\assignment@process@keys{#1}% +\assignment@titleblock}{} +%</package> +% \end{macrocode} +% +% \begin{macrocode} +%<*ltxml> +DefEnvironment('{assignment} OptionalKeyVals:assig', + "<omdoc:omgroup ?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')() " + . "assig:dummy='for the namespace'" + . "?#locator(stex:srcref='#locator')()>" + . "<omdoc:metadata ?#locator(stex:srcref='#locator')()>" + . "<dc:title ?#locator(stex:srcref='#locator')()>" + . "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"); +%</ltxml> +% \end{macrocode} +% \end{environment} +% +% \begin{macrocode} +%<*package> +\addmetakey[\assig@default@type]{document}{hwexamtype} +%</package> +% \end{macrocode} +% +% \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{macrocode} +%<*package> +\addmetakey{inclassig}{number} +\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 [] {}','\input{#2}'); +DefMacro('\inputassignment [] {}','\input{#2}'); +%</ltxml> +% \end{macrocode} +% +% \subsection{Typesetting Exams} +% +% \begin{macrocode} +%<*package> +\addmetakey{quizheading}{tas} +\newcommand\quizheading[1]{\def\@tas{#1}% +\large\noindent NAME: \hspace{8cm} MAILBOX:\\[2ex]% +\ifx\@tas\@empty\else% +\noindent YOUR TA: \@for\@I:=\@tas\do{$\Box$ \@I\hspace*{1em}}\\[2ex]\fi} +%</package> +% \end{macrocode} +% \begin{macrocode} +%<*package> +\addmetakey{testheading}{min} +\addmetakey{testheading}{duration} +\addmetakey{testheading}{reqpts} +\newenvironment{testheading}[1][]{\metasetkeys{testheading}{#1} +{\noindent\large{}Name: \hfill Matriculation Number:\hspace*{2cm}\strut\\[1ex] +\begin{center}\Large\textbf{\@title}\\[1ex]\large\@date\\[3ex]\end{center} +{\textbf{You have +\ifx\test@heading@duration\@empty\testheading@min minutes\else\testheading@duration\fi +(sharp) for the test}};\\ Write the solutions to the sheet.}\par\noindent + +\newcount\check@time\check@time=\testheading@min +\advance\check@time by -\theassignment@totalmin +The estimated time for solving this exam is {\theassignment@totalmin} minutes, +leaving you {\the\check@time} minutes for revising your exam. + +\newcount\bonus@pts\bonus@pts=\theassignment@totalpts +\advance\bonus@pts by -\testheading@reqpts +You can reach {\theassignment@totalpts} points if you solve all problems. You will only need +{\testheading@reqpts} points for a perfect score, i.e.\ {\the\bonus@pts} points are +bonus points. \vfill +\begin{center} + {\Large\em +% You have ample time, so take it slow and avoid rushing to mistakes!\\[2ex] + Different problems test different skills and knowledge, so do not get stuck on + one problem.}\vfill\par\correction@table \\[3ex] +\end{center}} +{\newpage} +%</package> +%<*ltxml> +DefEnvironment('{testheading}OptionalKeyVals:omdoc',''); +%</ltxml> +% \end{macrocode} +% +% \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 + blank for extra space\end{center}\vfill\eject\else\fi} +%</package> +%<*ltxml> +DefConstructor('\testspace{}',''); +DefConstructor('\testnewpage',''); +DefConstructor('\testemptypage',''); +%</ltxml> +% \end{macrocode} +% +% \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 +\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}% +\stepcounter{assignment@probs} +\def\correction@table{\begin{tabular}{|l|*{\theassignment@probs}{c|}|p{3cm}|}\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@reached & & \\[.7cm]\hline +\end{tabular}} +%</package> +% \end{macrocode} +% \end{macro} +% +% \subsection{Leftovers} +% +% at some point, we may want to reactivate the logos font, then we use +% \begin{verbatim} +% here we define the logos that characterize the assignment +% \font\bierfont=../assignments/bierglas +% \font\denkerfont=../assignments/denker +% \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} +% \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 +%%% Local Variables: +%%% mode: doctex +%%% TeX-master: t +%%% End: +% \fi diff --git a/Master/texmf-dist/source/latex/stex/metakeys/metakeys.dtx b/Master/texmf-dist/source/latex/stex/metakeys/metakeys.dtx new file mode 100644 index 00000000000..c8ce7762f59 --- /dev/null +++ b/Master/texmf-dist/source/latex/stex/metakeys/metakeys.dtx @@ -0,0 +1,372 @@ +% \iffalse meta-comment +% An Infrastructure for marking up Metadata in LaTeX documents +% $URL: https://svn.kwarc.info/repos/stex/trunk/sty/metakeys/metakeys.dtx $ +% $Rev: 1671 $; last modified by $Author: kohlhase $ +% $Date: 2010-11-06 08:05:15 +0100 (Sat, 06 Nov 2010) $ +% Copyright (c) 2009 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% \fi +% +% \iffalse +%<*package> +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{metakeys}[2010/09/02 v0.9 Framework for Metadata Keys] +%</package> +%<*driver> +\documentclass{ltxdoc} +\usepackage{stex-logo,url,array,float} +\usepackage[show]{ed} +\usepackage{../ctansvn} +\usepackage[eso-foot,today]{svninfo} +\usepackage[hyperref=auto,style=alphabetic]{biblatex} +\bibliography{kwarc} +\svnInfo $Id: metakeys.dtx 1671 2010-11-06 07:05:15Z kohlhase $ +\svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/metakeys/metakeys.dtx $ +\usepackage{hyperref} +%\makeindex +\floatstyle{boxed} +\newfloat{exfig}{thp}{lop} +\floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} +\usepackage[showmeta]{metakeys} +\begin{document}\DocInput{metakeys.dtx}\end{document} +%</driver> +% \fi +% +%\iffalse\CheckSum{58}\fi +% +% \changes{v0.1}{2009/12/14}{First version} +% \changes{v0.8}{2010/06/18}{This is almost done} +% \changes{v0.9}{2010/09/02}{make sure that showkeys is always initialized} +% +% \GetFileInfo{metakeys.sty} +% +% \MakeShortVerb{\|} +% \def\scsys#1{{{\sc #1}}\index{#1@{\sc #1}}} +% \def\latexml{\scsys{LaTeXML}} +% \def\omdoc{OMDoc} +% \def\omdocv#1{\omdoc{#1}} +% +% \title{{\texttt{metakeys.sty}}: A generic framework for extensible Metadata in {\LaTeX}\thanks{Version {\fileversion} (last revised +% {\filedate})}} +% \author{Michael Kohlhase\\ +% Jacobs University, Bremen\\ +% \url{http://kwarc.info/kohlhase}} +% \maketitle +% \begin{abstract} +% The |metakeys| package is part of the {\sTeX} collection, a version of {\TeX/\LaTeX} that +% allows to markup {\TeX/\LaTeX} documents semantically without leaving the document +% format, essentially turning {\TeX/\LaTeX} into a document format for mathematical +% knowledge management (MKM). +% +% This package supplies the infrastructure for extending {\sTeX} macros with {\omdoc} +% metadata. This package is mainly intended for authors of {\sTeX} extension packages. +% \end{abstract} +% +% \setcounter{tocdepth}{2}\tableofcontents\newpage +% +% \section{The User Interface}\label{sec:user} +% +% The |metakeys| package supplies the infrastructure for extending {\sTeX} macros with +% ontology-based metadata. The |metakeys| infrastructure is intended to support the new +% metadata infrastructure for the {\omdoc} format~\cite{Kohlhase:omdoc1.2} introduced in +% {\omdocv{1.3}}~\cite{Kohlhase:OMDoc1.3}. +% +% \subsection{Package Options}\label{sec:user:options} +% +% The |metakeys| package takes a single option: \DescribeMacro{showmeta}|showmeta|. If +% this is set, then the metadata keys defined by the |\addmetakey| are shown +% (see~\ref{sec:user:showmeta}) +% +% \subsection{Adding Metadata Keys to Commands}\label{sec:user:keys} +% +% If \meta{group} is the name of a metadata key-group \meta{key} is a metadata keyword +% name, then \DescribeMacro{\addmetakey} +% \begin{quote} +% |\addmetakey[|\meta{default}|]{|\meta{group}|}{|\meta{key}|}| +% \end{quote} +% registers \meta{key} in the metadata group \meta{group}, with an optional value +% \meta{default} for \meta{key}. The keys registered for a metadata group can be used for +% defining macros with a key/value arguments via the +% \DescribeMacro{\metasetkeys}|\metasetkeys| macro, see for instance the the definition in +% Figure~\ref{fig:foo}. With these definitions in a used package\footnote{The \texttt\@ +% character is only allowed in packages.} |\foo[type=bar,id=f4711]| is formatted to +% \begin{quote} +% \addmetakey{foo}{id}\addmetakey{foo}{type}\makeatletter +% \newcommand\foo[1][]{\metasetkeys{foo}{#1} I have seen a \emph{foo} of type \texttt{\foo@type} +% with identifier \texttt{\foo@id}!}\makeatother +% \foo[type=bar,id=f4711] +% \end{quote} +% +% \begin{exfig}[ht] +% \begin{verbatim} +% \addmetakey{foo}{id} +% \addmetakey{foo}{type} +% \addmetakey[yes]{foo}{visible} +% \def\@yes{yes} +% \newcommand\foo[1][]{\metasetkeys{foo}{#1} +% \ifx\foo@visible\@yes % testing for visibility +% I have seen a \emph{foo} of type \texttt{\foo@type} with identifier +% \texttt\foo@id! +% \fi} +% \end{verbatim} +% \vspace*{-2em} +% \caption{Defining a macro with metadata} +% \label{fig:foo} +% \end{exfig} +% +% \subsection{Showing Metadata Keys/Values}\label{sec:user:showmeta} +% +% If the |showmeta| package option is set, the |metakeys| package sets an internal switch that +% shows the values of all keys specified with the |\addmetakey| macro. The default behavior +% is to write the key/value pairs into the margin as \meta{key}|:|\meta{value}. Package +% designers can customize this behavior by redefining the |\metakeys@show@key| and +% |\metakeys@show@keys| macro. +% +% \DescribeMacro{\metakeys@show@key}|\metakeys@show@key{|\meta{key}|}{|\meta{value}|}| shows the a +% single key value pair, and +% \DescribeMacro{\metakeys@show@keys}|\metakeys@show@keys{|\meta{group}|}{|\meta{keys}|}| shows the +% a list of keys metadata, by default we disregard the \meta{group} and show \meta{keys} +% in a marginpar. +% +% For keys that should not be shown in this manner, the |\addmetakey| macro has a variant +% \DescribeMacro{\addmetakey*}|\addmetakey*|. Its behavior is exactly the same, only that +% it keeps the key from being shown by the |showmeta| option. +% +% Note that setting the |showmeta| option will enable metadata presentation on the whole +% document. But sometimes we want to disable that, e.g. inside figures, where |\marginpar| +% is not allowed. Therefore the |metakeys| package provides the +% \DescribeMacro{\hidemetakeys}|\hidemetakeys| macro that reverses this. The +% \DescribeMacro{\showmetakeys}|\showmetakeys| macro re-enables metadata presentation. +% +% +% \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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% +% \StopEventually{\newpage\PrintChanges\printbibliography} +% +% \section{The Implementation}\label{sec:impl} +% +% The |metakeys| package generates two files: the {\LaTeX} package (all the code between +% {\textsf{$\langle$*package$\rangle$}} and {\textsf{$\langle$/package$\rangle$}}) and the +% {\latexml} bindings (between {\textsf{$\langle$*ltxml$\rangle$ and +% $\langle$/ltxml$\rangle$}}). 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{Package Options}\label{sec:impl:options} +% +% We declare some switches which will modify the behavior according to the package +% options. Generally, an option |xxx| will just set the appropriate switches to true +% (otherwise they stay false). First we have the general options +% \begin{macrocode} +%<*package> +\newif\ifmetakeys@showmeta\metakeys@showmetafalse +\DeclareOption{showmeta}{\metakeys@showmetatrue} +% \end{macrocode} +% Finally, we need to declare the end of the option declaration section to {\LaTeX}. +% \begin{macrocode} +\ProcessOptions +% \end{macrocode} +% +% We build on the |keyval| package which we first need to load. +% \begin{macrocode} +\RequirePackage{keyval}[1997/11/10] +%</package> +% \end{macrocode} +% +% \subsection{Adding Metadata Keys}\label{sec:impl:keys} +% +% \begin{macro}{\addmetakey} +% The |\addmetakey| macro looks at the next character and invokes helper macros accordingly. +% \begin{macrocode} +%<*package> +\newcommand\addmetakey{\@ifstar\addmetakey@star\addmetakey@nostar} +%</package> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\addmetakey@star} +% |\addmetakey@star| takes care of the starred form of |\addmetakey|. An invocation of +% |\addmetakey@star{|\meta{default}|}{|\meta{group}|}{|\meta{key}|}| macro first extends the +% |\metakeys@clear@|\meta{group}|@keys| macro then defines the key \meta{key} with the +% |\define@key| macro from the |keyval| package. This stores the key value given in the +% local macro |\|\meta{group}|@|\meta{key}. +% \begin{macrocode} +%<*package> +\newcommand\addmetakey@star[3][]{\metakeys@ext@clear@keys{#2}{#3}{#1}% +\metakeys@initialize@showkeys{#2}% +\define@key{#2}{#3}[#1]{\expandafter\gdef\csname #2@#3\endcsname{##1}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\addmetakey@nostar} +% |\addmetakey@nostar| takes care of the starred form of |\addmetakey| by first extending the +% |\metakeys@|\meta{group}|@showkeys| macro which contains those keys that should be +% shown and then calling |\addmetakey@star|. +% \begin{macrocode} +\newcommand\addmetakey@nostar[3][]{\metakeys@ext@showkeys{#2}{#3}\addmetakey@star[#1]{#2}{#3}} +%</package> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\metasetkeys} +% The |\metasetkeys{|\meta{group}|}| clears/presets the key of \meta{group} via +% |\clear@|\meta{group}|@clearkeys|, (if the |showmeta| option is set) shows them, and +% then sets the keys via |keyval|s |\setkeys| command. +% \begin{macrocode} +%<*package> +\newcommand\metasetkeys[2]{\@nameuse{clear@#1@keys}\setkeys{#1}{#2}% +\ifmetakeys@showmeta% +\edef\@@keys{\@nameuse{#1@showkeys}}% +\metakeys@show@keys{#1}{\@for\@I:=\@@keys\do{\metakeys@show@keyval{#1}{\@I}}}% +\fi} +%</package> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\metakeys@ext@clear@keys} +% |\metakeys@ext@clear@keys{|\meta{group}|}{|\meta{key}|}{|\meta{default}|}| extends (or +% sets up if this is the first |\addmetakey| for \meta{group}) the +% |\clear@|\meta{group}|@keys| macro to set the default value \meta{default} for +% \meta{key}. The |\clear@|\meta{group}|@keys| macro is used in the generic +% |\metasetkeys| macro below. The variant |\@metakeys@ext@clear@keys| is provided for +% use in the |sref| package. +% \begin{macrocode} +%<*package> +\newcommand\metakeys@ext@clear@keys[3]{\@metakeys@ext@clear@keys{#1}{#1@#2}{#3}} +\newcommand\@metakeys@ext@clear@keys[3]{\@ifundefined{clear@#1@keys}% +{\expandafter\def\csname clear@#1@keys\endcsname% +{\expandafter\gdef\csname #2\endcsname{#3}}}% +{\expandafter\g@addto@macro\csname clear@#1@keys\endcsname% +{\expandafter\gdef\csname #2\endcsname{#3}}}} +%</package> +% \end{macrocode} +% \end{macro} +% +% \subsection{Showing Metadata Keys/Values}\label{sec:impl:showmeta} +% +% \begin{macro}{\metakeys@initialize@showkeys} +% |\metakeys@initialize@showkeys{|\meta{group}|}| sets up the |\|\meta{group}|@showkeys| +% macro which is is used to store the keys to be shown of the metadata in in the generic +% |\setmetakeys| macro below. +% \begin{macrocode} +%<*package> +\newcommand\metakeys@initialize@showkeys[1]% +{\@ifundefined{#1@showkeys}{\expandafter\def\csname #1@showkeys\endcsname{}}{}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\metakeys@ext@showkeys} +% |\metakeys@ext@showkeys{|\meta{group}|}{|\meta{key}|}| extends (or sets up) the +% |\|\meta{group}|@showkeys| macro which is is used to store the keys to be shown of the +% metadata in in the generic |\setmetakeys| macro below. +% \begin{macrocode} +\newcommand\metakeys@ext@showkeys[2]{\@ifundefined{#1@showkeys}% +{\expandafter\def\csname #1@showkeys\endcsname{#2}}% +{\expandafter\edef\csname #1@showkeys\endcsname{\csname #1@showkeys\endcsname,#2}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\metakeys@show@key} +% |\metakeys@show@key{|\meta{key}|}{|\meta{value}|}| shows the a single key value pair, as a +% default we just write \meta{key}|:|\meta{value}. +% \begin{macrocode} +\newcommand\@metakeys@show@key[2]{\metakeys@show@key{#2}{#1}} +\newcommand\metakeys@show@key[2]{\edef\@test{#2}\ifx\@test\@empty\else #1:#2\quad\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\metakeys@show@keys} +% |\metakeys@show@keys{|\meta{group}|}{|\meta{keys}|}| shows the metadata, by default we +% disregard the \meta{group} and show \meta{keys} in a marginpar. +% \begin{macrocode} +\newcommand\metakeys@show@keys[2]{\marginpar{{\scriptsize #2}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\metakeys@show@keyval} +% |\metakeys@show@keyval{|\meta{group}|}|{|\meta{key}|} shows the key/value pair of a given key \meta{key}. +% \begin{macrocode} +\newcommand\metakeys@show@keyval[2]{\expandafter\@metakeys@show@key\csname #1@#2\endcsname{#2}} +%</package> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\showmetakeys} +% \begin{macrocode} +%<package>\newcommand\showmetakeys{\metakeys@showmetatrue} +%<ltxml>DefConstructor('\showmetakeys',''); +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\hidemetakeys} +% \begin{macrocode} +%<package>\newcommand\hidemetakeys{\metakeys@showmetafalse} +%<ltxml>DefConstructor('\hidemetakeys',''); +% \end{macrocode} +% \end{macro} +% +% \subsection{Using better defaults than empty} +% +% \begin{macro}{\addmetakeynew} +% |\addmetakeynew| is an experimental version of |\addmetakey| which gives +% |\omd@unspecified| as an optional argument, so that it is used as the default value +% here and then test for it in |\omfidus|. But unfortunately, this does not work yet. +% \begin{macrocode} +%<*package> +\newcommand\addmetakeynew[3][]{\metakeys@ext@clear@keys{#2}{#3}{#1}% +\define@key{#2}{#3}{\expandafter\gdef\csname #2@#3\endcsname{##1}}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\metakeys@unspecified} +% Ain internal macro for unspecified values. It is used to initialize keys.\ednote{MK: +% we could probably embed an package error or warning in here} +% \begin{macrocode} +\newcommand\metakeys@unspecified{an metakeys-defined key left unspecified} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\metakeysifus} +% This just tests for equality of the first arg with |\metakeys@unspecified| +% \begin{macrocode} +\newcommand\metakeysifus[4]{\message{testing #1@#2=\csname#1@#2\endcsname}% +\expandafter\ifx\csname #1@#2\endcsname\metakeys@unspecified{#3}\else{#4}\fi} +%</package> +% \end{macrocode} +% \end{macro} +% +% \subsection{Finale} +% +% Finally, we need to terminate the file with a success mark for perl. +% \begin{macrocode} +%<ltxml>1; +% \end{macrocode} +% \Finale +\endinput +% \iffalse +%%% Local Variables: +%%% mode: doctex +%%% TeX-master: t +%%% End: +% \fi + + +% LocalWords: iffalse kohlhase Thu metakeys metakeys.dtx scsys sc sc latexml omdoc foo +% LocalWords: omdocv texttt fileversion maketitle setcounter tocdepth newpage +% LocalWords: tableofcontents ednote showmeta +% LocalWords: makeatletter newcommand emph makeatother exfig vspace impl ltxml +% LocalWords: printbibliography keyval clearkeys expandafter gdef csname ifx +% LocalWords: endcsname setkeys ifundefined omfidus metakeysifus addmetakey +% LocalWords: doctex metasetkeys metasetkeys marginpar hidemetakeys textsf omd +% LocalWords: hidemetakeys showmetakeys showmetakeys langle textsf langle +% LocalWords: newif ifmetakeys showmetafalse showmetatrue ifstar showkeys +% LocalWords: nameuse setmetakeys addmetakeynew diff --git a/Master/texmf-dist/source/latex/stex/mikoslides/mikoslides.dtx b/Master/texmf-dist/source/latex/stex/mikoslides/mikoslides.dtx index 3840ff87e4e..e5aad153e3b 100644 --- a/Master/texmf-dist/source/latex/stex/mikoslides/mikoslides.dtx +++ b/Master/texmf-dist/source/latex/stex/mikoslides/mikoslides.dtx @@ -16,15 +16,18 @@ \documentclass{ltxdoc} \usepackage{url,array,float} \usepackage[show]{ed} +\usepackage[hyperref=auto,style=alphabetic]{biblatex} +\bibliography{kwarc} \makeindex \floatstyle{boxed} \newfloat{exfig}{thp}{lop} \floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{mikoslides.dtx}\end{document} %</driver> % \fi % -% \CheckSum{317} +% \iffalse\CheckSum{317}\fi % % \changes{v0.1}{2005/12/06}{Initial Version} % \changes{v0.2}{2006/01/11}{course notes back on seminar} @@ -75,10 +78,34 @@ % |beamer.cls|. % %\section{The User Interface}\label{sec:user} -% \StopEventually{\newpage\PrintChanges} % +% \subsection{Package Options}\label{sec:user:options} +% +% The |mikoslides| class takes a single option: \DescribeMacro{showmeta}|showmeta|. If +% this is set, then the metadata keys are shown (see~\cite{Kohlhase:metakeys:ctan} for details +% and customization options).\ednote{document the functionality} +% +% +% \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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% +% \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography} +% %\section{The Implementation}\label{sec:impl} % +% The |mikoslides| package generates two files: the {\LaTeX} package (all the code between +% {\textsf{$\langle$*package$\rangle$}} and {\textsf{$\langle$/package$\rangle$}}) and the +% {\latexml} bindings (between {\textsf{$\langle$*ltxml$\rangle$ and +% $\langle$/ltxml$\rangle$}}). 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{Initialization and Class Options}\label{sec:impl:init} % % For the {\latexml} bindings, we make sure the right perl packages are loaded. @@ -97,6 +124,7 @@ use LaTeXML::Package; % % \begin{macrocode} %<*cls> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} \newif\ifnotes\notesfalse \newif\ifproblems\problemstrue \DeclareOption{notes}{\notestrue} @@ -120,6 +148,7 @@ RawTeX('\newif\ifproblems\problemsfalse'); \ifnotes \LoadClass{omdoc} \RequirePackage{a4wide} +\RequirePackage{marginnote} \RequirePackage[notheorems,noamsthm]{beamerarticle} \else \LoadClass[notheorems,noamsthm,10pt]{beamer} @@ -132,6 +161,7 @@ RawTeX('\newif\ifproblems\problemsfalse'); %</cls> %<*ltxml> LoadClass('omdoc'); +DefConstructor('\usetheme{}',''); %</ltxml> % \end{macrocode} % @@ -218,6 +248,7 @@ DefEnvironment('{note}','#body'); \def\itemize@level{outer} \def\itemize@outer{outer} \def\itemize@inner{inner} +\renewcommand\metakeys@show@keys[2]{\marginnote{{\scriptsize ##2}}} \renewenvironment{itemize} {\ifx\itemize@level\itemize@outer\def\itemize@label{$\rhd$}\fi \ifx\itemize@level\itemize@inner\def\itemize@label{$\scriptstyle\rhd$}\fi @@ -325,6 +356,7 @@ DefEnvironment('{problems}','#body'); % appearance of line end comments in |\lec|. % % \begin{macrocode} +% \def\STpresent#1{\textcolor{blue}{#1}} \def\defemph#1{{\textcolor{magenta}{#1}}} \def\notemph#1{{\textcolor{magenta}{#1}}} \def\stDMemph#1{{\textcolor{blue}{#1}}} @@ -345,10 +377,25 @@ DefEnvironment('{problems}','#body'); DefMacro('\textwarning',""); %</ltxml> % \end{macrocode} +% +% \subsection{Front Matter, Titles, etc} +% +% We need to redefine the frontmatter macros inherited from the |beamer| class, since +% there they take an optional argument. +% \begin{macrocode} +%<*ltxml> +DefMacro('\title[]{}', '\@add@frontmatter{ltx:title}{#1}'); +DefMacro('\date[]{}', '\@add@frontmatter{ltx:date}[role=creation]{#1}'); +DefMacro('\author[]{}', sub { andSplit(T_CS('\@author'),$_[1]); });#$ +% \end{macrocode} +%</ltxml> +% % Now, we specialize the slide environment that we have implemented above or inherited % from |seminar.cls| for some abbreviations, e.g. separator slides and title slides. % \begin{macrocode} %<*cls> +\newcommand\titleframe{\begin{frame}\titlepage\end{frame}} +\newenvironment{titleframewith}{\begin{frame}\titlepage}{\end{frame}} \newenvironment{ttitle}{\begin{center}\LARGE\begin{tabular}{|c|}\hline}% {\\\hline\end{tabular}\end{center}\vspace{1ex minus 1ex}} \newenvironment{ttitlejoint}[1]% @@ -358,9 +405,14 @@ DefMacro('\textwarning',""); \vspace{1ex minus 1ex}} %</cls> %<*ltxml> +DefConstructor('\titleframe',"<omdoc:ignore>titleframe elided here</omdoc:ignore>"); +DefEnvironment('{titleframewith}', + "<omdoc:ignore>begin elided titleframe</omdoc:ignore>" + . "#body" + ."<omdoc:ignore>end elided titleframe</omdoc:ignore>"); DefEnvironment('{titleslide}',""); DefEnvironment('{titleslide}',"<omdoc:omgroup ?#locator(stex:srcref='#locator')()>#body</omdoc:omgroup>"); -DefEnvironment('{ttitle}', "\n<Title>#body</Title>"); +DefEnvironment('{ttitle}', "\n<dc:title>#body</dc:title>"); %</ltxml> % \end{macrocode} % @@ -369,8 +421,7 @@ DefEnvironment('{ttitle}', "\n<Title>#body</Title>"); %<*cls> \newcommand{\putgraphicsat}[3]{% \begin{picture}(0,0)\put(#1){\includegraphics[#2]{#3}}\end{picture}} -\newcommand{\putat}[2]{% - \begin{picture}(0,0)\put(#1){#2}\end{picture}} +\newcommand{\putat}[2]{\begin{picture}(0,0)\put(#1){#2}\end{picture}} %</cls> %<*ltxml> %</ltxml> diff --git a/Master/texmf-dist/source/latex/stex/modules/modules.dtx b/Master/texmf-dist/source/latex/stex/modules/modules.dtx index d68258bcdf6..11f392bfaa7 100644 --- a/Master/texmf-dist/source/latex/stex/modules/modules.dtx +++ b/Master/texmf-dist/source/latex/stex/modules/modules.dtx @@ -22,7 +22,7 @@ \usepackage{amsfonts} \bibliography{kwarc} \usepackage[eso-foot,today]{svninfo} -\svnInfo $Id: modules.dtx 1502 2010-07-20 08:17:00Z kohlhase $ +\svnInfo $Id: modules.dtx 1676 2010-11-08 09:53:09Z kohlhase $ \svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/modules/modules.dtx $ \usepackage{../ctansvn} \usepackage{hyperref} @@ -30,11 +30,12 @@ \floatstyle{boxed} \newfloat{exfig}{thp}{lop} \floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{modules.dtx}\end{document} %</driver> % \fi % -% \CheckSum{779} +% \iffalse\CheckSum{787}\fi % % \changes{v0.9}{2005/06/14}{First Version with Documentation} % \changes{v0.9a}{2005/07/01}{Completed Documentation} @@ -148,6 +149,9 @@ % internal memory. As qualified imports are not fully implemented at the moment, they are % turned off by default see Limitation~\ref{sec:limitations:qualified-imports}. % +% If the \DescribeMacro{showmeta}|showmeta| is set, then the metadata keys are shown +% (see~\cite{Kohlhase:metakeys:ctan} for details and customization options). +% % \subsection{Modules and Inheritance}\label{sec:modules} % % \DescribeEnv{module} The |module| environment takes an optional |KeyVal| @@ -493,26 +497,55 @@ % the current module from the \sTeX module signature (see Section~\ref{sec:modules}) via % the |\importmodule| declaration. % -% \section{Tips and Tricks}\label{sec:tipstricks} +% \subsection{No Forward Imports}\label{sec:limitations:forward-imports} +% +% {\sTeX} allows imports in the same file via |\importmodule{|\meta{mod}|}|, but due to +% the single-pass linear processing model of {\TeX}, \meta{mod} must be the name of a +% module declared {\emph{before}} the current point. So we cannot have forward imports as +% in +% \begin{verbatim} +% \begin{module}[id=foo] +% \importmodule{mod} +% ... +% \end{module} +% ... +% \begin{module}[id=mod] +% ... +% \end{module} +% \end{verbatim} +% a workaround, we can extract the module \meta{mod} into a file {{{mod.tex}}} and replace +% it with |\sinput{mod}|, as in +% \begin{verbatim} +% \begin{module}[id=foo] +% \importmodule[mod]{mod} +% ... +% \end{module} +% ... +% \sinput{mod} +% \end{verbatim} +% then the |\importmodule| command can read |mod.sms| (created via the |sms| utility) +% without having to wait for the module \meta{mod} to be defined. +% % -% \subsection{Forward References}\label{sec:limitations:forward-references} +% \section{Limitations}\label{sec:limitations} % -% It is a inherent limitation of {\sTeX} that we cannot have simple forward references in -% the same file (|\importmodules{|\meta{thy}|}|, where \meta{thy} is in the same file -% after the occurrence of |\importmodule|). In this case, we need to use -% |\importmodule[|\meta{jobname}|]{|\meta{thy}|}|, where \meta{jobname} is the name of the -% file or (if it is the top-level file {\LaTeX} is called with) even |\jobname|. +% 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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} % % \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\newpage\printbibliography}\newpage % % \section{The Implementation} % -% The |modules| package generates to files: the {\LaTeX} package (all the code between -% {\textlangle\textsf{*package}\textrangle} and {\textsf{\textlangle/package\textrangle}}) and the -% {\latexml} bindings (between {\textsf{\textlangle*ltxml\textrangle}} and -% {\textsf{\textlangle/ltxml\textrangle}}). We keep the corresponding code fragments together, -% since the documentation applies to both of them and to prevent them from getting out of -% sync. +% The |modules| package generates two files: the {\LaTeX} package (all the code between +% {\textlangle\textsf{*package}\textrangle} and {\textsf{\textlangle/package\textrangle}}) +% and the {\latexml} bindings (between {\textsf{\textlangle*ltxml\textrangle}} and +% {\textsf{\textlangle/ltxml\textrangle}}). 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{Package Options}\label{sec:impl:options} % @@ -521,6 +554,7 @@ % (otherwise they stay false). % \begin{macrocode} %<*package> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} \newif\ifmod@show\mod@showfalse \DeclareOption{show}{\mod@showtrue} \newif\ifmod@qualified\mod@qualifiedfalse @@ -907,6 +941,12 @@ DefConstructor('\metalanguage OptionalSemiverbatim {}', % generates the {\omdoc} |symbol| and |presentation| elements (see % Section~\ref{sec:impl:presentation}). % \begin{macrocode} +%<*package> +\define@key{DefMathOp}{name}{\def\defmathop@name{#1}} +\newcommand\DefMathOp[2][]{% +\setkeys{DefMathOp}{#1}% +\symdef[#1]{\defmathop@name}{#2}} +%</package> %<*ltxml> DefMacro('\DefMathOp OptionalKeyVals:symdef {}', sub { @@ -914,9 +954,13 @@ DefMacro('\DefMathOp OptionalKeyVals:symdef {}', my $name = KeyVal($keyval,'name') if $keyval; #Rewrite this token my $scopes = $STATE->getActiveScopes; - DefMathRewrite(active=>$scopes,xpath=>'descendant-or-self::ltx:XMath',match=>ToString($pres),replace=>"\\".ToString($name)); + DefMathRewrite(xpath=>'descendant-or-self::ltx:XMath',match=>ToString($pres), + replace=>sub{ + map {$STATE->activateScope($_);} @$scopes; + $_[0]->absorb(Digest("\\".ToString($name))); + }); #Invoke symdef - (Invocation(T_CS('\symdef'),$keyval,$name,undef,undef,$pres)->unlist); + (Invocation(T_CS('\symdef'),$keyval,$name,undef,undef,$pres)->unlist); }); DefMacro('\symdef OptionalKeyVals:symdef {}[][]{}', sub { @@ -1092,7 +1136,7 @@ DefPrimitive('\@symdef OptionalKeyVals:symdef {}[][]{}', sub { properties => {name=>$cs->toString, meaning=>$name,omcd=>$cd,role => $role}, scope=>$scope); return; }); -%</ltxml> +%</ltxml>%$ % \end{macrocode} % \end{macro} % @@ -1146,9 +1190,9 @@ DefPrimitive('\abbrdef OptionalKeyVals:symdef {}[][]{}', sub { % \begin{macrocode} %<*package> \def\mod@true{true} -\omdaddkey[false]{termdef}{local} -\omdaddkey{termdef}{name} -\newcommand{\termdef}[3][]{\omdsetkeys{termdef}{#1}% +\addmetakey[false]{termdef}{local} +\addmetakey{termdef}{name} +\newcommand{\termdef}[3][]{\metasetkeys{termdef}{#1}% \expandafter\mod@newcommand\csname#2\endcsname[0]{#3\xspace} \ifx\termdef@local\mod@true\else% \@ifundefined{mod@id}{}{\expandafter\g@addto@macro\this@module% @@ -1268,7 +1312,7 @@ DefMacro('\defpath{}{}', sub { my $paths = LookupValue('defpath')||{}; $$paths{"$arg1"}=$arg2; AssignValue('defpath'=>$paths,'global'); - DefMacro('\\'.$arg1.' {}',$arg2."/#1"); + DefMacro('\\'.$arg1.' Semiverbatim',$arg2."/#1"); });#$ %</ltxml> % \end{macrocode} @@ -1498,9 +1542,11 @@ DefPrimitive('\sinput Semiverbatim', sub { % \begin{macrocode} %<*package> \let\sinputref=\sinput +\let\inputref=\input %</package> %<*ltxml> -DefConstructor('\sinputref{}',"<omdoc:ref xref='#1.omdoc' type='include'/>"); +DefConstructor('\sinputref{}',"<omdoc:ref xref='#1.omdoc' type='cite' class='expandable'/>"); +DefConstructor('\inputref{}',"<omdoc:ref xref='#1.omdoc' type='cite' class='expandable'/>"); %</ltxml> % \end{macrocode} % @@ -1699,16 +1745,16 @@ DefConstructor('\requirepackage{} Semiverbatim',"<omdoc:imports from='#2'/>", % \begin{macrocode} %<*package> \srefaddidkey{view} -\omdaddkey{view}{from} -\omdaddkey{view}{to} -\omdaddkey{view}{title} +\addmetakey{view}{from} +\addmetakey{view}{to} +\addmetakey*{view}{title} \ifmod@show \newsavebox{\viewbox} \newcounter{view}[section] \def\view@heading{{\textbf{View} \thesection.\theview} \sref@label@id{View \thesection.\theproblem} \@ifundefined{view@title}{:\quad}{\quad(\view@title)\hfill\\}} -\newenvironment{view}[1][]{\omdsetkeys{view}{#1}\sref@target\stepcounter{view} +\newenvironment{view}[1][]{\metasetkeys{view}{#1}\sref@target\stepcounter{view} \begin{lrbox}{\viewbox}\begin{minipage}{.9\textwidth}\importmodule{\view@to}} {\end{minipage}\end{lrbox} \setbox0=\hbox{\begin{minipage}{.9\textwidth}% @@ -1843,7 +1889,7 @@ Tag('omdoc:theory',afterOpen=>\&numberIt,afterClose=>\&locateIt); % LocalWords: coolurioff cwd ouri ifdefinable testopt ifnextchar xargdef bvars % LocalWords: argdef yargdef somefunction symdeflocaltrue bvar xpath assoc qr % LocalWords: symdeflocalfalse localpres isbound symdefs COMPLEXTOKEN localp -% LocalWords: findnodes localname carg renewcommand omdaddkey omdsetkeys bbb +% LocalWords: findnodes localname carg renewcommand bbb % LocalWords: refundefinedtrue subsubsection blaaa makeatletter makeatother rm % LocalWords: ifmodules gdef xdef xdef modulestrue modulesfalse pathpostfix % LocalWords: updatedsms newreg xref texorpdfstring srefaddidkey newsavebox diff --git a/Master/texmf-dist/source/latex/stex/omd/omd.dtx b/Master/texmf-dist/source/latex/stex/omd/omd.dtx deleted file mode 100644 index ea175ed803a..00000000000 --- a/Master/texmf-dist/source/latex/stex/omd/omd.dtx +++ /dev/null @@ -1,222 +0,0 @@ -% \iffalse meta-comment -% An Infrastructure for marking up Metadata in LaTeX documents -% $URL: https://svn.kwarc.info/repos/stex/trunk/sty/omd/omd.dtx $ -% $Rev: 1502 $; last modified by $Author: kohlhase $ -% $Date: 2010-07-20 10:17:00 +0200 (Tue, 20 Jul 2010) $ -% Copyright (c) 2009 Michael Kohlhase, all rights reserved -% this file is released under the -% LaTeX Project Public License (LPPL) -% \fi -% -% \iffalse -%<*package> -\NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{omd}[2010/06/25 v0.9 OMDoc Metadata Framework] -%</package> -%<*driver> -\documentclass{ltxdoc} -\usepackage{stex-logo,sref,url,array,float} -\usepackage[show]{ed} -\usepackage{../ctansvn} -\usepackage[eso-foot,today]{svninfo} -\usepackage[hyperref=auto,style=alphabetic]{biblatex} -\bibliography{kwarc} -\svnInfo $Id: omd.dtx 1502 2010-07-20 08:17:00Z kohlhase $ -\svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/omd/omd.dtx $ -\usepackage{hyperref} -\makeindex -\floatstyle{boxed} -\newfloat{exfig}{thp}{lop} -\floatname{exfig}{Example} -\usepackage{omd} -\begin{document}\DocInput{omd.dtx}\end{document} -%</driver> -% \fi -% -%\CheckSum{58} -% -% \changes{v0.1}{2009/12/14}{First version} -% \changes{v0.9}{2010/06/18}{This is almost done} -% -% \GetFileInfo{omd.sty} -% -% \MakeShortVerb{\|} -% \def\scsys#1{{{\sc #1}}\index{#1@{\sc #1}}} -% \def\latexml{\scsys{LaTeXML}} -% \def\omdoc{OMDoc} -% \def\omdocv#1{\omdoc{#1}} -% -% \title{{\texttt{omd.sty}}: A generic framework for extensible Metadata in {\LaTeX}\thanks{Version {\fileversion} (last revised -% {\filedate})}} -% \author{Michael Kohlhase\\ -% Jacobs University, Bremen\\ -% \url{http://kwarc.info/kohlhase}} -% \maketitle -% \begin{abstract} -% The |omd| package is part of the {\sTeX} collection, a version of {\TeX/\LaTeX} that -% allows to markup {\TeX/\LaTeX} documents semantically without leaving the document -% format, essentially turning {\TeX/\LaTeX} into a document format for mathematical -% knowledge management (MKM). -% -% This package supplies the infrastructure for extending {\sTeX} macros with {\omdoc} -% metadata. This package is mainly intended for authors of {\sTeX} extension packages. -% \end{abstract} -% -% \setcounter{tocdepth}{2}\tableofcontents\newpage -% -%\section{Introduction} -% -% The |omd| package supplies the infrastructure for extending {\sTeX} macros with -% ontology-based metadata. The |omd| infrastructure is intended to support the new -% metadata infrastructure for the {\omdoc} format~\cite{Kohlhase:omdoc1.2} introduced in -% {\omdocv{1.3}}~\cite{Kohlhase:OMDoc1.3}\ednote{continue} -% -% \section{The User Interface}\label{sec:user} -% -% The \DescribeMacro{\omdaddkey}|\omdaddkey| command takes two arguments, a metadata group -% \meta{group} and a metadata keyword name \meta{key}. It registers \meta{key} in the -% metadata group \meta{group}. The keys registered for a metadata group can be used for -% defining macros with a key/value arguments via the -% \DescribeMacro{\omdsetkeys}|\omdsetkeys| macro, see for instance the the definition in -% Figure~\ref{fig:foo}. With these definitions in a used package\footnote{The \texttt\@ -% character is only allowed in packages.} |\foo[type=bar,id=f4711]| is formatted to -% \begin{quote} -% \omdaddkey{foo}{id}\omdaddkey{foo}{type}\makeatletter -% \newcommand\foo[1][]{\omdsetkeys{foo}{#1} I have seen a \emph{foo} of type \texttt{\foo@type} -% with identifier \texttt{\foo@id}!}\makeatother -% \foo[type=bar,id=f4711] -% \end{quote} -% -% \begin{exfig}[ht] -% \begin{verbatim} -% \omdaddkey{foo}{id} -% \omdaddkey{foo}{type} -% \newcommand\foo[1][]{\omdsetkeys{foo}{#1} -% I have seen a \emph{foo} of type \texttt{\foo@type} with identifier -% \texttt\foo@id!} -% \end{verbatim} -% \vspace*{-2em} -% \caption{Defining a macro with metadata} -% \label{fig:foo} -% \end{exfig} -% -% \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography} -% -% \section{The Implementation}\label{sec:impl} -% -% We build on the |keyval| package which we first need to load. -% \begin{macrocode} -%<*package> -\RequirePackage{keyval}[1997/11/10] -%<*ltxml> -%</ltxml> -% \end{macrocode} -% -% \begin{macro}{\omdaddkey} -% An invocation of |\omdaddkey{|\meta{group}|}{|\meta{key}|}| macro first extends the -% clearkeys macro and then defines the key \meta{key} with the |\define@key| macro from -% the |keyval| package. This stores the key value given in the local macro -% |\|\meta{group}|@|\meta{key}. -% \begin{macrocode} -%<*package> -\newcommand\omdaddkey[3][]{\omd@ext@clear@keys{#2}{#3}{#1}% -\define@key{#2}{#3}[#1]{\expandafter\gdef\csname #2@#3\endcsname{##1}}} -%</package> -%<*ltxml> -%</ltxml> -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\omdsetkeys} -% \begin{macrocode} -%<*package> -\newcommand\omdsetkeys[2]{\csname clear@#1@keys\endcsname\setkeys{#1}{#2}} -%</package> -%<*ltxml> -%</ltxml> -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\omd@ext@clear@keys} -% |\omd@ext@clear@keys{|\meta{group}|}{|\meta{key}|}{|\meta{default}|}| extends (or sets -% up if this is the first |\omdaddkey| for \meta{group}) the -% |\clear@|\meta{group}|@keys| macro to set the default value \meta{default} for -% \meta{key}. The |\clear@|\meta{group}|@keys| macro is used in the generic -% |\omdsetkeys| macro below. -% \begin{macrocode} -%<*package> -\newcommand\omd@ext@clear@keys[3]{\@omd@ext@clear@keys{#1}{#1@#2}{#3}} -\newcommand\@omd@ext@clear@keys[3]{\@ifundefined{clear@#1@keys}% -{\expandafter\def\csname clear@#1@keys\endcsname% -{\expandafter\gdef\csname #2\endcsname{#3}}}% -{\expandafter\g@addto@macro\csname clear@#1@keys\endcsname% -{\expandafter\gdef\csname #2\endcsname{#3}}}} -%</package> -%<*ltxml> -%</ltxml> -% \end{macrocode} -% \end{macro} -% -% \subsection{Using better defaults than empty} -% -% \begin{macro}{\omdaddkeynew} -% |\omdaddkeynew| is an experimental version of |\omdaddkey| which gives -% |\omd@unspecified| as an optional argument, so that it is used as the default value -% here and then test for it in |\omfidus|. But unfortunately, this does not work yet. -% \begin{macrocode} -%<*package> -\newcommand\omdaddkeynew[3][]{\omd@ext@clear@keys{#2}{#3}{#1}% -\define@key{#2}{#3}{\expandafter\gdef\csname #2@#3\endcsname{##1}}} -%</package> -%<*ltxml> -%</ltxml> -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\omd@unspecified} -% Ain internal macro for unspecified values. It is used to initialize keys.\ednote{MK: -% we could probably embed an package error or warning in here} -% \begin{macrocode} -%<*package> -\newcommand\omd@unspecified{an omd-defined key left unspecified} -%</package> -%<*ltxml> -%</ltxml> -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\omdifus} -% This just tests for equality of the first arg with |\omd@unspecified| -% \begin{macrocode} -%<*package> -\newcommand\omdifus[4]{\message{testing #1@#2=\csname#1@#2\endcsname}\expandafter\ifx\csname #1@#2\endcsname\omd@unspecified{#3}\else{#4}\fi} -%</package> -%<*ltxml> -%</ltxml> -% \end{macrocode} -% \end{macro} -% -% \subsection{Finale} -% -% Finally, we need to terminate the file with a success mark for perl. -% \begin{macrocode} -%<ltxml>1; -% \end{macrocode} -% \Finale -\endinput -% \iffalse -%%% Local Variables: -%%% mode: doctex -%%% TeX-master: t -%%% End: -% \fi - - -% LocalWords: iffalse kohlhase Thu omd omd.dtx scsys sc sc latexml omdoc foo -% LocalWords: omdocv texttt fileversion maketitle setcounter tocdepth newpage -% LocalWords: tableofcontents ednote omdaddkey omdaddkey omdsetkeys omdsetkeys -% LocalWords: makeatletter newcommand emph makeatother exfig vspace impl ltxml -% LocalWords: printbibliography keyval clearkeys expandafter gdef csname ifx -% LocalWords: endcsname setkeys ifundefined omdaddkeynew omfidus omdifus -% LocalWords: doctex diff --git a/Master/texmf-dist/source/latex/stex/omdoc/omdoc.dtx b/Master/texmf-dist/source/latex/stex/omdoc/omdoc.dtx index 2503218bc51..8a844940e3b 100644 --- a/Master/texmf-dist/source/latex/stex/omdoc/omdoc.dtx +++ b/Master/texmf-dist/source/latex/stex/omdoc/omdoc.dtx @@ -9,9 +9,8 @@ % \fi % % \iffalse -%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] +%<package|cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{omdoc}[2010/06/25 v1.0 OMDoc document Structure] -%<cls>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<cls>\ProvidesClass{omdoc}[2010/06/25 v1.0 OMDoc Documents] % %<*driver> @@ -21,7 +20,7 @@ \usepackage[hyperref=auto,style=alphabetic]{biblatex} \bibliography{kwarc} \usepackage[eso-foot,today]{svninfo} -\svnInfo $Id: omdoc.dtx 1502 2010-07-20 08:17:00Z kohlhase $ +\svnInfo $Id: omdoc.dtx 1671 2010-11-06 07:05:15Z kohlhase $ \svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/omdoc/omdoc.dtx $ \usepackage{stex-logo} \usepackage{../ctansvn} @@ -30,11 +29,12 @@ \floatstyle{boxed} \newfloat{exfig}{thp}{lop} \floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{omdoc.dtx}\end{document} %</driver> % \fi % -%\CheckSum{275} +%\iffalse\CheckSum{275}\fi % % \changes{v0.1}{2006/1/17}{First Version} % \changes{v0.2}{2006/7/11}{added OMDoc class} @@ -136,7 +136,7 @@ % \DescribeMacro{short}|short| allows to give a short title for the generated section. % \end{omgroup} % -% \begin{omgroup}[id=sec:user:omtext]{Mathematical Text} +% \begin{omgroup}[id=sec:user:ignore]{Ignoring Inputs} % % The \DescribeEnv{ignore}|ignore| environment can be used for hiding text parts from the % document structure. The body of the environment is not PDF or DVI output unless the @@ -168,54 +168,50 @@ % into some content markup format. \ednote{make an example} % \end{omgroup} % -% \begin{omgroup}[id=sec:user:phrase]{Phrase-Level Markup} -% -% \DescribeEnv{phrase} The |phrase| environment allows to mark up phrases with semantic -% information. It takes an optional |KeyVal| argument with the keys\ednote{continue} -% -% \DescribeMacro{\sinlinequote} The |sinlinequote| macro allows to mark up quotes inline and -% attribute them. The quote itself is given as the argument, possibly preceded by the a -% specification of the source in a an optional argument. For instance, we would quote -% Hamlet with -% \begin{verbatim} -% \sinlinequote[Hamlet, \cite{Shak:1603:Hamlet}]{To be or not to be} -% \end{verbatim} -% which would appear as \sinlinequote[Hamlet, (Shakespeare 1603)]{To be or not to be} in -% the text. The style in which inline quotations appear in the text can be adapted by -% specializing the macros \DescribeMacro{\@sinlinequote}|\@sinlinequote| --- for quotations -% without source and \DescribeMacro{\@@sinlinequote}|\@@sinlinequote| --- for quotations with -% source. -% \end{omgroup} -% % \begin{omgroup}[id=sec:user:colors]{Colors} % % For convenience, the |omdoc| package defines a couple of color macros for the |color| % package: For instance \DescribeMacro{\blue}|\blue| abbreviates |\textcolor{blue}|, so % that |\blue{|\meta{something}|}| writes \meta{something} in blue. The macros -% \DescribeMacro{\red}|\red| \DescribeMacro{\green}|\green| \DescribeMacro{\cyan}|\cyan| -% \DescribeMacro{\magenta}|\magenta| \DescribeMacro{\brown}|\brown| -% \DescribeMacro{\yellow}|\yellow|, and finally \DescribeMacro{\black}|\black| are +% \DescribeMacro{\red}|\red| \DescribeMacro{...}|\green|, |\cyan|, |\magenta|, |\brown|, +% |\yellow|, |\orange|, |\gray|, and finally \DescribeMacro{\black}|\black| are % analogous. % \end{omgroup} % \end{omgroup} % +% \begin{omgroup}[id=sec:limitations]{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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% \end{omgroup} +% % \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography}\newpage % % \begin{omgroup}[id=sec:impl:cls]{Implementation: The OMDoc Class} % -% The |omdoc| package generates four files: |omdoc.cls| (all the code between +% The functionality is spread over the |omdoc| class and package. The class provides the +% |document| environment and the |omdoc| element corresponds to it, whereas the +% package provides the concrete functionality. +% +% |omdoc.dtx| generates four files: |omdoc.cls| (all the code between % {\textsf{$\langle$*cls$\rangle$}} and {\textsf{$\langle$/cls$\rangle$}}), |omdoc.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 +% 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. % -% We load |article.cls|, and the desired packages. For the {\latexml} bindings, we make -% sure the right packages are loaded. +% \begin{omgroup}[id=sec:impl:cls:options]{Class Options} +% To initialize the |omdoc| class, we declare and process the necessary options. +% % \begin{macrocode} %<*cls> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} \def\omdoc@class{article} \DeclareOption{report}{\def\omdoc@class{report}\PassOptionsToPackage{\CurrentOption}{omdoc}} \DeclareOption{book}{\def\omdoc@class{book}\PassOptionsToPackage{\CurrentOption}{omdoc}} @@ -225,8 +221,6 @@ \DeclareOption{extrefs}{\PassOptionsToPackage{\CurrentOption}{sref}} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} \ProcessOptions -\LoadClass{\omdoc@class} -\RequirePackage{omdoc} %</cls> %<*ltxml.cls> # -*- CPERL -*- @@ -243,10 +237,26 @@ DeclareOption('showignores',sub {PassOptions('omdoc','sty',ToString(Digest(T_CS( DeclareOption('extrefs',sub {PassOptions('sref','sty',ToString(Digest(T_CS('\CurrentOption')))); }); DeclareOption(undef,sub {PassOptions('article','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 +% sure the right packages are loaded. +% +% \begin{macrocode} +%<*cls> +\LoadClass{\omdoc@class} +\RequirePackage{omdoc} +%</cls> +%<*ltxml.cls> LoadClass('article'); RequirePackage('sref'); %</ltxml.cls> % \end{macrocode} +% \end{omgroup} +% +% \begin{omgroup}[id=sec:impl:cls:namespaces]{Setting up Namespaces and Schemata for LaTeXML} +% % Now, we also need to register the namespace prefixes for {\latexml} to use. % \begin{macrocode} %<*ltxml.cls> @@ -280,6 +290,9 @@ RelaxNGSchema('omdoc+ltxml', RequirePackage('omdoc'); %</ltxml.cls> % \end{macrocode} +% \end{omgroup} +% +% \begin{omgroup}[id=sec:impl:cls:document]{Beefing up the \texttt{document} environment} % % Now, we will define the environments we need. The top-level one is the |document| % environment, which we redefined so that we can provide keyval arguments. @@ -290,7 +303,8 @@ RequirePackage('omdoc'); % \begin{macrocode} %<*cls> \let\orig@document=\document -\renewcommand{\document}[1][]{\orig@document} +\srefaddidkey{document} +\renewcommand{\document}[1][]{\metasetkeys{document}{#1}\orig@document} %</cls> %<*ltxml.cls> sub xmlBase { @@ -317,6 +331,7 @@ DefEnvironment('{document} OptionalKeyVals:omdoc', % \end{macrocode} % \end{environment} % \end{omgroup} +% \end{omgroup} % % \begin{omgroup}[id=sec:impl:sty]{Implementation: OMDoc Package} % @@ -339,6 +354,7 @@ use Cwd qw(cwd abs_path); % % \begin{macrocode} %<*package> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} \newif\if@chapter\@chapterfalse \newif\if@part\@partfalse \newcount\section@level\section@level=3 @@ -386,13 +402,13 @@ RequirePackage('omtext'); % \begin{macrocode} %<*package> \srefaddidkey{omgroup} -\omdaddkey{omgroup}{creators} -\omdaddkey{omgroup}{contributors} -\omdaddkey{omgroup}{type} -\omdaddkey{omgroup}{short} -\omdaddkey{omgroup}{display} +\addmetakey{omgroup}{creators} +\addmetakey{omgroup}{contributors} +\addmetakey{omgroup}{type} +\addmetakey*{omgroup}{short} +\addmetakey*{omgroup}{display} \newenvironment{omgroup}[2][]% title -{\bgroup\omdsetkeys{omgroup}{#1}\sref@target +{\bgroup\metasetkeys{omgroup}{#1}\sref@target \ifx\omgroup@display\st@flow\noindent{\Large\textbf{#2}\\[.3ex]\noindent\ignorespaces} \else \if@part\ifnum\section@level=1\part{#2}\sref@label@id{Part \thepart}\fi\fi @@ -484,15 +500,54 @@ DefEnvironment('{description}', %</ltxml.sty> % \end{macrocode} % \end{omgroup} +% +% \begin{omgroup}[id=sec:user:docmatter]{Front and Backmatter} +% +% Index markup is provided by the |omtext| package~\cite{Kohlhase:smmtf:ctan}, so in the +% |omdoc| package we only need to supply the correpsonding |\printindex| command, if it +% is not already defined +% \begin{macro}{\printindex} +% \begin{macrocode} +%<*package> +\providecommand\printindex{\IfFileExists{\jobname.ind}{\input{\jobname.ind}}{}} +%</package> +%<*ltxml.sty> +DefConstructor('\printindex','<omdoc:index/>'); +%</ltxml.sty> +% \end{macrocode} +% \end{macro} % +% \begin{macro}{\tableofcontents} +% The table of contents already exists in {\LaTeX}, so we only need to provide a +% {\latexml} binding for it.\ednote{@Deyan, we need to insert the current value of the +% {\texttt{tocdepth}} counter into a @level attribute.} +% \begin{macrocode} +%<*ltxml.sty> +DefConstructor('\tableofcontents',"<omdoc:tableofcontents level='2'/>"); +%</ltxml.sty> +% \end{macrocode} +% \end{macro} +% +% The case of the |\bibliography| command is similar +% +% \begin{macro}{\bibliography} +% \begin{macrocode} +%<*ltxml.sty> +DefConstructor('\bibliography{}',"<omdoc:bibliography files='#1'/>"); +%</ltxml.sty> +% \end{macrocode} +% \end{macro} +% \end{omgroup} +% +% \begin{omgroup}[id=sec:impl:ignore]{Ignoring Inputs} % \begin{environment}{ignore} % \begin{macrocode} %<*package> \ifshow@ignores -\omdaddkey{ignore}{type} -\omdaddkey{ignore}{comment} +\addmetakey{ignore}{type} +\addmetakey{ignore}{comment} \newenvironment{ignore}[1][] -{\omdsetkeys{ignore}{#1}\textless\ignore@type\textgreater\bgroup\itshape} +{\metasetkeys{ignore}{#1}\textless\ignore@type\textgreater\bgroup\itshape} {\egroup\textless/\ignore@type\textgreater} \renewenvironment{ignore}{}{}\else\excludecomment{ignore}\fi %</package> @@ -574,6 +629,7 @@ DefMacro('\STRlabeldef{}{}', ""); % \begin{macrocode} %<*package> \def\black#1{\textcolor{black}{#1}} +\def\gray#1{\textcolor{gray}{#1}} \def\blue#1{\textcolor{blue}{#1}} \def\red#1{\textcolor{red}{#1}} \def\green#1{\textcolor{green}{#1}} @@ -581,7 +637,6 @@ DefMacro('\STRlabeldef{}{}', ""); \def\magenta#1{\textcolor{magenta}{#1}} \def\brown#1{\textcolor{brown}{#1}} \def\yellow#1{\textcolor{yellow}{#1}} -\def\yellow#1{\textcolor{yellow}{#1}} \def\orange#1{\textcolor{orange}{#1}} %</package> % \end{macrocode} @@ -605,7 +660,7 @@ DefMacro('\@omdoc@color{}', sub { MergeFont(color=>$_[1]->toString); return; }); %<*ltxml.sty> DefConstructor('\@omdoc@color@content[]{}', "?#isMath(#2)(<omdoc:phrase ?#1(style='color:#1')()>#2</omdoc:phrase>)"); -foreach my $color(qw(blue red green magenta cyan brown yellow)) { +foreach my $color(qw(black gray blue red green cyan magenta brown yellow orange)) { DefMacro("\\".$color.'{}', sub { omdocColorMacro($color, @_); }); }#$ %</ltxml.sty> % \end{macrocode} @@ -657,6 +712,7 @@ DefConstructor('\href Semiverbatim {}',"<omdoc:link href='#1'>#2</omdoc:link>"); %<ltxml.sty|ltxml.cls>1; % \end{macrocode} % \end{omgroup} +% \end{omgroup} % \Finale \endinput % \iffalse @@ -688,7 +744,7 @@ DefConstructor('\href Semiverbatim {}',"<omdoc:link href='#1'>#2</omdoc:link>"); % LocalWords: textsf langle textsf langle respetively orig renewcommand cdir % LocalWords: baseuri baseuri baselocal baselocal SOURCEFILE cooluri newif ifx % LocalWords: SOURCEBASE chapterfalse partfalse newcount ifshow chaptertrue -% LocalWords: parttrue srefaddidkey omdaddkey newenvironment omdsetkeys textbf +% LocalWords: parttrue srefaddidkey newenvironment textbf % LocalWords: noindent noindent ignorespaces ifnum thepart thechapter regexp % LocalWords: thesection thesubsection thesubsubsection needswrapper itshape % LocalWords: textgreater renewenvironment excludecomment STRlabeldef csname diff --git a/Master/texmf-dist/source/latex/stex/omtext/omtext.dtx b/Master/texmf-dist/source/latex/stex/omtext/omtext.dtx index e12d7cf0743..d13d7f446d8 100644 --- a/Master/texmf-dist/source/latex/stex/omtext/omtext.dtx +++ b/Master/texmf-dist/source/latex/stex/omtext/omtext.dtx @@ -20,7 +20,7 @@ \usepackage[hyperref=auto,style=alphabetic]{biblatex} \bibliography{kwarc} \usepackage[eso-foot,today]{svninfo} -\svnInfo $Id: omtext.dtx 1502 2010-07-20 08:17:00Z kohlhase $ +\svnInfo $Id: omtext.dtx 1671 2010-11-06 07:05:15Z kohlhase $ \svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/omtext/omtext.dtx $ \usepackage{stex-logo} \usepackage{../ctansvn} @@ -29,11 +29,12 @@ \floatstyle{boxed} \newfloat{exfig}{thp}{lop} \floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{omtext.dtx}\end{document} %</driver> % \fi % -%\CheckSum{333} +%\iffalse\CheckSum{333}\fi % % \changes{v0.4}{2008/07/22}{added index markup} % \changes{v0.4}{2008/09/29}{augmenting the index macros with optional values} @@ -80,7 +81,16 @@ % package supports direct translation to the {\omdoc} format~\cite{Kohlhase:omdoc1.2} % \end{omgroup} % -% \begin{omgroup}[id=sec:user]{The User Interface}\ +% \begin{omgroup}[id=sec:user]{The User Interface} +% +% \begin{omgroup}[id=sec:user:options]{Package Options} +% +% The |omtext| package takes a single option: \DescribeMacro{showmeta}|showmeta|. If +% this is set, then the metadata keys are shown (see~\cite{Kohlhase:metakeys:ctan} for +% details and customization options). +% \end{omgroup} +% +% \begin{omgroup}[id=sec:user:omtext]{Mathematical Text} % % \DescribeEnv{omtext} The |omtext| environment is used for any text fragment that has a % contribution to a text that needs to be marked up. It can have a title, which can be @@ -93,7 +103,26 @@ % is special in that it is binary (a ``transition between two statements''), so % additionally, a source should be specified using the |from| key. % \end{omgroup} +% +% \begin{omgroup}[id=sec:user:phrase]{Phrase-Level Markup} +% +% \DescribeEnv{phrase} The |phrase| environment allows to mark up phrases with semantic +% information. It takes an optional |KeyVal| argument with the keys\ednote{continue} % +% \DescribeMacro{\sinlinequote} The |sinlinequote| macro allows to mark up quotes inline and +% attribute them. The quote itself is given as the argument, possibly preceded by the a +% specification of the source in a an optional argument. For instance, we would quote +% Hamlet with +% \begin{verbatim} +% \sinlinequote[Hamlet, \cite{Shak:1603:Hamlet}]{To be or not to be} +% \end{verbatim} +% which would appear as \sinlinequote[Hamlet, (Shakespeare 1603)]{To be or not to be} in +% the text. The style in which inline quotations appear in the text can be adapted by +% specializing the macros \DescribeMacro{\@sinlinequote}|\@sinlinequote| --- for quotations +% without source and \DescribeMacro{\@@sinlinequote}|\@@sinlinequote| --- for quotations with +% source. +% \end{omgroup} +% % \begin{omgroup}[id=sec:user:block]{Block-Level Markup} % % \DescribeEnv{sblockquote} The |sblockquote| environment is the big brother of the @@ -165,11 +194,29 @@ % All index macros take an optional first argument that is used for ordering the % respective entries in the index. % \end{omgroup} +% \end{omgroup} +% % +% \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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% % \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography}\newpage % % \begin{omgroup}[id=sec:impl]{Implementation} % +% The |omtext| package generates two files: the {\LaTeX} package (all the code between +% {\textsf{$\langle$*package$\rangle$}} and {\textsf{$\langle$/package$\rangle$}}) and the +% {\latexml} bindings (between {\textsf{$\langle$*ltxml$\rangle$ and +% $\langle$/ltxml$\rangle$}}). We keep the corresponding code fragments together, +% since the documentation applies to both of them and to prevent them from getting out of +% sync. +% % \begin{omgroup}[id=sec:impl:options]{Package Options} % % The initial setup for {\latexml}: @@ -189,6 +236,7 @@ use Cwd qw(cwd abs_path); % % \begin{macrocode} %<*package> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} \newif\ifindex\indextrue \DeclareOption{noindex}{\indexfalse} \ProcessOptions @@ -226,7 +274,6 @@ RequirePackage('sref'); Tag('omdoc:metadata',afterOpen=>\&numberIt,afterClose=>\&locateIt,autoClose=>1,autoOpen=>1); %</ltxml> % \end{macrocode} -% \end{omgroup} % % the |itemize|, |description|, and |enumerate| environments generate |omdoc:li|, % |omdoc:di| with |autoclose| inside a CMP. This behavior will be overwritten later, so we @@ -290,15 +337,16 @@ Tag('omdoc:di', autoClose=>1); % \begin{macrocode} %<*package> \srefaddidkey{omtext} -\omdaddkey[]{omtext}{functions} -\omdaddkey{omtext}{display} -\omdaddkey{omtext}{for} -\omdaddkey{omtext}{from} -\omdaddkey{omtext}{type} -\omdaddkey{omtext}{title} -\omdaddkey{omtext}{theory} -\omdaddkey{omtext}{continues} -\omdaddkey{omtext}{verbalizes} +\addmetakey[]{omtext}{functions} +\addmetakey*{omtext}{display} +\addmetakey{omtext}{for} +\addmetakey{omtext}{from} +\addmetakey{omtext}{type} +\addmetakey*{omtext}{title} +\addmetakey*{omtext}{start} +\addmetakey{omtext}{theory} +\addmetakey{omtext}{continues} +\addmetakey{omtext}{verbalizes} %</package> %<*ltxml> DefKeyVal('omtext','functions','Semiverbatim'); @@ -307,6 +355,7 @@ DefKeyVal('omtext','for','Semiverbatim'); DefKeyVal('omtext','from','Semiverbatim'); DefKeyVal('omtext','type','Semiverbatim'); DefKeyVal('omtext','title','Plain'); #Math mode in titles. +DefKeyVal('omtext','start','Plain'); #Math mode in start phrases DefKeyVal('omtext','theory','Semiverbatim'); DefKeyVal('omtext','continues','Semiverbatim'); DefKeyVal('omtext','verbalizes','Semiverbatim'); @@ -331,7 +380,7 @@ DefKeyVal('omtext','verbalizes','Semiverbatim'); \def\omtext@pre@skip{\smallskip} \def\omtext@post@skip{} \providecommand{\stDMemph}[1]{\textbf{#1}} -\newenvironment{omtext}[1][]{\bgroup\omdsetkeys{omtext}{#1}\sref@label@id{this paragraph}% +\newenvironment{omtext}[1][]{\bgroup\metasetkeys{omtext}{#1}\sref@label@id{this paragraph}% \def\lec##1{\@lec{##1}} \ifx\omtext@display\st@flow\else\omtext@pre@skip\par\noindent% \ifx\omtext@title\@empty\else\stDMemph{\omtext@title}: \fi\fi\ignorespaces} @@ -347,7 +396,8 @@ DefCMPEnvironment('{omtext} OptionalKeyVals:omtext', . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" . "<omdoc:CMP>" . "<omdoc:p>" - . "#body"); + . "?&KeyVal(#1,'start')(<omdoc:phrase type='startemph'>&KeyVal(#1,'start')</omdoc:phrase>)()" + . "#body"); %</ltxml> % \end{macrocode} % \end{environment} @@ -372,9 +422,10 @@ sub DefCMPConstructor { push(@before, \&useCMPItemizations); $options{beforeDigest} = \@before; DefConstructor($proto, $replacement, %options); -} +}#$ %</ltxml> % \end{macrocode} +% \end{omgroup} % % \begin{omgroup}[id=sec:impl:phrase]{Phrase-level Markup} % @@ -383,12 +434,12 @@ sub DefCMPConstructor { % \begin{macrocode} %<*package> \srefaddidkey{phrase} -\omdaddkey{phrase}{style} -\omdaddkey{phrase}{class} -\omdaddkey{phrase}{index} -\omdaddkey{phrase}{verbalizes} -\omdaddkey{phrase}{type} -\newenvironment{phrase}[1][]{\omdsetkeys{phrase}{#1}}{} +\addmetakey{phrase}{style} +\addmetakey{phrase}{class} +\addmetakey{phrase}{index} +\addmetakey{phrase}{verbalizes} +\addmetakey{phrase}{type} +\newenvironment{phrase}[1][]{\metasetkeys{phrase}{#1}}{} %</package> %<*ltxml> DefKeyVal('phrase','id','Semiverbatim'); @@ -454,10 +505,11 @@ DefConstructor('\sinlinequote [] {}', %</package> %<*ltxml> DefEnvironment('{sblockquote} []', - "<omdoc:omgroup type='quote'" - . "?#1(<dc:source>#1</dc:source>\n)()" - . "#body" - . "</omdoc:omgroup>"); + "?#1(<omdoc:omtext type='quote'>" + . "<dc:source>#1</dc:source>" + . "#body" + . " </omdoc:omtext>)" + . "(<omdoc:p class='quote'>#body</omdoc:p>)"); %</ltxml> % \end{macrocode} % \end{environment} @@ -591,15 +643,6 @@ DefConstructor('\atwinalt[]{}{}{}{}', ."</omdoc:idx>"); %</ltxml> % \end{macrocode} -% and finally we supply the |\printindex| command -% \begin{macrocode} -%<*package> -\def\printindex{\IfFileExists{\jobname.ind}{\input{\jobname.ind}}{}} -%</package> -%<*ltxml> -DefConstructor('\printindex','<omdoc:index/>'); -%</ltxml> -% \end{macrocode} % \end{omgroup} % % \begin{omgroup}{{\LaTeX} Commands we interpret differently} @@ -613,8 +656,7 @@ DefConstructor('\printindex','<omdoc:index/>'); % % \begin{macrocode} %<*ltxml> -DefConstructor('\par',sub { $_[0]->maybeCloseElement('omdoc:p'); }, - alias=>"\\par\n"); +DefConstructor('\par',sub { $_[0]->maybeCloseElement('omdoc:p'); },alias=>"\\par\n"); Tag('omdoc:p', autoClose=>1, autoOpen=>1); Tag('omdoc:CMP', autoClose=>1, autoOpen=>1); Tag('omdoc:omtext', autoClose=>1, autoOpen=>1); @@ -629,7 +671,15 @@ DefConstructor('\omspace{}',''); DefConstructor('\emph{}',"<omdoc:phrase class='emphasis'>#1</omdoc:phrase>"); DefConstructor('\em',"<omdoc:phrase class='emphasis'>"); DefConstructor('\texttt{}',"<omdoc:phrase class='code'>#1</omdoc:phrase>"); +DefConstructor('\tt',"<omdoc:phrase class='code'>"); DefConstructor('\textbf{}',"<omdoc:phrase class='bold'>#1</omdoc:phrase>"); +DefConstructor('\bf',"<omdoc:phrase class='bold'>"); +DefConstructor('\textsf{}',"<omdoc:phrase class='sans-serif'>#1</omdoc:phrase>"); +DefConstructor('\sf',"<omdoc:phrase class='sans-serif'>"); +DefConstructor('\textsl{}',"<omdoc:phrase class='slanted'>#1</omdoc:phrase>"); +DefConstructor('\sl',"<omdoc:phrase class='slanted'>"); +DefConstructor('\textit{}',"<omdoc:phrase class='italic'>#1</omdoc:phrase>"); +DefConstructor('\it',"<omdoc:phrase class='italic'>"); Tag('omdoc:phrase', autoClose=>1); DefEnvironment('{center}','#body'); DefEnvironment('{flushleft}','#body'); @@ -659,7 +709,7 @@ DefConstructor('\scriptsize',''); DefConstructor('\tiny',''); DefConstructor('\fbox{}','#1'); DefConstructor('\footnote[]{}', - "<omdoc:note class='foot' ?#1(mark='#1')>#2</omdoc:note>"); + "<omdoc:note type='foot' ?#1(mark='#1')>#2</omdoc:note>"); DefConstructor('\footnotemark[]',""); DefConstructor('\footnotetext[]{}', "<omdoc:note class='foot' ?#1(mark='#1')>#2</omdoc:note>"); @@ -760,7 +810,7 @@ sub locateIt { %<ltxml>1; % \end{macrocode} % \end{omgroup} -% \end{omgroup} +%\end{omgroup} % \Finale \endinput % \iffalse @@ -791,9 +841,10 @@ sub locateIt { % LocalWords: indextoo twintoo twintoo exfig vspace twinalt ldots ttin emin % LocalWords: renmanig myindex atwin atwin packge-local blockquote inlinequote % LocalWords: atwintoo atwinalt atwinalt printbibliography impl cwd newif ifx -% LocalWords: ifindex indextrue indexfalse srefaddidkey omdaddkey smallskip -% LocalWords: providecommand stDMemph textbf newenvironment omdsetkeys hfil +% LocalWords: ifindex indextrue indexfalse srefaddidkey smallskip showmeta +% LocalWords: providecommand stDMemph textbf newenvironment hfil showmeta % LocalWords: noindent ignorespaces newcommand nobreak hfill hbox mygraphics % LocalWords: includegraphics mycgraphics mybgraphics fbox adjectivized hspace % LocalWords: printindex jobname.ind jobname.ind omspace footnotemark thead -% LocalWords: footnotetext findnodes doctex +% LocalWords: footnotetext findnodes doctex textsf langle textsf langle funval +% LocalWords: metakeys funsymbs addmetakey metasetkeys startemph textsl textit diff --git a/Master/texmf-dist/source/latex/stex/presentation/presentation.dtx b/Master/texmf-dist/source/latex/stex/presentation/presentation.dtx index 57e2352ede5..dd6a4fe8191 100644 --- a/Master/texmf-dist/source/latex/stex/presentation/presentation.dtx +++ b/Master/texmf-dist/source/latex/stex/presentation/presentation.dtx @@ -13,24 +13,26 @@ % %<*driver> \documentclass{ltxdoc} -\usepackage{url,array,presentation,float,stex-logo} +\usepackage{url,array,float,amstext,alltt} +\usepackage{modules,presentation,stex-logo} \usepackage[show]{ed} \usepackage[hyperref=auto,style=alphabetic]{biblatex} \bibliography{kwarc} \usepackage{../ctansvn} \usepackage{hyperref} \usepackage[eso-foot,today]{svninfo} -\svnInfo $Id: presentation.dtx 1502 2010-07-20 08:17:00Z kohlhase $ +\svnInfo $Id: presentation.dtx 1671 2010-11-06 07:05:15Z kohlhase $ \svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/presentation/presentation.dtx $ \makeindex \floatstyle{boxed} \newfloat{exfig}{thp}{lop} \floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{presentation.dtx}\end{document} %</driver> % \fi % -% \CheckSum{557} +% \iffalse\CheckSum{557}\fi % % \changes{v0.9}{2005/06/14}{First Version with Documentation} % \changes{v0.9a}{2005/07/01}{Completed Documentation} @@ -83,7 +85,7 @@ % sources, or after translation. % \end{abstract} % -% \setcounter{tocdepth}{2}\tableofcontents\newpage +% \newpage\setcounter{tocdepth}{2}\tableofcontents\newpage % %\section{Introduction}\label{sec:presentation} % @@ -469,7 +471,82 @@ % indices, and \DescribeMacro{\ulivar}|\ulivar| for upper and lower indices. Finally, % \DescribeMacro{\primvar}|\primvar| and \DescribeMacro{\pprimvar}|\pprimvar| do the same % for variables with primes and double primes (triple primes are bad style). -% +% +% \subsection{Other Layout Primitives}\label{sec:inter:primitives} +% +% Not all mathematical layouts are producible with mixfix notations. A prime example are +% grid layouts which are marked up using the |array| element in {\TeX/\LaTeX}, e.g. for +% definition by cases as the (somewhat contrived) definition of the absolute value +% function in the upper part of Figure~\ref{fig:piece}. We will now motivate the need of +% special layout primitives with this example. +% \begin{exfig} +% \begin{module}[id=foo] +% \symdef{piece}[2]{\arrayline{\arraycell{#1}}{\text{if}\;#2}} +% \symdef{otherwise}[1]{\arrayline{\arraycell{#1}}{\text{else}}} +% \symdef{piecewise}[1]{\left\{\begin{array}{rl}#1\end{array}\right.} +% \qquad\begin{minipage}[c]{5cm} +% $\vert x\vert\colon=\piecewise{\piece{x}{x>0}\piece{-x}{x<0}\otherwise{0}}$ +% \end{minipage} +% \qquad +% \begin{minipage}[c]{7cm} +% \begin{verbatim} +% |x|\colon=\left\{ +% \begin{array}{rl} +% x & x>0\\ +% -x & x<0\\ +% 0 & \text{else} +% \end{array} +% \right. +% \end{verbatim} +% \end{minipage} +% \end{module} +% \hrule +% \begin{verbatim} +% \symdef{piece}[2]{\arrayline{\arraycell{#1}}{\text{if}\;#2}} +% \symdef{otherwise}[1]{\arrayline{\arraycell{#1}}{\text{else}}} +% \symdef{piecewise}[1]{\left\{\begin{array}{rl}#1\end{array}\right.} +% $|x|\colon=\piecewise{\piece{x}{x>0}\piece{-x}{x<0}\otherwise{0}}$ +% \end{verbatim} +% \vspace*{-1.5em} +% \caption{A piecewise definition of the absolute value function}\label{fig:piece} +% \end{exfig} +% But this does not work for content markup via semantic macros~\cite{KohAmb:smmssl:ctan}, +% which wants to group formula parts by function. For definition by cases, we may want to +% follow the OpenMath |piece1| content dictionary~\cite{CD:piece1:on}, which groups +% ``piecewise'' definition into a constructor |piecewise|, whose children are a list of +% |piece| constructor optionally followed by an |otherwise|. If we want to mimic this by +% semantic macros in \stex (these are defined via |\symdef|; see~\cite{KohAmb:smmssl:ctan} +% for details), we would naturally define |\piecewise| by wrapping an |array| environment +% (see the last line in Figure~\ref{fig:piece}). Then we would naturally be tempted to +% define |\piece| via |\symdef{piece}[2]{#1&\text{if}\;{#2}\\}| and |\otherwise| via +% |\symdef{otherwise}[1]{#1&\text{else}}|. But this does not support the generation of +% separate notation definitions for |\piece| and |\otherwise|: here \latexml has to +% generate presentational information outside of the |array| context that provides the |&| +% and |\\| command sequences\footnote{Note that this is not a problem when we only run +% |latex| if we assume that \texttt{\textbackslash piece} and \texttt{\textbackslash +% otherwise} are only used in arguments of \texttt{\textbackslash piecewise}.}. Therefore +% the |presentation| package provides the macros |\arrayline| and |\arraycell| that +% refactor this functionality. +% +% \DescribeMacro{\arrayline}|\arrayline{|\meta{cells}|}{|\meta{cell}|}| is +% {\LaTeX}-equivalent to \meta{cells}|&|\meta{cell}|\\| and can thus be used to create +% array lines with one or more array cells: \meta{cell} is the last array cell, and the +% previous ones are each marked up as +% \DescribeMacro{\arraycell}|\arraycell{|\meta{cell}|}|, where \meta{cell} is the cell +% content. In last lines of fFigure~\ref{fig:piece} we have used them to create the array +% lines for |\piece| and |\otherwise|. Note that the array cell specifications in +% |\arrayline| must coincide with the array specification in the main constructor (here +% |rl| in |\piecewise|). +% +% \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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% % \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography} % % \section{The Implementation}\label{sec:implementation} @@ -481,10 +558,8 @@ % since the documentation applies to both of them and to prevent them from getting out of % sync. % -% We first make sure that the KeyVal package is loaded (in the right -% version). For {\latexml}, we also initialize the package inclusions. +% For {\latexml}, we initialize the package inclusions. % \begin{macrocode} -%<package>\RequirePackage{keyval}[1997/11/10] %<*ltxml> # -*- CPERL -*- package LaTeXML::Package::Pool; @@ -492,6 +567,24 @@ use strict; use LaTeXML::Package; %</ltxml> % \end{macrocode} +% +% \subsection{Package Options}\label{sec:impl:options} +% +% We declare some switches which will modify the behavior according to the package +% options. Generally, an option |xxx| will just set the appropriate switches to true +% (otherwise they stay false).\ednote{we have no options at the moment} +% +% \begin{macrocode} +%<*package> +\ProcessOptions +%</package> +% \end{macrocode} +% +% We first make sure that the KeyVal package is loaded (in the right +% version). For {\latexml}, we also initialize the package inclusions. +% \begin{macrocode} +%<package>\RequirePackage{keyval}[1997/11/10] +% \end{macrocode} % We will first specify the default precedences and brackets, together with the macros % that allow to set them. % \begin{macrocode} @@ -911,14 +1004,17 @@ DefConstructor('\@mixfixai OptionalKeyVals:mi {}{}{}{}{}{}', % \begin{macrocode} %<*package> \define@key{miii}{nobrackets}[yes]{\def\pres@p@key{\pres@infty}% -\def\pres@pi@key{-\pres@infty}\def\pres@pii@key{-\pres@infty}\def\pres@pii@key{-\pres@infty}} +\def\pres@pi@key{-\pres@infty} +\def\pres@pii@key{-\pres@infty} +\def\pres@pii@key{-\pres@infty}} \define@key{miii}{lbrack}{\def\pres@lbrack@key{#1}} \define@key{miii}{rbrack}{\def\pres@lbrack@key{#1}} \define@key{miii}{p}{\def\pres@p@key{#1}} \define@key{miii}{pi}{\def\pres@pi@key{#1}} \define@key{miii}{pii}{\def\pres@pii@key{#1}} \define@key{miii}{piii}{\def\pres@piii@key{#1}} -\def\prep@keys@miii{\prep@keys@mii\edef\pres@piii{\@ifundefined{pres@piii@key}{\pres@p}{\pres@piii@key}}} +\def\prep@keys@miii{\prep@keys@mii% +\edef\pres@piii{\@ifundefined{pres@piii@key}{\pres@p}{\pres@piii@key}}} %</package> %<*ltxml> DefKeyVal('miii','lbrack','Semiverbatim'); @@ -1316,7 +1412,7 @@ DefConstructor('\crossrefOp[]{}', \def\vnref#1{\csname MOD@name@#1\endcsname} %</package> %<*ltxml> -DefMacro('\vnref{}','\@XMRef{#1}'); +DefMacro('\vnref{}','\@XMRef{cvar.#1}'); %</ltxml> % \end{macrocode} % \end{macro} @@ -1336,6 +1432,28 @@ DefMacro('\vnref{}','\@XMRef{#1}'); % \end{macrocode} % \end{macro} % +% \subsection{Other Layout Primitives}\label{sec:impl:primitives} +% +% The |\arrayline| and |\arraycell| macros are simple refactorings of the |array| +% functionality on the {\LaTeX} side\ednote{@Deyan, implement and describe them on the +% latexml side} +% +% \begin{macro}{\arrayline} +% \begin{macrocode} +%<package>\newcommand{\arrayline}[2]{#1#2\\} +%<*ltxml> +%</ltxml> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\arraycell} +% \begin{macrocode} +%<package>\newcommand{\arraycell}[1]{#1&} +%<*ltxml> +%</ltxml> +% \end{macrocode} +% \end{macro} +% % \subsection{Finale} % % Finally, we need to terminate the file with a success mark for perl. @@ -1360,9 +1478,10 @@ DefMacro('\vnref{}','\@XMRef{#1}'); % LocalWords: capcup geq prec fset textbf textbf setegroup setegroup mathbf fn % LocalWords: provideEdefault provideEdefault fromEcontext fromEcontext mathrm % LocalWords: setEdefault setEdefault widetilde cdot vname vname vnref vnname -% LocalWords: ulivar ulivar primvar primvar pprimvar pprimvar textsf textsf +% LocalWords: ulivar ulivar primvar primvar pprimvar pprimvar textsf textsf rl % LocalWords: printbibliography ltxml infty ifnum clearkeys nobrackets whatsit % LocalWords: ifundefined keyvals kvhash newcommand setkeys crossrefOp argv % LocalWords: tmpop i-th assocop textbackslash infixl gdef expandafter csname % LocalWords: endcsname edefault edfault ifx prepostfix circ circ circ circ % LocalWords: iprec iprec niprec niprec wrongset goodset prepost prepkeys +% LocalWords: arrayline arraycell qquad hrule diff --git a/Master/texmf-dist/source/latex/stex/problem/problem.dtx b/Master/texmf-dist/source/latex/stex/problem/problem.dtx index 97346c6c729..7661efe7906 100644 --- a/Master/texmf-dist/source/latex/stex/problem/problem.dtx +++ b/Master/texmf-dist/source/latex/stex/problem/problem.dtx @@ -1,8 +1,8 @@ % \iffalse meta-comment % An Infrastructure for Problems -% $URL: https://svn.kwarc.info/repos/stex-content/sty/problem/problem.dtx $ -% $Rev: 2674 $; last modified by $Author: deyan $ -% $Date: 2010-03-24 04:09:39 +0100 (Wed, 24 Mar 2010) $ +% $URL: https://svn.kwarc.info/repos/stex/trunk/sty/problem/problem.dtx $ +% $Rev: 1671 $; last modified by $Author: kohlhase $ +% $Date: 2010-11-06 08:05:15 +0100 (Sat, 06 Nov 2010) $ % Copyright (c) 2006-2008 Michael Kohlhase, all rights reserved % this file is released under the % LaTeX Project Public License (LPPL) @@ -14,20 +14,27 @@ % %<*driver> \documentclass{ltxdoc} -\usepackage{url,float} -\usepackage[show]{ed} -\usepackage{latexml} +\usepackage{url,float,latexml} \usepackage[solutions,hints,notes]{problem} +\usepackage[show]{ed} +\usepackage[hyperref=auto,style=alphabetic]{biblatex} +\bibliography{kwarc} +\usepackage[eso-foot,today]{svninfo} +\svnInfo $Id: problem.dtx 1671 2010-11-06 07:05:15Z kohlhase $ +\svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/problem/problem.dtx $ +\usepackage{stex-logo} +\usepackage{../ctansvn} \usepackage{hyperref} \makeindex \floatstyle{boxed} \newfloat{exfig}{thp}{lop} \floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{problem.dtx}\end{document} %</driver> % \fi % -% \CheckSum{365} +% \iffalse\CheckSum{365}\fi % % \changes{v0.9}{2006/09/18}{First Version with Documentation} % \changes{v0.9a}{2007/01/02}{Renamed to \texttt{problem.sty}} @@ -38,7 +45,7 @@ % % \MakeShortVerb{\|} % -% \title{An Infrastructure for formatting Problems\thanks{Version {\fileversion} (last revised +% \title{\texttt{problem.sty}: An Infrastructure for formatting Problems\thanks{Version {\fileversion} (last revised % {\filedate})}} % \author{Michael Kohlhase\\ % Jacobs University, Bremen\\ @@ -74,15 +81,19 @@ % theses are specified, then the corresponding auxiliary parts of the problems are output, % otherwise, they remain invisible. % -% The \DescribeMacro{boxed} option specifies that problems should be formatted in framed -% boxes so that they are more visible in the text. Finally, the \DescribeMacro{test}|test| -% option signifies that we are in a test sitution, so this option does not show the -% solutions (of course), but leaves space for the students to solve them. +% The \DescribeMacro{boxed}|boxed| option specifies that problems should be formatted in +% framed boxes so that they are more visible in the text. Finally, the +% \DescribeMacro{test}|test| option signifies that we are in a test sitution, so this +% option does not show the solutions (of course), but leaves space for the students to +% solve them. % % The \DescribeMacro{extract}|extract| option can be set if we want to extract a problems % file, e.g. to display the solutions, see Section~\ref{sec:user:includeproblem} for a % discussion. % +% Finally, if the \DescribeMacro{showmeta}|showmeta| is set, then the metadata keys are +% shown (see~\cite{Kohlhase:metakeys:ctan} for details and customization options). +% % \subsection{Problems and Solutions}\label{sec:user:probsols} % % \DescribeEnv{problem} The main enviornment provided by the |problem| package is @@ -174,11 +185,27 @@ % options are set. This allows to give students hints about the estimated time and the % points to be awarded. % +% \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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% % \StopEventually{\newpage\PrintChanges} % \newpage % % \section{The Implementation}\label{sec:implementation} % +% The |problem| package generates two files: the {\LaTeX} package (all the code between +% {\textsf{$\langle$*package$\rangle$}} and {\textsf{$\langle$/package$\rangle$}}) and the +% {\LaTeXML} bindings (between {\textsf{$\langle$*ltxml$\rangle$ and +% $\langle$/ltxml$\rangle$}}). 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{Package Options}\label{sec:impl:options} % % The first step is to declare (a few) package options that handle whether certain @@ -187,6 +214,7 @@ % % \begin{macrocode} %<*package> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} \newif\ifexnotes\exnotesfalse\DeclareOption{notes}{\exnotestrue} \newif\ifhints\hintsfalse\DeclareOption{hints}{\hintstrue} \newif\ifsolutions\solutionsfalse\DeclareOption{solutions}{\solutionstrue} @@ -198,6 +226,20 @@ %</package> % \end{macrocode} % +% On the {\LaTeXML} side we only make sure that the switches are defined +% \begin{macrocode} +%<*ltxml> +RawTeX(' +\newif\ifexnotes\exnotesfalse +\newif\ifhints\hintsfalse +\newif\ifsolutions\solutionsfalse +\newif\ifpts\ptsfalse +\newif\ifmin\minfalse +\newif\ifboxed\boxedfalse +\newif\ifextract\extractfalse +'); +%</ltxml> +% \end{macrocode} % Then we make sure that the necessary packages are loaded (in the right versions). % \begin{macrocode} %<*package> @@ -236,10 +278,10 @@ RegisterDocumentNamespace('prob'=>"http://omdoc.org/ontology/problems#"); % \begin{macrocode} %<*package> \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} % \end{macrocode} % % Then we set up a box and a counter for problems @@ -280,18 +322,18 @@ RegisterDocumentNamespace('prob'=>"http://omdoc.org/ontology/problems#"); % \begin{environment}{problem} % \begin{macrocode} \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 %</package> @@ -305,15 +347,14 @@ RegisterDocumentNamespace('prob'=>"http://omdoc.org/ontology/problems#"); %<*ltxml> 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"); %</ltxml> % \end{macrocode} % @@ -394,14 +435,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{}',""); @@ -434,13 +473,13 @@ DefConstructor('\min{}',""); % % \begin{macrocode} %<*package> -\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} @@ -452,14 +491,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>"); %</ltxml> % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/stex/reqdoc/reqdoc.dtx b/Master/texmf-dist/source/latex/stex/reqdoc/reqdoc.dtx index 63acb86cee1..422fa674dcc 100644 --- a/Master/texmf-dist/source/latex/stex/reqdoc/reqdoc.dtx +++ b/Master/texmf-dist/source/latex/stex/reqdoc/reqdoc.dtx @@ -26,19 +26,18 @@ \usepackage[hyperref=auto,style=alphabetic]{biblatex} \bibliography{kwarc} \usepackage[eso-foot,today,draft]{svninfo} +\svnInfo $Id: reqdoc.dtx 1671 2010-11-06 07:05:15Z kohlhase $ +\svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/reqdoc/reqdoc.dtx $ \usepackage{stex-logo} \usepackage{../ctansvn} \usepackage{hyperref} \makeindex -\begin{document} -\svnInfo $Id: reqdoc.dtx 1502 2010-07-20 08:17:00Z kohlhase $ -\svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/reqdoc/reqdoc.dtx $ -\DocInput{reqdoc.dtx} -\end{document} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} +\begin{document}\DocInput{reqdoc.dtx}\end{document} %</driver> % \fi % -%\CheckSum{195} +%\iffalse\CheckSum{195}\fi % % \changes{v0.3}{2008/06/26}{Integrated LaTeXML bindings} % \changes{v0.2}{2008/02/04}{First Version with Documentation} @@ -81,7 +80,9 @@ % The |reqdoc| package takes the package option \DescribeMacro{recorddeps}|recorddeps|. If % this is given, then the package generates an external file with dependencies that can be % used by external systems like the {\texttt{locutor}} system\ednote{add citation here}, -% see Section~\ref{sec:moc-deps}. +% see Section~\ref{sec:moc-deps}. If the \DescribeMacro{showmeta}|showmeta| is set, then +% the metadata keys are shown (see~\cite{Kohlhase:metakeys:ctan} for details and customization +% options). % % \subsection{Requirements} % The |reqdoc| package supplies two forms of writing down requirements that mainly differ @@ -111,6 +112,16 @@ % \meta{doc}, then we will need to know about their representations and can import the % necessary information via |\importreqs{|\meta{doc}|}|. % +% +% \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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% % \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography} % \newpage % @@ -125,10 +136,13 @@ % % \subsection{Package Options}\label{sec.impl.options} % -% We first introduce the single option |recorddeps| which comes with its own switch |\if@deps| -% +% We declare some switches which will modify the behavior according to the package +% options. Generally, an option |xxx| will just set the appropriate switches to true +% (otherwise they stay false).\ednote{need an implementation for {\latexml}} +% % \begin{macrocode} %<*package> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} \newif\if@deps\@depsfalse \DeclareOption{recorddeps}{\@depstrue} \ProcessOptions @@ -161,11 +175,11 @@ RegisterDocumentNamespace('r'=>"http://omdoc.org/ontology/requirements#"); % \begin{macrocode} %<*package> \newif\ifreqsnum\reqsnumfalse -\omdaddkey{reqs}{numbering} -\omdaddkey[R]{reqs}{prefix} +\addmetakey{reqs}{numbering} +\addmetakey[R]{reqs}{prefix} \def\reqs@no{no} \newenvironment{requirements}[1][]% -{\omdsetkeys{reqs}{#1}\ifx\reqs@numbering\reqs@no\reqsnumfalse\else\reqsnumtrue\fi}{} +{\metasetkeys{reqs}{#1}\ifx\reqs@numbering\reqs@no\reqsnumfalse\else\reqsnumtrue\fi}{} %</package> %<*ltxml> DefEnvironment('{requirements} OptionalKeyVals:reqs', @@ -174,15 +188,15 @@ DefEnvironment('{requirements} OptionalKeyVals:reqs', % \end{macrocode} % \end{environment} % -% We define a group of keywords using the |\omdaddkey| command from the |omd| -% package~\ctancite{Kohlhase:omd}. The group below, named as |req|, consists of three +% We define a group of keywords using the |\addmetakey| command from the |metakeys| +% package~\ctancite{Kohlhase:metakeys}. The group below, named as |req|, consists of three % keywords |id|, |prio| and |refs|. % \begin{macrocode} %<*package> -\omdaddkey{req}{id} -\omdaddkey{req}{prio} -\omdaddkey{req}{refs} -\omdaddkey{req}{num} +\addmetakey{req}{id} +\addmetakey{req}{prio} +\addmetakey{req}{refs} +\addmetakey{req}{num} \newcounter{reqnum}[section] % \end{macrocode} % This function cycles over a comma-separated list and does the references @@ -238,7 +252,7 @@ DefEnvironment('{requirements} OptionalKeyVals:reqs', % \begin{environment}{requirement} % \begin{macrocode} \newenvironment{requirement}[1][]% -{\omdsetkeys{req}{#1}\stepcounter{reqnum} +{\metasetkeys{req}{#1}\stepcounter{reqnum} \ifreqsnum\ifx\req@id\@empty\else\req@def\req@id{number}\thereqnum\fi \noindent\textbf{\print@req@label}\fi \newcommand{\reqnote}[1]{\par\noindent Note: ##1} @@ -261,7 +275,7 @@ DefConstructor('\reqnote{}', % \begin{environment}{reqtable} % \begin{macrocode} %<*package> -\newenvironment{reqtable}[1][]{\omdsetkeys{reqs}{#1} +\newenvironment{reqtable}[1][]{\metasetkeys{reqs}{#1} \begin{center}\begin{longtable}{|l|l|p{6cm}|p{5cm}|l|}\hline \# & Prio & Requirement & Notes & Refs\\\hline\hline} {\end{longtable}\end{center}} @@ -277,7 +291,7 @@ DefEnvironment('{reqtable} OptionalKeyVals:reqs', % \begin{macrocode} %<*package> \newcommand{\reqline}[3][]% -{\omdsetkeys{req}{#1}\stepcounter{reqnum} +{\metasetkeys{req}{#1}\stepcounter{reqnum} \req@def\req@id{number}\thereqnum% remember the number for reference \textbf{\sref@target@ifh\req@id{\reqs@prefix\arabic{reqnum}}}& \req@prio &\req@do@refs\req@refs{,}\tabularnewline\hline} @@ -363,10 +377,11 @@ DefMacro('\rinput','\input'); % LocalWords: recorddeps moc-deps DescribeEnv prio reqs reqtable reqtable deps % LocalWords: reqline importreqs printbibliography sec.impl textsf langle ifx % LocalWords: textsf langle ltxml newif depsfalse depstrue longtable ifreqsnum -% LocalWords: reqsnumfalse omdaddkey newenvironment omdsetkeys reqsnumtrue omd +% LocalWords: reqsnumfalse newenvironment reqsnumtrue omd % LocalWords: OptionalKeyVals omdoc omgroup ctancite req newcounter reqnum % LocalWords: tmpop tmpop csname xdef endcsname expandafter auxout thesection % LocalWords: hfill thereqnum reqnote stepcounter noindent textbf newcommand % LocalWords: medskip omtext texttype hline tabularnewline makeatletter rinput % LocalWords: makeatother sinput stex ifdeps bgroup egroup newwrite depfile % LocalWords: openout jobname.deps renewcommand requiremodules gdef defs defs +% LocalWords: showmeta showmeta metakeys addmetakey metasetkeys diff --git a/Master/texmf-dist/source/latex/stex/sproof/sproof.dtx b/Master/texmf-dist/source/latex/stex/sproof/sproof.dtx index dbfb53e897f..bb4f6b04a0e 100644 --- a/Master/texmf-dist/source/latex/stex/sproof/sproof.dtx +++ b/Master/texmf-dist/source/latex/stex/sproof/sproof.dtx @@ -6,8 +6,8 @@ % % The development version of this file can be found at % $URL: https://svn.kwarc.info/repos/stex/trunk/sty/sproof/sproof.dtx $ -% $Rev: 1502 $; last modified by $Author: kohlhase $ -% $Date: 2010-07-20 10:17:00 +0200 (Tue, 20 Jul 2010) $ +% $Rev: 1671 $; last modified by $Author: kohlhase $ +% $Date: 2010-11-06 08:05:15 +0100 (Sat, 06 Nov 2010) $ % \fi % % \iffalse @@ -23,17 +23,18 @@ \usepackage{../ctansvn} \usepackage{hyperref} \usepackage[eso-foot,today]{svninfo} -\svnInfo $Id: sproof.dtx 1502 2010-07-20 08:17:00Z kohlhase $ +\svnInfo $Id: sproof.dtx 1671 2010-11-06 07:05:15Z kohlhase $ \svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/sproof/sproof.dtx $ \makeindex \floatstyle{boxed} \newfloat{exfig}{thp}{lop} \floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{sproof.dtx}\end{document} %</driver> % \fi % -% \CheckSum{279} +% \iffalse\CheckSum{279}\fi % % \changes{v0.9}{2005/06/14}{First Version with Documentation} % \changes{v0.9a}{2005/07/01}{Completed Documentation} @@ -149,6 +150,12 @@ % % \section{The User Interface} % +% \subsection{Package Options}\label{sec:user:options} +% +% The |sproofs| package takes a single option: \DescribeMacro{showmeta}|showmeta|. If +% this is set, then the metadata keys are shown (see~\cite{Kohlhase:metakeys:ctan} for details +% and customization options). +% % \subsection{Proofs and Proof steps} % % \DescribeEnv{sproof} The |proof| environment is the main container for proofs. It takes @@ -217,7 +224,7 @@ % \begin{spfstep}[type=conclusion] % We can \begin{justification}[method=simplify-eq] % simplify the {\justarg[rhs]{right-hand side}} -% \end{justification} to ${k+1}^2$, which proves the assertion. +% \end{justification} to $(k+1)^2$, which proves the assertion. % \end{spfstep} % \end{spfcase} % \begin{spfstep}[type=conclusion] @@ -288,7 +295,34 @@ % this wastes space (especially, if a proof ends in a case analysis which will supply its % own proof end marker). To suppress it locally, just set |proofend={}| in them or use use % |\sProofEndSymbol{}|. -% +% +% \subsection{Configuration of the Presentation}\label{sec:user:conf} +% +% Finally, we provide configuration hooks in Figure~\ref{fig:hooks} for the keywords in +% proofs. These are mainly intended for package authors building on |statements|, e.g. for +% multi-language support.\ednote{we might want to develop an extension +% \texttt{sproof-babel} in the future.}. +%\begin{figure}[ht]\centering +% \begin{tabular}{|lll|}\hline +% Environment & configuration macro & value\\\hline\hline +% \texttt{proof} & \texttt{\textbackslash spf@proof@kw} & \makeatletter\spf@proof@kw\\\hline +% \texttt{sketchproof} & \texttt{\textbackslash spf@sketchproof@kw} & \makeatletter\spf@proofsketch@kw\\\hline +% \end{tabular} +% \caption{Configuration Hooks for Semantic Proof Markup}\label{fig:hooks} +% \end{figure} +% +% \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 TRAC. +% \begin{compactenum} +% \item The numbering scheme of proofs cannot be changed. It is more geared for teaching +% proof structures (the author's main use case) and not for writing papers.\lec{reported +% by Tobias Pfeiffer; see \tracissue{1658}} +% \end{compactenum} +% +% % \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography} % \newpage % @@ -312,7 +346,24 @@ use LaTeXML::Package; RequirePackage('sref'); %</ltxml> % \end{macrocode} -% Then we make sure that the {\stex} |sref| package is loaded~\ctancite{Kohlhase:sref}. +% +% \subsection{Package Options}\label{sec:impl:options} +% +% We declare some switches which will modify the behavior according to the package +% options. Generally, an option |xxx| will just set the appropriate switches to true +% (otherwise they stay false).\ednote{need an implementation for {\latexml}} +% +% \begin{macrocode} +%<*package> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} +\ProcessOptions +%</package> +%<*ltxml> +DeclareOption('showmeta',''); +%</ltxml> +% \end{macrocode} +% +% Then we make sure that the |sref| package is loaded~\ctancite{Kohlhase:sref}. % \begin{macrocode} %<*package> \RequirePackage{sref} @@ -325,13 +376,13 @@ RequirePackage('sref'); % \begin{macrocode} %<*package> \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} %</package> % \end{macrocode} % @@ -397,17 +448,16 @@ RequirePackage('sref'); % \begin{macro}{spfsketch} % \begin{macrocode} %<*package> -\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}} +\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}} %</package> %<*ltxml> 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 {}',''); %</ltxml> @@ -420,10 +470,11 @@ DefConstructor('\sProofEndSymbol {}',''); % proof, we position the proof end into the last line. % \begin{macrocode} %<*package> -\newenvironment{@proof}[2][]{\omdsetkeys{spf}{#1}\sref@target +\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}} @@ -436,7 +487,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"); @@ -449,7 +500,7 @@ DefMacro('\endsProof','\endsproof'); % \begin{environment}{spfidea} % \begin{macrocode} %<*package> -\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} %</package> %<*ltxml> @@ -457,7 +508,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"); %</ltxml> % \end{macrocode} @@ -471,7 +522,7 @@ DefCMPConstructor('\spfidea OptionalKeyVals:pf {}', % \begin{environment}{spfstep} % \begin{macrocode} %<*package> -\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} @@ -492,7 +543,7 @@ DefCMPEnvironment('{spfstep} OptionalKeyVals:pf', % \begin{environment}{sproofcomment} % \begin{macrocode} %<*package> -\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} %</package> @@ -500,7 +551,7 @@ 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>"); %</ltxml> % \end{macrocode} @@ -514,7 +565,7 @@ DefCMPEnvironment('{sproofcomment} OptionalKeyVals:pf', % proof. % \begin{macrocode} %<*package> -\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}} @@ -524,7 +575,7 @@ DefCMPEnvironment('{sproofcomment} OptionalKeyVals:pf', 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"); %</ltxml> @@ -536,7 +587,7 @@ DefEnvironment('{spfcases} OptionalKeyVals:pf {}', % after the |\item| % \begin{macrocode} %<*package> -\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}} @@ -547,7 +598,7 @@ 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"); @@ -560,12 +611,18 @@ DefEnvironment('{spfcase} OptionalKeyVals:pf{}', % started.\ednote{document this above} % \begin{macrocode} %<*package> -\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}} %</package> %<*ltxml> -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>"); %</ltxml> % \end{macrocode} % \end{environment} @@ -578,9 +635,9 @@ DefEnvironment('{subproof}', % \begin{macrocode} %<*package> \srefaddidkey{just} -\omdaddkey{just}{method} -\omdaddkey{just}{premises} -\omdaddkey{just}{args} +\addmetakey{just}{method} +\addmetakey{just}{premises} +\addmetakey{just}{args} %</package> %<*ltxml> DefKeyVal('just','id','Semiverbatim'); @@ -721,6 +778,6 @@ Tag('omdoc:derive',afterOpen=>\&numberIt,afterClose=>\&locateIt); % LocalWords: spfidea spfsketch spfsketch spfstep justarg spfcases spfcase rhs % LocalWords: sproofcomment ind-hyp splitit arith byindhyp sproofend proofend % LocalWords: printbibliography textsf langle textsf langle ltxml ctancite spf -% LocalWords: srefaddidkey omdaddkey pf.sty newenvironment hbox vrule vbox ifx +% LocalWords: srefaddidkey pf.sty newenvironment hbox vrule vbox ifx % LocalWords: hrule vskip hrule vrule hfil nobreak hfill smallskip newcommand -% LocalWords: omdsetkeys stDMemph newcount endsproof xref doctex +% LocalWords: stDMemph newcount endsproof xref doctex diff --git a/Master/texmf-dist/source/latex/stex/sref/sref.dtx b/Master/texmf-dist/source/latex/stex/sref/sref.dtx index 863967ed268..352b1d0d008 100644 --- a/Master/texmf-dist/source/latex/stex/sref/sref.dtx +++ b/Master/texmf-dist/source/latex/stex/sref/sref.dtx @@ -23,17 +23,18 @@ \usepackage{../ctansvn} \usepackage{hyperref} \usepackage[eso-foot,today]{svninfo} -\svnInfo $Id: sref.dtx 1502 2010-07-20 08:17:00Z kohlhase $ +\svnInfo $Id: sref.dtx 1671 2010-11-06 07:05:15Z kohlhase $ \svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/sref/sref.dtx $ \makeindex \floatstyle{boxed} \newfloat{exfig}{thp}{lop} \floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{sref.dtx}\end{document} %</driver> % \fi % -%\CheckSum{265} +%\iffalse\CheckSum{265}\fi % % \changes{v0.5}{2008/03/28}{split off from omdoc.sty} % \changes{v0.6}{2009/12/07}{introducing sequation} @@ -90,11 +91,13 @@ % port the functionality to other {\LaTeX} classes and packages, they have to be upgraded % via the API in \sref{sec:user:package-authors}. % -% \subsection{Package and Class Options}\label{sec:user:options} +% \subsection{Package Options}\label{sec:user:options} +% +% The |sref| package has the \DescribeMacro{extrefs}|extrefs| package option, which can be +% set to activate multifile support (see subsection~\sref{sec:user:interdoc}). If the +% \DescribeMacro{showmeta}|showmeta| is set, then the metadata keys are shown +% (see~\cite{Kohlhase:metakeys:ctan} for details and customization options). % -% The |sref| package has the \DescribeMacro{extrefs}|extrefs| package option, which can -% be set to activate multifile support (see subsection~\sref{sec:user:interdoc}). -% % \subsection{Cross-Referencing}\label{sec:user:crossref} % % The \DescribeMacro{\sref}|\sref{|\meta{id}|}| macro is the main cross-referencing macro, @@ -138,10 +141,10 @@ % so we make an example here for a slightly upgraded sectioning command in % Figure~\ref{fig:mysection:setup}. The first three lines define the keys for the keyval % attribute of the |\mysection| command using the infrastructure supplied by the |omd| -% package~\ctancite{Kohlhase:omd} (remember the |\RequirePackage{omd}|). The first two just -% initialize the keys to save the key values in internal macros, and the |\omdsetkeys| +% package~\ctancite{Kohlhase:metakeys} (remember the |\RequirePackage{metakeys}|). The first two just +% initialize the keys to save the key values in internal macros, and the |\metasetkeys| % activates the keys when reading the keyval argument. The -% \DescribeMacro{\srefaddidkey}|\srefaddidkey| macro is a variant of |\omdaddkey| macro +% \DescribeMacro{\srefaddidkey}|\srefaddidkey| macro is a variant of |\addmetakey| macro % supplied by the |sref| package that sets up the keys to set the % \DescribeMacro{\sref@id}|\sref@id| register for later use by the |sref| % infrastructure. Note that the |\srefaddidkey| macro uses the |prefix| key to @@ -150,10 +153,10 @@ % % \begin{exfig} % \begin{verbatim} -% \omdaddkey{sec}{short} -% \omdaddkey[black]{sec}{color} +% \addmetakey{sec}{short} +% \addmetakey[black]{sec}{color} % \srefaddidkey[prefix=sec.]{sec} -% \newcommand{\mysection}[2][]{\omdsetkeys{#1}\sref@target\color{\sec@color} +% \newcommand{\mysection}[2][]{\metasetkeys{#1}\sref@target\color{\sec@color} % \section[\sec@short]{#2}\sref@label@id{Section \thesection}} % \end{verbatim} % \vspace*{-1.5em} @@ -161,7 +164,7 @@ % \end{exfig} % % In this situation, the |\mysection| macro processes the optional argument with -% |\omdsetkeys| and then sets the color of the section. The +% |\metasetkeys| and then sets the color of the section. The % \DescribeMacro{\sref@target}|\sref@target| sets up the hypertarget for the |hyperref| % package to use, then we use the regular |\section| command, and we use the % \DescribeMacro{\sref@label@id}|\sref@label@id| macro to define the label that the @@ -176,7 +179,7 @@ % \begin{exfig} % \begin{verbatim} % \newcommand{\my@section@label}[1]{Section~{#1}} -% \newcommand{\mysection}[2][]{\omdsetkeys{#1}\sref@target\color{\sec@color} +% \newcommand{\mysection}[2][]{\metasetkeys{#1}\sref@target\color{\sec@color} % \section[\sec@short]{#2}\sref@label@id{\my@section@label\thesection}} % \end{verbatim} % \vspace*{-1.5em} @@ -294,11 +297,28 @@ % \caption{Semantic Equation}\label{fig:sequation} % \end{exfig} % +% +% \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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} +% % \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography} % \newpage % % \section{Implementation}\label{sec:impl} % +% The |sref| package generates two files: the {\LaTeX} package (all the code between +% {\textsf{$\langle$*package$\rangle$}} and {\textsf{$\langle$/package$\rangle$}}) and the +% {\latexml} bindings (between {\textsf{$\langle$*ltxml$\rangle$ and +% $\langle$/ltxml$\rangle$}}). We keep the corresponding code fragments together, +% since the documentation applies to both of them and to prevent them from getting out of +% sync. +% % We first set up header information for the {\latexml} binding file. % \begin{macrocode} %<*ltxml> @@ -313,8 +333,10 @@ use LaTeXML::Package; % We declare some switches which will modify the behavior according to the package % options. Generally, an option |xxx| will just set the appropriate switches to true % (otherwise they stay false).\ednote{need an implementation for {\latexml}} +% % \begin{macrocode} %<*package> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} \newif\ifextrefs\extrefsfalse \DeclareOption{extrefs}{\extrefstrue} \ProcessOptions @@ -324,14 +346,14 @@ DeclareOption('extrefs',''); %</ltxml> % \end{macrocode} % -% Then we need to set up the packages by requiring the |omd| package~\ctancite{Kohlhase:omd} +% Then we need to set up the packages by requiring the |metakeys| package~\ctancite{Kohlhase:metakeys} % to be loaded (in the right version). % % \begin{macrocode} %<*package> -\RequirePackage{omd} +\RequirePackage{metakeys} %</package> -%<ltxml>RequirePackage('omd'); +%<ltxml>RequirePackage('metakeys'); % \end{macrocode} % % \subsection{Crossreferencing}\label{sec:impl:crossref} @@ -449,12 +471,18 @@ DefConstructor('\spageref[]{}', % \begin{macro}{\srefaddidkey} % |\srefaddidkey[|\meta{keyval}|]{|\meta{group}|}| extends the metadata keys of the % group \meta{group} with an |id| key. In the optional key/value pairs in \meta{keyval} -% the |prefix| key can be used to specify a prefix. +% the |prefix| key can be used to specify a prefix. Note that the |id| key defined by +% |\srefaddidkey[|\meta{keyval}|]{|\meta{group}|}| not only defines |\sref@id|, which is +% used for referencing by the |sref| package, but also |\|\meta{group}|@id|, which is +% used for showing metadata via the |showmeta| option of the |metakeys| package. % \begin{macrocode} -\omdaddkey{srefaddidkey}{prefix} -\newcommand\srefaddidkey[2][]{\omdsetkeys{srefaddidkey}{#1}% -\@omd@ext@clear@keys{#2}{sref@id}{}% id cannot have a default -\define@key{#2}{id}{\edef\sref@id{\srefaddidkey@prefix ##1}}} +\addmetakey{srefaddidkey}{prefix} +\newcommand\srefaddidkey[2][]{\metasetkeys{srefaddidkey}{#1}% +\@metakeys@ext@clear@keys{#2}{sref@id}{}% id cannot have a default +\metakeys@ext@clear@keys{#2}{id}{}% +\metakeys@ext@showkeys{#2}{id}% +\define@key{#2}{id}{\edef\sref@id{\srefaddidkey@prefix ##1}% +\expandafter\edef\csname #2@id\endcsname{\srefaddidkey@prefix ##1}}} %</package> % \end{macrocode} % \end{macro} @@ -479,7 +507,7 @@ DefConstructor('\spageref[]{}', % \begin{macrocode} %<*package> \def\sref@label#1#2{% -\sref@def{\@ifundefined{sref@part}{}{\sref@part @}#2}{page}{\thepage} +\sref@def{\@ifundefined{sref@part}{}{\sref@part @}#2}{page}{\thepage}% \sref@def{\@ifundefined{sref@part}{}{\sref@part @}#2}{label}{#1}} %</package> % \end{macrocode} @@ -565,8 +593,8 @@ DefConstructor('\spageref[]{}', \fi %</package> %<*ltxml> -DefConstructor('\extref[]{}', - "Section <omdoc:ref type='cite' xref='#2'/>"); +DefConstructor('\extref[]{}{}', + "<omdoc:ref type='cite' xref='#2@#3'/>"); DefConstructor('\theextref',''); %</ltxml> % \end{macrocode} @@ -612,7 +640,7 @@ DefConstructor('\inputrefs{}{}',''); %<*package> \srefaddidkey{sequation} \def\sref@sequation@heading{equation} -\newenvironment{sequation}[1][]{\omdsetkeys{sequation}{#1}% +\newenvironment{sequation}[1][]{\metasetkeys{sequation}{#1}% \ifx\sref@id\@empty\begin{displaymath}\else% no id, using equation* \begin{equation}\sref@target\sref@label@id{\sref@sequation@heading~(\theequation)}\fi} {\ifx\sref@id\@empty\end{displaymath}\else\end{equation}\fi} @@ -637,7 +665,7 @@ DefEnvironment('{sequation} OptionalKeyVals', % \begin{macrocode} %<*package> \newenvironment{seqnarray}[1][]% -{\omdsetkeys{sequation}{#1}\begin{eqnarray*}\sref@target% +{\metasetkeys{sequation}{#1}\begin{eqnarray*}\sref@target% \sref@label@id{\sref@sequation@heading~(\theequation)}} {\end{eqnarray*}} %</package> @@ -683,8 +711,8 @@ DefMacro('\endseqnarray','\end{eqnarray*}'); % LocalWords: flushleft flushright DeclareOption hyperref LaTeX tex pdf hlink % LocalWords: sequation omd def texorpdfstring raisebox latexml texttt newpage % LocalWords: fileversion maketitle tableofcontents autoref hpyerref mysection -% LocalWords: exfig vspace omdsetkeys srefaddidkey srefaddidkey omdaddkey scr -% LocalWords: makeextrefs makeextrefs inputrefs inputrefs extref extref foo +% LocalWords: exfig vspacesrefaddidkey srefaddidkey scr +% LocalWords: makeextrefs inputrefs extref foo % LocalWords: extrefstyle theextref theextref displaymath hrule impl ednote % LocalWords: printbibliography newif ifextrefs extrefsfalse extrefstrue srefs % LocalWords: Crossreferencing newcommand ifundefined ifx srefl xref ifh gdef @@ -693,3 +721,5 @@ DefMacro('\endseqnarray','\end{eqnarray*}'); % LocalWords: makeatother auxfile nameuse doextref namedef newenvironment % LocalWords: theequation refnum refnum seqnarray eqnarray endseqnarray doctex % LocalWords: textsuperscript spageref spageref thepage pageref ctancite +% LocalWords: cross-referencable showmeta showmeta metakeys metasetkeys textsf +% LocalWords: addmetakey referencable langle textsf langle diff --git a/Master/texmf-dist/source/latex/stex/statements/statements.dtx b/Master/texmf-dist/source/latex/stex/statements/statements.dtx index 6619bc73714..062ee52c0a9 100644 --- a/Master/texmf-dist/source/latex/stex/statements/statements.dtx +++ b/Master/texmf-dist/source/latex/stex/statements/statements.dtx @@ -24,17 +24,18 @@ \usepackage{stex-logo} \usepackage{../ctansvn} \usepackage{hyperref} -\svnInfo $Id: statements.dtx 1502 2010-07-20 08:17:00Z kohlhase $ +\svnInfo $Id: statements.dtx 1671 2010-11-06 07:05:15Z kohlhase $ \svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/statements/statements.dtx $ \makeindex \floatstyle{boxed} \newfloat{exfig}{thp}{lop} \floatname{exfig}{Example} +\def\tracissue#1{\cite{sTeX:online}, \hyperlink{http://trac.kwarc.info/sTeX/ticket/#1}{issue #1}} \begin{document}\DocInput{statements.dtx}\end{document} %</driver> % \fi % -% \CheckSum{433} +% \iffalse\CheckSum{433}\fi % % \changes{v0.9}{2005/06/14}{First Version with Documentation} % \changes{v0.9a}{2005/07/01}{Completed Documentation} @@ -50,6 +51,7 @@ % \changes{v0.9g}{2010/01/19}{Added support for localization} % \changes{v0.9g}{2010/02/23}{added {\texttt{\textbackslash symref}}} % \changes{v1.0}{2010/06/18}{now based on {\texttt{omtext}} package instead of {\texttt{omdoc}}} +% \changes{v1.0}{2010/07/13}{adding {\texttt{\textbackslash inlineex}}} % % \GetFileInfo{statements.sty} % @@ -110,6 +112,12 @@ % the {\omdoc} transformation and uses the |ntheorem| package~\cite{MaySch:eltte09} for % formatting (i.e. transformation to PDF). % +% \subsection{Package Options}\label{sec:user:options} +% +% The |statements| package takes a single option: \DescribeMacro{showmeta}|showmeta|. If +% this is set, then the metadata keys are shown (see~\cite{Kohlhase:metakeys:ctan} for details +% and customization options). +% % \subsection{Statements}\label{sec:statements} % % All the statements are marked up as environments, that take a |KeyVal| argument that @@ -141,7 +149,7 @@ % environment |assertion| is used for all of them, and the particular subtype of % assertion is given in the \DescribeMacro{type=}|type| key. So instead of % |\begin{Lemma}|\iffalse\end{Lemma}\fi we have to write -% |\begin{assertion}[type=Lemma]|\iffalse\end{assertion}\fi (see +% |\begin{assertion}[type=lemma]|\iffalse\end{assertion}\fi (see % Example~\ref{fig:assertion} for an example). % \begin{exfig} % \begin{verbatim} @@ -247,7 +255,7 @@ % \end{symboldec} % % \symdef{NaturalNumbers}{\mathbb{N}} -% \begin{symboldec}[name=succ,title=The Natural Numbers,type=Constants] +% \begin{symboldec}[name=succ,title=The Natural Numbers,type=constant] % The natural numbers inductively defined via the Peano Axioms. % \end{symboldec} % @@ -296,14 +304,12 @@ % \DescribeEnv{definition} The |definition| environment is used for marking up % mathematical definitions. Its peculiarity is that it defines (i.e. gives a meaning to) % new mathematical concepts or objects. These\DescribeMacro{\definiendum} are identified -% by the |definiendum| macro, which takes two arguments. The first one is the system name -% of the symbol defined (for reference via |\term|), the second one is the text that is to -% be emphasized in the presentation. Note that the |\definiendum| macro can only be used -% inside the |definition| environment. If you find yourself in a situation where you want -% to use it outside, you will most likely want to wrap the appropriate text fragment in a -% |\begin{definition}[display=flow]| ... and |\end{definition}|. For instance, we could -% continue the example in Figure~\ref{fig:axioms} with the |definition| environment in -% Figure~\ref{fig:definition}. +% by the |\definiendum| macro, which is used as +% |\definiendum[|\meta{sysname}|]{|\meta{text}|}|. Here, \meta{text} is the text that is +% to be emphasized in the presentation and the optional \meta{sysname} is a system name of +% the symbol defined (for reference via |\term|, see Section~\ref{sec:user:crossref}). If +% \meta{sysname} is not given, then \meta{text} is used as a system name instead, which is +% usually sufficient for most situations. % %\begin{exfig} % \begin{verbatim} @@ -355,6 +361,14 @@ % \caption{Some definienda with Index}\label{fig:defin} % \end{exfig} % +% Note that the |\definiendum|, |\defin|, |\twindef|, and |\atwindef| macros can only be +% used inside the definitional situation, i.e. in a |definition| or |symboldec| +% environment or a |\inlinedef| macro. If you find yourself in a situation where you want +% to use it outside, you will most likely want to wrap the appropriate text fragment in a +% |\begin{definition}[display=flow]| ... and |\end{definition}|. For instance, we could +% continue the example in Figure~\ref{fig:axioms} with the |definition| environment in +% Figure~\ref{fig:definition}. +% % \DescribeMacro{\inlinedef} Sometimes we define mathematical concepts in passing, e.g. in % a phrase like ``\ldots $s(o)$ which we call {\textbf{one}}.''. For this we cannot use % the |definition| environment, which presupposes that its content gives all that is @@ -363,7 +377,11 @@ % in an |\inlinedef| macro that makes them available. The |\inlinedef| macro accepts the % same |id| and |for| keys in its optional argument, and additionally the |verbalizes| key % which can be used to point to a full definition of the concept somewhere else. -% +% +% Note that definienda can only be referenced via a |\term| element, if they are only +% allowed inside a named module, i.e. a |module| environment with a name given by the +% |id=| key or the |theory=| key on is specified on the definitional environment. +% % \subsubsection{Examples}\label{sec:user:example} % % \DescribeEnv{example} The |example| environment is a generic statement environment, @@ -371,6 +389,10 @@ % example for. The |example| environment also expects a |type| key to be specified, so % that we know whether this is an example or a counterexample. % +% \DescribeMacro{\inlineex} The |\inlineex| is analogous to |\inlinedef|, only that it is +% used for inline examples, e.g. ``\ldots mammals, e.g. goats''. Note that we have used an +% inline example for an inline example. +% % \subsection{Cross-Referencing Symbols and Concepts}\label{sec:user:crossref} % % If we have defined a concept with the |\definiendum| macro, then we can mark up other @@ -419,7 +441,7 @@ % a hyperlink to the relevant definition (i.e. the one that has the declaration % |for=|\meta{cseq} in the metadata argument.) % -% \section{Configuration}\label{sec:user:rest} +% \section{Configuration of the Presentation}\label{sec:conf} % % \DescribeMacro{\defemph} The |\defemph| macro is a configuration hook that allows to % specify the style of presentation of the {\index*{definiendum}}. By default, it is set to @@ -469,6 +491,15 @@ % \end{tabular} % \caption{Configuration Hooks for statement types}\label{fig:hooks} % \end{exfig} +% +% \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}. +% \begin{compactenum} +% \item none reported yet +% \end{compactenum} % % \StopEventually{\newpage\PrintIndex\newpage\PrintChanges\printbibliography} % @@ -481,11 +512,14 @@ % since the documentation applies to both of them and to prevent them from getting out of % sync. % +% \subsection{Package Options}\label{sec:impl:options} +% % We declare some switches which will modify the behavior according to the package % options. Generally, an option |xxx| will just set the appropriate switches to true % (otherwise they stay false). First we have the general options % \begin{macrocode} %<*package> +\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}} \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{omdoc}} % \end{macrocode} % Finally, we need to declare the end of the option declaration section to {\LaTeX}. @@ -542,17 +576,31 @@ sub makeNCName { % \begin{macrocode} %<*ltxml> sub simple_wrapper { - my @input = @_; + #Deref if array reference + my @input; + foreach (@_) { + if (ref $_ && $_ =~ /ARRAY/ && $_ !~ /LaTeXML/) { + @input=(@input,@$_); + } else + { push (@input,$_); } + } return '' if (!@input); - @input = map(split(/\s*,\s*/,$_->toString),@input); + @input = map(split(/\s*,\s*/,ToString($_)),@input); my $output=join(" ",@input); $output=~s/(^ )|[{}]//g; #remove leading space and list separator brackets $output||''; } sub hash_wrapper{ - my @input = @_; + #Deref if array reference + my @input; + foreach (@_) { + if (ref $_ && $_ =~ /ARRAY/ && $_ !~ /LaTeXML/) { + @input=(@input,@$_); + } else + { push (@input,$_); } + } return '' if (!@input); - @input = map(split(/\s*,\s*/,$_->toString),@input); + @input = map(split(/\s*,\s*/,ToString($_)),@input); my $output=join(".sym #",@input); $output=~s/(^\.sym )|[{}]//g; #remove leading space and list separator brackets "#$output"||''; @@ -565,7 +613,7 @@ sub hash_wrapper{ % \begin{macro}{\STpresent} % \begin{macrocode} %<*package> -\def\STpresent#1{#1} +\providecommand\STpresent[1]{#1} %</package> % \end{macrocode} % \end{macro} @@ -580,7 +628,7 @@ sub hash_wrapper{ % \begin{macrocode} %<*package> \def\define@statement@env#1{% -\newenvironment{#1}[1][]{\omdsetkeys{omtext}{##1}\sref@target% +\newenvironment{#1}[1][]{\metasetkeys{omtext}{##1}\sref@target% \ifx\omtext@display\st@flow\else% \ifx\omtext@title\@empty\begin{ST#1Env}\else\begin{ST#1Env}[\omtext@title]\fi% \ifx\sref@id\@empty\else\label{#1.\sref@id}\fi @@ -595,7 +643,7 @@ sub hash_wrapper{ % \begin{environment}{assertion} % \begin{macrocode} %<*package> -\newenvironment{assertion}[1][]{\omdsetkeys{omtext}{#1}\sref@target% +\newenvironment{assertion}[1][]{\metasetkeys{omtext}{#1}\sref@target% \ifx\omtext@display\st@flow\else% \ifx\omtext@title\@empty\begin{ST\omtext@type AssEnv}% \else\begin{ST\omtext@type AssEnv}[\omtext@title]\fi\fi% @@ -669,6 +717,7 @@ DefCMPEnvironment('{example} OptionalKeyVals:omtext', "<omdoc:example " . "?&KeyVal(#1,'id')(xml:id='&KeyVal(#1,'id')')() " . "?&KeyVal(#1,'for')(for='&hash_wrapper(&KeyVal(#1,'for'))')()>" + . "?&KeyVal(#1,'title')(<dc:title>&KeyVal(#1,'title')</dc:title>)()" . "<omdoc:CMP><omdoc:p>#body" . "</omdoc:example>\n"); %</ltxml> @@ -699,13 +748,13 @@ DefCMPEnvironment('{axiom} OptionalKeyVals:omtext', % \begin{macrocode} %<*package> \srefaddidkey{symboldec} -\omdaddkey{symboldec}{functions} -\omdaddkey{symboldec}{role} -\omdaddkey{symboldec}{title} -\omdaddkey{symboldec}{name} -\omdaddkey{symboldec}{display} +\addmetakey{symboldec}{functions} +\addmetakey{symboldec}{role} +\addmetakey*{symboldec}{title} +\addmetakey{symboldec}{name} +\addmetakey*{symboldec}{display} \def\symboldec@type{Symbol} -\newenvironment{symboldec}[1][]{\omdsetkeys{symboldec}{#1}\sref@target +\newenvironment{symboldec}[1][]{\metasetkeys{symboldec}{#1}\sref@target\st@indeftrue% \ifx\symboldec@display\st@flow\else{\stDMemph{\symboldec@type} \symboldec@name:}\fi% \ifx\symboldec@title\@empty~\else~(\stDMemph{\symboldec@title})\par\fi}{} %</package> @@ -739,7 +788,7 @@ DefConstructor('\symtype{}{}', % \begin{macrocode} %<*package> \newif\ifst@indef\st@indeffalse -\newenvironment{definition}[1][]{\omdsetkeys{omtext}{#1}\sref@target\st@indeftrue% +\newenvironment{definition}[1][]{\metasetkeys{omtext}{#1}\sref@target\st@indeftrue% \ifx\omtext@display\st@flow\else% \ifx\omtext@title\@empty\begin{STdefinitionEnv}\else\begin{STdefinitionEnv}[\omtext@title]\fi\fi% \ifx\sref@id\@empty\sref@label@id{here}\else% @@ -826,7 +875,7 @@ DefConstructor('\notatiendum OptionalKeyVals:notation {}', % \end{environment} % % \begin{macro}{\st@def@target} -% The next macro is a variant of the |\sref@target| macro provided by the |sref| package +% the next macro is a variant of the |\sref@target| macro provided by the |sref| package % specialized for the use in the |\definiendum|, |\defin|, |\twindef|, and |\atwindef| % macros. |\st@def@target{|\meta{opt}|}{|\meta{name}|}| makes a target with label % |sref@|\meta{opt}|@|\meta{modulename}|@target|, if \meta{opt} is non-empty, else with @@ -835,20 +884,24 @@ DefConstructor('\notatiendum OptionalKeyVals:notation {}', % \begin{macrocode} %<*package> \def\st@def@target#1#2{\def\@test{#1}% -\@ifundefined{mod@id}% -{\PackageError{statements}{definiendum in unidentified module}% -{\protect\definiendum, \protect\defin, +\ifst@indef% if we are in a definition or such +\ifx\omtext@theory\@empty% if there is no theory attribute +\@ifundefined{mod@id}% if we are not in a module +{\PackageWarning{statements}{definiendum in unidentified module\MessageBreak +\protect\definiendum, \protect\defin, \protect\twindef, \protect\atwindef\MessageBreak -may only be called in a module with id key}}% -{\ifst@indef\else\PackageWarning{statements} - {definiendum outside definition context\MessageBreak +can only be referenced when called in a module with id key}}% +{\ifx\@test\@empty% +\expandafter\sref@target@ifh{sref@#2@\mod@id @target}{}\else% +\expandafter\sref@target@ifh{sref@#1@\mod@id @target}{}\fi}% +\else\expandafter\sref@target@ifh{sref@#1@\omtext@theory @target}{}\fi% +\else\PackageError{statements}% +{definiendum outside definition context\MessageBreak \protect\definiendum, \protect\defin, \protect\twindef, \protect\atwindef\MessageBreak do not make sense semantically outside a definition.\MessageBreak -Consider wrapping the defining phrase in a \protect\inlinedef}\fi -\ifx\@test\@empty% -\expandafter\sref@target@ifh{sref@#2@\mod@id @target}{}\else% -\expandafter\sref@target@ifh{sref@#1@\mod@id @target}{}\fi}} +Consider wrapping the defining phrase in a \protect\inlinedef}% +\fi} %</package> % \end{macrocode} % \end{macro} @@ -1068,10 +1121,21 @@ DefConstructor('\atwindefalt[]{}{}{}{}', % \end{macrocode} % \end{macro} % +% \begin{macro}{\inlineex} +% \begin{macrocode} +%<*package> +\newcommand{\inlineex}[2][]{\metasetkeys{omtext}{#1}\sref@target\sref@label@id{here}#2} +%</package> +%<*ltxml> +DefConstructor('\inlineex OptionalKeyVals:omtext {}', + "<omdoc:phrase type='example'>#2</omdoc:phrase>"); +%</ltxml> +% \end{macrocode} +% \end{macro} % \begin{macro}{\inlinedef} % \begin{macrocode} %<*package> -\newcommand{\inlinedef}[2][]{\omdsetkeys{omtext}{#1}\sref@target\sref@label@id{here}\st@indeftrue #2} +\newcommand{\inlinedef}[2][]{\metasetkeys{omtext}{#1}\sref@target\sref@label@id{here}\st@indeftrue #2} %</package> %<*ltxml> DefConstructor('\inlinedef OptionalKeyVals:omtext {}', sub { @@ -1133,17 +1197,17 @@ DefConstructor('\inlinedef OptionalKeyVals:omtext {}', sub { % define it as the local module identifier. % \begin{macrocode} %<*package> -\omdaddkey[\mod@id]{termref}{cd} -\omdaddkey{termref}{cdbase} -\omdaddkey{termref}{name} -\omdaddkey{termref}{role} -\def\termref@set#1#2{\def\termref@name{#2}\omdsetkeys{termref}{#1}} +\addmetakey[\mod@id]{termref}{cd} +\addmetakey{termref}{cdbase} +\addmetakey{termref}{name} +\addmetakey{termref}{role} +\def\termref@set#1#2{\def\termref@name{#2}\metasetkeys{termref}{#1}} % \end{macrocode} % \end{macro} % % \begin{macro}{\termref} % \begin{macrocode} -\newcommand{\termref}[2][]{\omdsetkeys{termref}{#1}\st@termref{#2}} +\newcommand{\termref}[2][]{\metasetkeys{termref}{#1}\st@termref{#2}} %</package> %<*ltxml> DefConstructor('\termref OptionalKeyVals:termref {}', @@ -1297,9 +1361,9 @@ Tag('omdoc:term',afterOpen=>\&numberIt,afterClose=>\&locateIt); % LocalWords: STfalseconjectureAssEnv STpostulateAssEnv STobligationAssEnv foo % LocalWords: STassumptionAssEnv STobservationAssEnv STexampleEnv textsf ltxml % LocalWords: STdefinitionEnv STnotationEnv printbibliography langle ncname -% LocalWords: theoremstyle sym newenvironment omdsetkeys ifx csname endcsname +% LocalWords: theoremstyle sym newenvironment ifx csname endcsname % LocalWords: currentlabel theorembodyfont itshape theoremheaderfont bfseries -% LocalWords: normalfont newtheorem upshape srefaddidkey omdaddkey symtype +% LocalWords: normalfont newtheorem upshape srefaddidkey % LocalWords: newcommand indef newif ifst indeffalse indeftrue attr whatsit % LocalWords: STdefinitionEnvKeyword notemph modulename ifundefined atwin % LocalWords: expandafter providecommand nameuse doctex ctancite funval diff --git a/Master/texmf-dist/source/latex/stex/xsl/omdocpost.xsl b/Master/texmf-dist/source/latex/stex/xsl/omdocpost.xsl index d49f692a387..f3198fc1532 100644 --- a/Master/texmf-dist/source/latex/stex/xsl/omdocpost.xsl +++ b/Master/texmf-dist/source/latex/stex/xsl/omdocpost.xsl @@ -94,9 +94,7 @@ <!-- for citations we just extract the bibrefs at the moment. --> <xsl:template match="ltx:cite"><xsl:apply-templates select="ltx:bibref"/></xsl:template> <xsl:template match="ltx:bibref"> - <xsl:for-each select="str:tokenize(@bibrefs,',')"> - <ref type="cite" xref="{.}"/> - </xsl:for-each> + <citation><xsl:copy-of select="@bibrefs"/></citation> </xsl:template> <!-- we ignore LaTeXML breaks --> @@ -173,11 +171,28 @@ </xsl:template> <!-- for LaTeXML tables --> -<xsl:template match="ltx:tabular"><table><xsl:apply-templates/></table></xsl:template> -<xsl:template match="ltx:tbody"><xsl:apply-templates/></xsl:template> -<xsl:template match="ltx:tr"><tr><xsl:apply-templates/></tr></xsl:template> -<xsl:template match="ltx:td"><td><xsl:apply-templates/></td></xsl:template> -<xsl:template match="ltx:thead"><xsl:apply-templates/></xsl:template> +<xsl:template match="ltx:tabular"> + <table> + <xsl:copy-of select="@*"/> + <xsl:apply-templates/> + </table> +</xsl:template> + +<xsl:template match="ltx:tr"> + <tr> + <xsl:copy-of select="@*"/> + <xsl:apply-templates/> + </tr> +</xsl:template> + +<xsl:template match="ltx:td"> + <td> + <xsl:copy-of select="@*"/> + <xsl:apply-templates/> + </td> +</xsl:template> + +<xsl:template match="ltx:thead|ltx:tbody"><xsl:apply-templates/></xsl:template> <!-- for LaTeXML references from \url --> <xsl:template match="ltx:ref[@class='url']"> @@ -379,7 +394,8 @@ </xsl:if> <xsl:if test="//om:OMS[@cd='latexml' and (@name='greater-than' or - @name='less-than' or + @name='less-than' or + @name='not-equals' or @name='greater-than-or-equals' or @name='less-than-or-equals')]"> <imports from="{$omcds}/relation1.omdoc#relation1"/> @@ -429,7 +445,7 @@ </xsl:template> <xsl:template match="om:OMS[@cd='latexml' and @name='not-equals']"> - <om:OMS cd="relation1" name="ne"/> + <om:OMS cd="relation1" name="neq"/> </xsl:template> <!-- get rid of the sectioning commands --> |