summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/presentation/presentation.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/stex/presentation/presentation.dtx')
-rw-r--r--Master/texmf-dist/source/latex/stex/presentation/presentation.dtx714
1 files changed, 159 insertions, 555 deletions
diff --git a/Master/texmf-dist/source/latex/stex/presentation/presentation.dtx b/Master/texmf-dist/source/latex/stex/presentation/presentation.dtx
index 11343b7322f..97322a227d4 100644
--- a/Master/texmf-dist/source/latex/stex/presentation/presentation.dtx
+++ b/Master/texmf-dist/source/latex/stex/presentation/presentation.dtx
@@ -3,13 +3,13 @@
% Copyright (C) 2004-2007 Michael Kohlhase, all rights reserved
% This file is released under the LaTeX Project Public License (LPPL)
%
-% The development version of this file can be found at
-% $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/presentation/presentation.dtx $
+% The original of this file is in the public repository at
+% http://github.com/KWARC/sTeX/
% \fi
%
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<package>\ProvidesPackage{presentation}[2012/01/28 v1.0 presentation for semantic macros]
+%<package>\ProvidesPackage{presentation}[2016/04/07 v1.0 presentation for semantic macros]
%
%<*driver>
\documentclass{ltxdoc}
@@ -17,12 +17,12 @@
\usepackage{modules,presentation,stex-logo}
\usepackage[show]{ed}
\usepackage[hyperref=auto,style=alphabetic]{biblatex}
-\bibliography{kwarc}
-\usepackage{../ctansvn}
+\addbibresource{kwarcpubs.bib}
+\addbibresource{extpubs.bib}
+\addbibresource{kwarccrossrefs.bib}
+\addbibresource{extcrossrefs.bib}
+\usepackage{ctangit}
\usepackage{hyperref}
-\usepackage[eso-foot,today]{svninfo}
-\svnInfo $Id: presentation.dtx 1999 2012-01-28 07:32:11Z kohlhase $
-\svnKeyword $HeadURL: https://svn.kwarc.info/repos/stex/trunk/sty/presentation/presentation.dtx $
\makeindex
\floatstyle{boxed}
\newfloat{exfig}{thp}{lop}
@@ -32,7 +32,7 @@
%</driver>
% \fi
%
-% \CheckSum{598}
+% \CheckSum{551}
%
% \changes{v0.9}{2005/06/14}{First Version with Documentation}
% \changes{v0.9a}{2005/07/01}{Completed Documentation}
@@ -49,6 +49,8 @@
% \changes{v0.9h}{2010/06/18}{considering done now}
% \changes{v1.0}{2010/12/27}{adding \texttt{\textbackslash funapp}}
% \changes{v1.0}{2011/01/28}{moving \texttt{\textbackslash funapp} and
+% \changes{v1.0}{2012/11/09}{Moving LaTeXML bindings into \texttt{presentation.sty.ltxml} and
+% disabling generation}
% \texttt{\textbackslash vname} (and friends) to new package {\texttt{cmath}}}
% \GetFileInfo{presentation.sty}
%
@@ -202,7 +204,8 @@
%
% For certain common cases, the |presentation| package provides shortcuts for the mixfix
% declarations. For instance, we provide the \DescribeMacro{\infix}|\infix| macro for
-% binary operators that are written between their arguments (see Figure~\ref{fig:mixfix}).\ednote{really?}
+% binary operators that are written between their arguments (see
+% Figure~\ref{fig:mixfix}).\ednote{really?}
%
% \subsection{\texorpdfstring{$n$}{n}-ary Associative Operators}\label{sec:assoc}
%
@@ -231,7 +234,7 @@
% \meta{post}, are prefix and postfix presentational material. For instance, the finite
% set constructor could be constructed as
% \begin{verbatim}
-% \newcommand{\fset}[1]{\mixfixa[p=1000]{\{}{#1}{\}}{,}}
+% \newcommand\fset[1]{\mixfixa{\{}{#1}{\}},}
% \end{verbatim}
%
% The \DescribeMacro{\assoc}|\assoc| macro is a convenient abbreviation of a |\mixfixa|
@@ -345,8 +348,8 @@
% most operators have precedences higher than the default precedence of 0, otherwise the
% brackets would not be elided. For our examples above, we would define
% \begin{verbatim}
-% \newcommand{\nunion}[1]{\assoc[p=500]{\cup}{#1}}
-% \newcommand{\ninters}[1]{\assoc[p=600]{\cap}{#1}}
+% \newcommand\nunion[1]{\assoc[p=500]{\cup}{#1}}
+% \newcommand\ninters[1]{\assoc[p=600]{\cap}{#1}}
% \end{verbatim}
% to get the desired behavior.
%
@@ -357,14 +360,14 @@
% Note that formula parts that look like brackets usually are not. For instance, we should
% not define the finite set constructor via
% \begin{equation}\label{wrongset}
-% |\newcommand{\fset}[1]{\assoc[lbrack=\{,rbrack=\}]{,}{#1}}|
+% |\newcommand\fset[1]{\assoc[lbrack=\{,rbrack=\}]{,}{#1}}|
% \end{equation}
% where the curly braces are used as brackets, but as presented in section~\ref{sec:assoc}
% even though both would format |\fset{a,b,c}| as $\{a,b,c\}$. In the encoding here, an
% operator with suitably high operator precedence (it is the best practice u)would be able
% to make the brackets disappear. Thus the correct version of (\ref{wrongset}) is
% \begin{equation}\label{goodset}
-% |\newcommand{\fset}[1]{\mixfixa[p=\iprec,pi=0]{\{}{#1}{\}}{,}}|
+% |\newcommand\fset[1]{\mixfixa[p=\iprec,pi=0]{\{}{#1}{\}}{,}}|
% \end{equation}
% Note that |\prefix| and |\postfix| and their variants declared in
% section~\ref{sec:prepostfix} have brackets that do not participate (actively) in the
@@ -373,6 +376,22 @@
% precedence |pi| has negative infinity as a default to avoid spurious brackets for
% arguments.
%
+% There is another use case for the |\mixfixi| macro that is not apparent at first
+% glance. In some cases, we would naively construct presentations without a mixfix
+% declaration, e.g.
+% \begin{equation}\label{wrongfrac}
+% |\newcommand\half[1]{\frac{#1}2}|
+% \end{equation}
+% The the problem here is that the fraction does not participate in the precedence-based
+% bracketing system, and in particular, the numerator will often have too many brackets
+% (the incoming precedence is just passe through the |\half| macro). A better way is to
+% wrap the intended presentation in a (somewhat spurious) |\mixfixi|, which we give the
+% precedence |nobrackets|, which suppresses all (outer and argument) brackets for one
+% level:
+% \begin{equation}\label{wrongfrac}
+% |\newcommand\half[1]{\mixfixi[nobrackets]{}{\frac{#1}2}{}}|
+% \end{equation}
+%
% \subsection{Flexible Elision}\label{sec:flexible-elision}
%
% There are several situations in which it is desirable to display only some parts of the
@@ -473,9 +492,9 @@
% 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.}
+% \symdef{piece}[2]{\parrayline{\parraycell{#1}}{\text{if}\;#2}}
+% \symdef{otherwise}[1]{\parrayline{\parraycell{#1}}{\text{else}}}
+% \symdef{piecewise}[1]{\left\{\parray{rl}{#1}\right.}
% \qquad\begin{minipage}[c]{5cm}
% $\vert x\vert\colon=\piecewise{\piece{x}{x>0}\piece{-x}{x<0}\otherwise{0}}$
% \end{minipage}
@@ -494,8 +513,8 @@
% \end{module}
% \hrule
% \begin{verbatim}
-% \symdef{piece}[2]{\arrayline{\arraycell{#1}}{\text{if}\;#2}}
-% \symdef{otherwise}[1]{\arrayline{\arraycell{#1}}{\text{else}}}
+% \symdef{piece}[2]{\parrayline{\parraycell{#1}}{\text{if}\;#2}}
+% \symdef{otherwise}[1]{\parrayline{\parraycell{#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}
@@ -517,24 +536,24 @@
% 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
+% the |presentation| package provides the macros |\parrayline| and |\parraycell| that
% refactor this functionality.
%
-% \DescribeMacro{\arrayline}|\arrayline{|\meta{cells}|}{|\meta{cell}|}| is
+% \DescribeMacro{\parrayline}|\parrayline{|\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
+% \DescribeMacro{\parraycell}|\parraycell{|\meta{cell}|}|, where \meta{cell} is the cell
% content. In last lines of Figure~\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
+% |\parrayline| 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}.
+% the \sTeX GitHub repository~\cite{sTeX:github:on}.
% \begin{compactenum}
% \item none reported yet
% \end{compactenum}
@@ -543,69 +562,53 @@
%
% \section{The Implementation}\label{sec:implementation}
%
-% The |presentation| package generates to 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
-% {\textsf{$\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.
-%
-% For {\latexml}, we initialize the package inclusions.
-% \begin{macrocode}
-%<*ltxml>
-# -*- CPERL -*-
-package LaTeXML::Package::Pool;
-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}
-%
+% The |presentation| package does not take options (at the moment), but we accept any and
+% ignore them.
% \begin{macrocode}
%<*package>
+\DeclareOption*{}
\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]
+\RequirePackage{keyval}[1997/11/10]
+\RequirePackage{amsmath}
% \end{macrocode}
% We will first specify the default precedences and brackets, together with the macros
% that allow to set them.
% \begin{macrocode}
-%<*package>
\def\pres@default@precedence{0}
\def\pres@infty{1000000}
+\def\pres@infty@minusone{999999}
\def\iprec{\pres@infty}
\def\niprec{-\pres@infty}
\def\pres@initial@precedence{0}
\def\pres@current@precedence{\pres@initial@precedence}
\def\pres@default@lbrack{(}\def\pres@lbrack{\pres@default@lbrack}
\def\pres@default@rbrack{)}\def\pres@rbrack{\pres@default@rbrack}
-%</package>
-%<*ltxml>
-DefMacro('\iprec','1000000');
-DefMacro('\niprec','-1000000');
-%</ltxml>
% \end{macrocode}
%
% \subsection{The System Commands}\label{sec:impl:syscommands}
%
+% \begin{macro}{\withprec*}
+% |\withprec| will set the current precedence.\ednote{need to implement this in
+% {\latexml}! it is used in |power| in |smglom/smglom/source/arithmetcis.tex|. We also
+% need to document it above!}
+% \begin{macrocode}
+\newcommand\withpreci[1]{\edef\pres@current@precedence{#1}}
+\newcommand\withprecii[1]{\edef\pres@current@precedence{#1}}
+\newcommand\withpreciii[1]{\edef\pres@current@precedence{#1}}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\PrecSet}
-% |\PrecSet| will set the default precedence.\ednote{need to implement this in {\latexml}?}
+% |\PrecSet| will set the default precedence.\ednote{need to implement this in
+% {\latexml}! Also document it above! On the other hand it is never used.}
% \begin{macrocode}
-%<*package>
-\def\PrecSet#1{\def\pres@default@precedence{#1}}
-%</package>
-%<*ltxml>
-%</ltxml>
+\newcommand\PrecSet[1]{\edef\pres@default@precedence{#1}}
% \end{macrocode}
% \end{macro}
%
@@ -613,9 +616,8 @@ DefMacro('\niprec','-1000000');
% |\PrecWrite| will write a bracket, if the precedence mandates it, i.e. if |\pres@p| is
% greater than the current precedence specified by |\pres@current@precedence|
% \begin{macrocode}
-%<*package>
\def\PrecWrite#1{\ifnum\pres@p>\pres@current@precedence\else{#1}\fi}
-%</package>
+\def\PrepostPrecWrite#1{\ifnum\pres@p@key>\pres@infty@minusone\else{#1}\fi}
% \end{macrocode}
% \end{macro}
%
@@ -624,99 +626,30 @@ DefMacro('\niprec','-1000000');
% We first define the keys for the keyval arguments for |\prefix| and |\postfix|.
%
% \begin{macrocode}
-%<*package>
\def\prepost@clearkeys{\def\pres@p@key{\pres@default@precedence}\def\pres@pi@key{\niprec}
\def\pres@lbrack{\pres@default@lbrack}\def\pres@rbrack{\pres@default@rbrack}}
\define@key{prepost}{lbrack}{\def\pres@lbrack{#1}}
\define@key{prepost}{rbrack}{\def\pres@lbrack{#1}}
\define@key{prepost}{p}{\def\pres@p@key{#1}}
\define@key{prepost}{pi}{\def\pres@pi@key{#1}}
-%</package>
+\define@key{prepost}{nobrackets}[yes]{\def\pres@p@key{\pres@infty}%
+\def\pres@pi@key{-\pres@infty}}
% \end{macrocode}
%
% \begin{macro}{\prefix}
% In prefix we always write the brackets.
% \begin{macrocode}
-%<*package>
-\newcommand{\prefix}[3][]%key, fn, arg
+\newcommand\prefix[3][]%key, fn, arg
{\prepost@clearkeys\setkeys{prepost}{#1}
-{#2}\pres@lbrack{\edef\pres@current@precedence{\pres@pi@key}#3}\pres@rbrack}
-%</package>
-%<*ltxml>
-DefConstructor('\crossrefOp[]{}',
- "?#2(<ltx:XMApp role='CROSSREFOP'>"
- . "<ltx:XMTok role='CROSSREFOP' cr='?#1(#1)(fun)'/>"
- . "<ltx:XMWrap>#2</ltx:XMWrap>"
- ."</ltx:XMApp>)()",
- requireMath=>1);
-
-DefMacro('\prefix[]{}{}','\@prefix[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}');
-DefConstructor('\@prefix OptionalKeyVals:mi {}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') "
- . "argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "#2"
- . "<m:mrow>"
- . "<m:mo fence='true'>(</m:mo>"
- . "#3"
- . "<m:mo fence='true'>)</m:mo>"
- . "</m:mrow>"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub {
- #Default argument precedence is -\infty
- my $keyval = $_[1]->getArg(1);
- $keyval->setValue('pi',-1000000) unless ($keyval && defined($keyval->getValue('pi')));
- applyPrecedencePreferences(@_);
- },
- properties=>sub { getSymmdefProperties($_[1]); });
-%</ltxml>
+{#2}\PrepostPrecWrite\pres@lbrack{\edef\pres@current@precedence{\pres@pi@key}#3}\PrepostPrecWrite\pres@rbrack}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\postfix}
% \begin{macrocode}
-%<*package>
-\newcommand{\postfix}[3][]%key, fn, arg
+\newcommand\postfix[3][]%key, fn, arg
{\prepost@clearkeys\setkeys{prepost}{#1}
-\pres@lbrack{\edef\pres@current@precedence{\pres@pi@key}#3}\pres@rbrack{#2}}
-%</package>
-%<*ltxml>
-DefMacro('\postfix []{}{}','\@postfix[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}');
-DefConstructor('\@postfix OptionalKeyVals:mi {}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') "
- ."argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "<m:mrow>"
- . "<m:mo fence='true'>(</m:mo>"
- . "#3"
- . "<m:mo fence='true'>)</m:mo>"
- . "</m:mrow>"
- . "#2"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub {
- #Default argument precedence is -\infty
- my $keyval = $_[1]->getArg(1);
- $keyval->setValue('pi',-1000000) unless ($keyval && defined($keyval->getValue('pi')));
- applyPrecedencePreferences(@_);
- },
- properties=>sub { getSymmdefProperties($_[1]); });
-%</ltxml>
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\funapp}
-% Finally the |\funapp| macro is very simple:
-% \begin{macrocode}
-%<*package>
-\newcommand{\funapp}[2]{\prefix{#1}{#2}}
-%</package>
-%<*ltxml>
-DefConstructor('\funapp{}{}','<ltx:XMApp>#1#2</ltx:XMApp>');
-%</ltxml>
+\PrepostPrecWrite\pres@lbrack{\edef\pres@current@precedence{\pres@pi@key}#3}\PrepostPrecWrite\pres@rbrack{#2}}
% \end{macrocode}
% \end{macro}
%
@@ -740,7 +673,6 @@ DefConstructor('\funapp{}{}','<ltx:XMApp>#1#2</ltx:XMApp>');
% proper form of the argument render elements.
%
% \begin{macrocode}
-%<*package>
\def\clearkeys{\let\pres@p@key=\relax
\let\pres@pi@key=\relax%
\let\pres@pi@key=\relax%
@@ -757,76 +689,15 @@ DefConstructor('\funapp{}{}','<ltx:XMApp>#1#2</ltx:XMApp>');
\edef\pres@rbrack{\@ifundefined{pres@rbrack@key}\pres@default@rbrack\pres@rbrack@key}
\edef\pres@p{\@ifundefined{pres@p@key}\pres@default@precedence\pres@p@key}
\edef\pres@pi{\@ifundefined{pres@pi@key}\pres@p\pres@pi@key}}
-%</package>
-%<*ltxml>
-our $max_arguments = 10; #Currently max 10 arguments to \symdef.
-DefKeyVal('mi','lbrack','Semiverbatim');
-DefKeyVal('mi','rbrack','Semiverbatim');
-DefKeyVal('mi','p','Semiverbatim');
-DefKeyVal('mi','pi','Semiverbatim');
-DefKeyVal('mi','pii','Semiverbatim'); #Why are we using this at mixfixai ?
-DefKeyVal('mi','cd','Semiverbatim');
-DefKeyVal('mi','name','Semiverbatim');
-DefKeyVal('mi','nobrackets','Semiverbatim');
-sub argument_precedence {
- my ($keyval) = @_;
- my $attr = 'pi';
- my @precs = ();
- foreach (1..$max_arguments) {
- if (defined KeyVal($keyval,$attr)) {
- push @precs, ToString(KeyVal($keyval,$attr))
- } else {
- push @precs, "";
- }
- $attr = $attr.'i';
- }
- return join(" ",@precs)." ";
-}
-sub applyPrecedencePreferences {
- my ($stomach,$whatsit) = @_;
- my @args = $whatsit->getArgs;
- my $keyvals = shift @args;
- return unless (defined $keyvals);
- my %kvhash = %{$keyvals->getKeyVals};
- #Default p (operator precedence) if not set:
- my $default_precedence = LookupValue('default_precedence');
- $keyvals->setValue('p',$default_precedence) unless defined($keyvals->getValue('p'));
- return unless (exists $kvhash{'nobrackets'});
- $keyvals->setValue('p',1000000);
- $keyvals->setValue('pi',-1000000);
- $keyvals->setValue('pii',-1000000);
- $keyvals->setValue('piii',-1000000);
- return;
-}#$
-%</ltxml>
% \end{macrocode}
%
% \begin{macro}{\mixfixi}
% \begin{macrocode}
-%<*package>
-\newcommand{\mixfixi}[4][]%key, pre, arg, post
+\newcommand\mixfixi[4][]%key, pre, arg, post
{\clearkeys\setkeys{mi}{#1}\prep@keys@mi%
\PrecWrite\pres@lbrack%
#2{\edef\pres@current@precedence{\pres@pi}#3}#4%
\PrecWrite\pres@rbrack}
-%</package>
-%<*ltxml>
-DefMacro('\mixfixi[]{}{}{}',
- '\@mixfixi[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}'
- . '{\ensuremath{\crossrefOp[fun]{#4}}}');
-DefConstructor('\@mixfixi OptionalKeyVals:mi {}{}{}',
- "<omdoc:rendering"
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')')"
- . " argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "<m:mo egroup='fence' fence='true'>(</m:mo>"
- . "#2 #3 #4"
- . "<m:mo egroup='fence' fence='true'>)</m:mo>"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub { applyPrecedencePreferences(@_);},
- properties=>sub { getSymmdefProperties($_[1]); });#$
-%</ltxml>
% \end{macrocode}
% \end{macro}
%
@@ -834,53 +705,38 @@ DefConstructor('\@mixfixi OptionalKeyVals:mi {}{}{}',
% We are using functionality from the {\LaTeX} core packages here to iterate over the
% arguments.
% \begin{macrocode}
-%<*package>
\def\@assoc#1#2#3{% precedence, function, argv
\let\@tmpop=\relax% do not print the function the first time round
\@for\@I:=#3\do{\@tmpop% print the function
% write the i-th argument with locally updated precedence
{\edef\pres@current@precedence{#1}\@I}%
-\let\@tmpop=#2}}%update the function
-%</package>
+\def\@tmpop{#2}}}%update the function
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mixfixa}
% \begin{macrocode}
-%<*package>
-\newcommand{\mixfixa}[5][]%key, pre, arg, post, assocop
+\newcommand\mixfixa[5][]%key, pre, arg, post, assocop
{\clearkeys\setkeys{mi}{#1}\prep@keys@mi%
\PrecWrite\pres@lbrack{#2}{\@assoc\pres@pi{#5}{#3}}{#4}\PrecWrite\pres@rbrack}
-%</package>
-%<*ltxml>
-DefMacro('\mixfixa[]{}{}{}{}',
- '\@mixfixa[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}'
- . '{\ensuremath{\crossrefOp[fun]{#4}}}'
- . '{\ensuremath{\crossrefOp[fun]{\ensuremath{#5 }}}}');
-DefConstructor('\@mixfixa OptionalKeyVals:mi {}{}{}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')')>"
- . "<m:mrow>"
- . "<m:mo egroup='fence' fence='true'>(</m:mo>"
- . "#2"
- . "<omdoc:iterate name='args' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>"
- . "<omdoc:separator>#5</omdoc:separator>"
- . "<omdoc:render name='arg' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>"
- . "</omdoc:iterate>"
- . "#4"
- . "<m:mo egroup='fence' fence='true'>)</m:mo>"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub { applyPrecedencePreferences(@_);},
- properties=>sub { getSymmdefProperties($_[1]); });#$
-%</ltxml>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mixfixA}
+% A variant of |\mixfixa| that puts the arguments into an array.\ednote{MK: this is very
+% experimental now, if this works, we need to document this above and extend this to the
+% other mixfix declarations. Also we could use a key for the array format argument.}
+% \begin{macrocode}
+\newcommand\mixfixA[5][]%key, pre, arg, post, assocop
+{\clearkeys\setkeys{mi}{#1}\prep@keys@mi%
+\renewcommand\do[1]{\@assoc\pres@pi{#5}{##1}{#5}\tabularnewline}%
+\PrecWrite\pres@lbrack% write bracket if necessary
+#2{\begin{array}{l}\docsvlist{#3}\end{array}}%
+#4\PrecWrite\pres@rbrack}
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
-%<*package>
\define@key{mii}{nobrackets}[yes]{\def\pres@p@key{\pres@infty}%
\def\pres@pi@key{-\pres@infty}\def\pres@pii@key{-\pres@infty}}
\define@key{mii}{lbrack}{\def\pres@lbrack@key{#1}}
@@ -890,130 +746,57 @@ DefConstructor('\@mixfixa OptionalKeyVals:mi {}{}{}{}',
\define@key{mii}{pii}{\def\pres@pii@key{#1}}
\def\prep@keys@mii{\prep@keys@mi%
\edef\pres@pii{\@ifundefined{pres@pii@key}\pres@p\pres@pii@key}}
-%</package>
-%<*ltxml>
-DefKeyVal('mii','lbrack','Semiverbatim');
-DefKeyVal('mii','rbrack','Semiverbatim');
-DefKeyVal('mii','p','Semiverbatim');
-DefKeyVal('mii','pi','Semiverbatim');
-DefKeyVal('mii','pii','Semiverbatim');
-DefKeyVal('mii','cd','Semiverbatim');
-DefKeyVal('mii','name','Semiverbatim');
-DefKeyVal('mii','nobrackets','Semiverbatim');
-%</ltxml>
% \end{macrocode}
%
% \begin{macro}{\mixfixii}
% \begin{macrocode}
-%<*package>
-\newcommand{\mixfixii}[6][]%key, pre, arg1, mid, arg2, post
+\newcommand\mixfixii[6][]%key, pre, arg1, mid, arg2, post
{\clearkeys\setkeys{mii}{#1}\prep@keys@mii%
\PrecWrite\pres@lbrack% write bracket if necessary
#2{\edef\pres@current@precedence{\pres@pi}#3}%
#4{\edef\pres@current@precedence{\pres@pii}#5}#6%
\PrecWrite\pres@rbrack}
-%</package>
-%<*ltxml>
-DefMacro('\mixfixii[]{}{}{}{}{}',
- '\@mixfixii[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}'
- . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}'
- . '{\ensuremath{\crossrefOp[fun]{#6}}}');
-DefConstructor('\@mixfixii OptionalKeyVals:mi {}{}{}{}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') "
- . "argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "<m:mo egroup='fence' fence='true'>(</m:mo>"
- . "#2 #3 #4 #5 #6"
- . "<m:mo egroup='fence' fence='true'>)</m:mo>"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub { applyPrecedencePreferences(@_);},
- properties=>sub { getSymmdefProperties($_[1]); });#$
-%</ltxml>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mixfixia}
% \begin{macrocode}
-%<*package>
-\newcommand{\mixfixia}[7][]%key, pre, arg1, mid, arg2, post, assocop
+\newcommand\mixfixia[7][]%key, pre, arg1, mid, arg2, post, assocop
{\clearkeys\setkeys{mii}{#1}\prep@keys@mii%
\PrecWrite\pres@lbrack% write bracket if necessary
#2{\edef\pres@current@precedence{\pres@pi}#3}%
#4{\@assoc\pres@pii{#7}{#5}}#6%
\PrecWrite\pres@rbrack}
-%</package>
-%<*ltxml>
-DefMacro('\mixfixia[]{}{}{}{}{}{}',
- '\@mixfixia[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}'
- . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}'
- . '{\ensuremath{\crossrefOp[fun]{#6}}}'
- . '{\ensuremath{\crossrefOp[fun]{#7}}}');
-DefConstructor('\@mixfixia OptionalKeyVals:mii {}{}{}{}{}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') "
- . " argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "<m:mo egroup='fence' fence='true'>(</m:mo>"
- . "#2 #3 #4"
- . "<omdoc:iterate name='args' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>"
- . "<omdoc:separator>#7</omdoc:separator>"
- . "<omdoc:render name='arg' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>"
- . "</omdoc:iterate>"
- . "#6"
- . "<m:mo egroup='fence' fence='true'>)</m:mo>"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub { applyPrecedencePreferences(@_);},
- properties=>sub { getSymmdefProperties($_[1]); });#$
-%</ltxml>
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\mixfixiA}
+% A variant of |\mixfixia| that puts the arguments into an array.\ednote{MK: this is very
+% experimental now, if this works, we need to document this above and extend this to the
+% other mixfix declarations. Also we could use a key for the array format argument.}
+% \begin{macrocode}
+\newcommand\mixfixiA[7][]%key, pre, arg1, mid, arg2, post, assocop
+{\clearkeys\setkeys{mii}{#1}\prep@keys@mii%
+\renewcommand\do[1]{\@assoc\pres@pi{#7}{##1}{#7}\tabularnewline}%
+\PrecWrite\pres@lbrack% write bracket if necessary
+#2{\edef\pres@current@precedence{\pres@pi}#3}%
+#4{\begin{array}{l}\docsvlist{#5}\end{array}}#6%
+\PrecWrite\pres@rbrack}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\mixfixai}
% \begin{macrocode}
-%<*package>
-\newcommand{\mixfixai}[7][]%key, pre, arg1, mid, arg2, post, assocop
+\newcommand\mixfixai[7][]%key, pre, arg1, mid, arg2, post, assocop
{\clearkeys\setkeys{mii}{#1}\prep@keys@mii%
\PrecWrite\pres@lbrack% write bracket if necessary
#2{\@assoc\pres@pi{#7}{#3}}%
#4{\edef\pres@current@precedence{\pres@pii}#5}#6%
\PrecWrite\pres@rbrack}
-%</package>
-%<*ltxml>
-DefMacro('\mixfixai[]{}{}{}{}{}{}',
- '\@mixfixai[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}'
- .'{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}'
- .'{\ensuremath{\crossrefOp[fun]{#6}}}'
- .'{\ensuremath{\crossrefOp[fun]{#7}}}');
-DefConstructor('\@mixfixai OptionalKeyVals:mi {}{}{}{}{}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') "
- . " argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "<m:mo egroup='fence' fence='true'>(</m:mo>"
- . "#2"
- . "<omdoc:iterate name='args' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>"
- . "<omdoc:separator>#7</omdoc:separator>"
- . "<omdoc:render name='arg' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>"
- . "</omdoc:iterate>"
- . "#4 #5 #6"
- . "<m:mo egroup='fence' fence='true'>)</m:mo>"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub { applyPrecedencePreferences(@_);},
- properties=>sub { getSymmdefProperties($_[1]); });#$
-%</ltxml>
% \end{macrocode}
% \end{macro}
%
% \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}
@@ -1026,250 +809,70 @@ DefConstructor('\@mixfixai OptionalKeyVals:mi {}{}{}{}{}{}',
\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}}}
-%</package>
-%<*ltxml>
-DefKeyVal('miii','lbrack','Semiverbatim');
-DefKeyVal('miii','rbrack','Semiverbatim');
-DefKeyVal('miii','p','Semiverbatim');
-DefKeyVal('miii','pi','Semiverbatim');
-DefKeyVal('miii','pii','Semiverbatim');
-DefKeyVal('miii','piii','Semiverbatim');
-DefKeyVal('miii','cd','Semiverbatim');
-DefKeyVal('miii','name','Semiverbatim');
-DefKeyVal('miii','nobrackets','Semiverbatim');
-%</ltxml>
% \end{macrocode}
%
% \begin{macro}{\mixfixiii}
% \begin{macrocode}
-%<*package>
-\newcommand{\mixfixiii}[8][]%key, pre, arg1, mid1, arg2, mid2, arg3, post
+\newcommand\mixfixiii[8][]%key, pre, arg1, mid1, arg2, mid2, arg3, post
{\clearkeys\setkeys{miii}{#1}\prep@keys@miii%
\PrecWrite\pres@lbrack% write bracket if necessary
#2{\edef\pres@current@precedence{\pres@pi}#3}%
#4{\edef\pres@current@precedence{\pres@pii}#5}%
#6{\edef\pres@current@precedence{\pres@pii}#7}#8%
\PrecWrite\pres@rbrack}
-%</package>
-%<*ltxml>
-DefMacro('\mixfixiii[]{}{}{}{}{}{}{}',
- '\@mixfixiii[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}'
- . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}'
- . '{\ensuremath{\crossrefOp[fun]{#6}}}{\ensuremath{#7 }}'
- . '{\ensuremath{\crossrefOp[fun]{#8}}}');
-DefConstructor('\@mixfixiii OptionalKeyVals:mi {}{}{}{}{}{}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') "
- . " argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "<m:mo egroup='fence' fence='true'>(</m:mo>"
- . "#2 #3 #4 #5 #6 #7 #8"
- . "<m:mo egroup='fence' fence='true'>)</m:mo>"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub { applyPrecedencePreferences(@_);},
- properties=>sub { getSymmdefProperties($_[1]); });#$
-%</ltxml>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mixfixaii}
% \begin{macrocode}
-%<*package>
-\newcommand{\mixfixaii}[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post, sep
+\newcommand\mixfixaii[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post, sep
{\clearkeys\setkeys{miii}{#1}\prep@keys@miii%
\PrecWrite\pres@lbrack% write bracket if necessary
#2{\@assoc\pres@pi{#9}{#3}}%
#4{\edef\pres@current@precedence{\pres@pii}#5}%
#6{\edef\pres@current@precedence{\pres@pii}#7}#8%
\PrecWrite\pres@rbrack}
-%</package>
-%<*ltxml>
-DefMacro('\mixfixaii[]{}{}{}{}{}{}{}{}',
- '\@mixfixaii[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}'
- . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}'
- . '{\ensuremath{\crossrefOp[fun]{#6}}}{\ensuremath{#7 }}'
- . '{\ensuremath{\crossrefOp[fun]{#8}}}'
- . '{\ensuremath{\crossrefOp[fun]{#9}}}');
-DefConstructor('\@mixfixaii OptionalKeyVals:mi {}{}{}{}{}{}{}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') "
- . " argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "<m:mo egroup='fence' fence='true'>(</m:mo>"
- . "#2"
- . "<omdoc:iterate name='args' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>"
- . "<omdoc:separator>#9</omdoc:separator>"
- . "<omdoc:render name='arg' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>"
- . "</omdoc:iterate>"
- . "#4 #5 #6 #7 #8"
- . "<m:mo egroup='fence' fence='true'>)</m:mo>"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub { applyPrecedencePreferences(@_);},
- properties=>sub { getSymmdefProperties($_[1]); });#$
-%</ltxml>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mixfixiai}
% \begin{macrocode}
-%<*package>
-\newcommand{\mixfixiai}[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post, assocop
+\newcommand\mixfixiai[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post, assocop
{\clearkeys\setkeys{miii}{#1}\prep@keys@miii%
\PrecWrite\pres@lbrack% write bracket if necessary
#2{\edef\pres@current@precedence{\pres@pi}#3}%
#4{\@assoc\pres@pi{#9}{#5}}%
#6{\edef\pres@current@precedence{\pres@pii}#7}#8%
\PrecWrite\pres@rbrack}
-%</package>
-%<*ltxml>
-DefMacro('\mixfixiai[]{}{}{}{}{}{}{}{}',
- '\@mixfixiai[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}'
- . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}'
- . '{\ensuremath{\crossrefOp[fun]{#6}}}{\ensuremath{#7 }}'
- . '{\ensuremath{\crossrefOp[fun]{#8}}}'
- . '{\ensuremath{\crossrefOp[fun]{#9}}}');
-DefConstructor('\@mixfixiai OptionalKeyVals:mi {}{}{}{}{}{}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') "
- . " argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "<m:mo egroup='fence' fence='true'>(</m:mo>"
- . "#2 #3 #4"
- . "<omdoc:iterate name='args' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>"
- . "<omdoc:separator>#9</omdoc:separator>"
- . "<omdoc:render name='arg' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>"
- . "</omdoc:iterate>"
- . "#6 #7 #8"
- . "<m:mo egroup='fence' fence='true'>)</m:mo>"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub { applyPrecedencePreferences(@_);},
- properties=>sub { getSymmdefProperties($_[1]); });#$
-%</ltxml>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mixfixiia}
% \begin{macrocode}
-%<*package>
-\newcommand{\mixfixiia}[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post,assocop
+\newcommand\mixfixiia[9][]%key, pre, arg1, mid1, arg2, mid2, arg3, post,assocop
{\clearkeys\setkeys{miii}{#1}\prep@keys@miii%
\PrecWrite\pres@lbrack% write bracket if necessary
#2{\edef\pres@current@precedence{\pres@pi}#3}%
#4{\edef\pres@current@precedence{\pres@pii}#5}%
#6{\@assoc\pres@pi{#9}{#7}}#8%
\PrecWrite\pres@rbrack}
-%</package>
-%<*ltxml>
-DefMacro('\mixfixiia[]{}{}{}{}{}{}{}{}',
- '\@mixfixiia[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}'
- . '{\ensuremath{\crossrefOp[fun]{#4}}}{\ensuremath{#5 }}'
- . '{\ensuremath{\crossrefOp[fun]{#6}}}{\ensuremath{#7 }}'
- . '{\ensuremath{\crossrefOp[fun]{#8}}}'
- . '{\ensuremath{\crossrefOp[fun]{#9}}}');
-DefConstructor('\@mixfixiia OptionalKeyVals:mi {}{}{}{}{}{}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') "
- . " argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "<m:mo egroup='fence' fence='true'>(</m:mo>"
- . "#2 #3 #4 #5 #6"
- . "<omdoc:iterate name='args' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>"
- . "<omdoc:separator>#9</omdoc:separator>"
- . "<omdoc:render name='arg' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>"
- . "</omdoc:iterate>"
- . "#8"
- . "<m:mo egroup='fence' fence='true'>)</m:mo>"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub { applyPrecedencePreferences(@_);},
- properties=>sub { getSymmdefProperties($_[1]); });#$
-%</ltxml>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\prefixa}
% In prefix we always write the brackets.
% \begin{macrocode}
-%<*package>
-\newcommand{\prefixa}[4][]%keys, fn, arg, sep
-{\prepost@clearkeys\setkeys{prepost}{#1}
-{#2}\pres@lbrack{\@assoc\pres@pi@key{#3}{#4}}\pres@rbrack}
-%</package>
-%<*ltxml>
-DefMacro('\prefixa[]{}{}{}','\@prefixa[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}{\ensuremath{#4 }}');
-DefConstructor('\@prefixa OptionalKeyVals:mi {}{}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') "
- . "argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "#2"
- . "<m:mrow>"
- . "<m:mo fence='true'>(</m:mo>"
- . "<omdoc:iterate name='args' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>"
- . "<omdoc:separator>#4</omdoc:separator>"
- . "<omdoc:render name='arg' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>"
- . "</omdoc:iterate>"
- . "<m:mo fence='true'>)</m:mo>"
- . "</m:mrow>"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub {
- #Default argument precedence is -\infty
- my $keyval = $_[1]->getArg(1);
- $keyval->setValue('pi',-1000000) unless ($keyval && defined($keyval->getValue('pi')));
- applyPrecedencePreferences(@_);
- },
- properties=>sub { getSymmdefProperties($_[1]); });
-%</ltxml>
+\newcommand\prefixa[4][]%keys, fn, arg, sep
+{\prepost@clearkeys\setkeys{prepost}{#1}%
+{#2}\pres@lbrack{\@assoc\pres@pi@key{#4}{#3}}\pres@rbrack}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\postfixa}
% \begin{macrocode}
-%<*package>
-\newcommand{\postfixa}[4][]%keys, fn, arg, sep
-{\prepost@clearkeys\setkeys{prepost}{#1}
-\pres@lbrack{\@assoc\pres@pi@key{#3}{#4}}\pres@rbrack{#2}}
-%</package>
-%<*ltxml>
-DefMacro('\postfixa []{}{}{}','\@postfixa[#1]{\ensuremath{\crossrefOp[fun]{#2}}}{\ensuremath{#3 }}{\ensuremath{#4 }}');
-DefConstructor('\@postfixa OptionalKeyVals:mi {}{}{}',
- "<omdoc:rendering "
- . "?&defined(&KeyVal(#1,'p'))(precedence='&KeyVal(#1,'p')') "
- ."argprec='&argument_precedence(#1)'>"
- . "<m:mrow>"
- . "<m:mrow>"
- . "<m:mo fence='true'>(</m:mo>"
- . "<omdoc:iterate name='args' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')>"
- . "<omdoc:separator>#4</omdoc:separator>"
- . "<omdoc:render name='arg' "
- . "?&defined(&KeyVal(#1,'pi'))(precedence='&KeyVal(#1,'pi')')/>"
- . "</omdoc:iterate>"
- . "<m:mo fence='true'>)</m:mo>"
- . "</m:mrow>"
- . "#2"
- . "</m:mrow>"
- ."</omdoc:rendering>",
- afterDigest=>sub {
- #Default argument precedence is -\infty
- my $keyval = $_[1]->getArg(1);
- $keyval->setValue('pi',-1000000) unless ($keyval && defined($keyval->getValue('pi')));
- applyPrecedencePreferences(@_);
- },
- properties=>sub { getSymmdefProperties($_[1]); });
-%</ltxml>
+\newcommand\postfixa[4][]%keys, fn, arg, sep
+{\prepost@clearkeys\setkeys{prepost}{#1}%
+\pres@lbrack{\@assoc\pres@pi@key{#4}{#3}}\pres@rbrack{#2}}
% \end{macrocode}
% \end{macro}
%
@@ -1277,17 +880,13 @@ DefConstructor('\@postfixa OptionalKeyVals:mi {}{}{}',
% |\infix|\ednote{need infixl as well, use counters for precedences here.} is a simple
% special case of |\mixfixii|.
% \begin{macrocode}
-%<ltxml>RawTeX('
-%<*package|ltxml>
-\newcommand{\infix}[4][]{\mixfixii[#1]{}{#3}{#2}{#4}{}}
+\newcommand\infix[4][]{\mixfixii[#1]{}{#3}{#2}{#4}{}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\assoc}
% \begin{macrocode}
-\newcommand{\assoc}[3][]{\mixfixa[#1]{}{#3}{}{#2}}
-%</package|ltxml>
-%<ltxml>');
+\newcommand\assoc[3][]{\mixfixa[#1]{}{#3}{}{#2}}
% \end{macrocode}
% \end{macro}
%
@@ -1298,9 +897,7 @@ DefConstructor('\@postfixa OptionalKeyVals:mi {}{}{}',
% The elision macros are quite simple, a group |foo| is internally represented by a
% macro |foo@egroup|, which we set by a |\gdef|.
% \begin{macrocode}
-%<*package>
\def\setegroup#1#2{\expandafter\def\csname #1@egroup\endcsname{#2}}
-%</package>
% \end{macrocode}
% \end{macro}
%
@@ -1310,7 +907,6 @@ DefConstructor('\@postfixa OptionalKeyVals:mi {}{}{}',
% the elision group threshold in the paper.\ednote{do we need to turn this around as
% well?} We test the implementation with Figure~\ref{ex:elision-test}.
% \begin{macrocode}
-%<*package>
\def\elide#1#2#3{\@ifundefined{#1@egroup}%
{\def\@elevel{0}
\PackageError{presentation}{undefined egroup #1, assuming value 0}%
@@ -1318,9 +914,6 @@ DefConstructor('\@postfixa OptionalKeyVals:mi {}{}{}',
been set by \protect\setegroup before, e.g. by \protect\setegroup{an}{0}.}}%
{\edef\@elevel{\csname #1@egroup\endcsname}}%
\ifnum\@elevel>#2\else{#3}\fi}
-%</package>
-%<*ltxml>
-%</ltxml>
% \end{macrocode}
% \end{macro}
%
@@ -1348,13 +941,9 @@ been set by \protect\setegroup before, e.g. by \protect\setegroup{an}{0}.}}%
% defining the internal macro \meta{default}|@edefault| and (if necessary) exporting it
% from the module.
% \begin{macrocode}
-%<*package>
\def\provideEdefault#1#2{\expandafter\def\csname#1@edefault\endcsname{#2}
\@ifundefined{this@module}{}%
{\expandafter\g@addto@macro\this@module{\expandafter\def\csname#1@edefault\endcsname{#2}}}}
-%</package>
-%<*ltxml>
-%</ltxml>
% \end{macrocode}
% \end{macro}
%
@@ -1362,62 +951,75 @@ been set by \protect\setegroup before, e.g. by \protect\setegroup{an}{0}.}}%
% The |\setEdefault| macro just redefines the internal \meta{default}|@edefault| in the
% local group
% \begin{macrocode}
-%<*package>
\def\setEdefault#1#2{\expandafter\def\csname #1@edfault\endcsname{#2}}
-%</package>
-%<*ltxml>
-%</ltxml>
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\fromEcontext}
% The |\fromEcontext| macro just calls internal \meta{default}|@edefault| macro.
% \begin{macrocode}
-%<*package>
\def\fromEcontext#1{\csname #1@edefault\endcsname}
-%</package>
-%<*ltxml>
-%</ltxml>
% \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}
+% The |\parray|, |\parrayline| and |\parraycell| macros are simple refactorings of the
+% |array| functionality on the {\LaTeX} side.
%
-% \begin{macro}{\arrayline}
+% \begin{macro}{\parray}
+% \begin{macrocode}
+\newcommand\parray[2]{\begin{array}{#1}#2\end{array}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\parrayline}
% \begin{macrocode}
-%<package>\newcommand{\arrayline}[2]{#1#2\\}
-%<*ltxml>
-DefConstructor('\arrayline{}{}','<ltx:XMRow>#1<ltx:XMCell>#2</ltx:XMCell></ltx:XMRow>');
-%</ltxml>
+\newcommand\parrayline[2]{#1#2\\}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\arraycell}
+% \begin{macro}{\prmatrix}
% \begin{macrocode}
-%<package>\newcommand{\arraycell}[1]{#1&}
-%<*ltxml>
-DefConstructor('\arraycell{}','<ltx:XMCell>#1</ltx:XMCell>');
-%</ltxml>
+\newcommand\prmatrix[1]{\begin{matrix}#1\end{matrix}}
% \end{macrocode}
% \end{macro}
%
-% \subsection{Finale}
+% \begin{macro}{\pmrow}
+% \begin{macrocode}
+\def\pmrow#1{\expandafter\@gobble\x@mrow#1\endx@mrow,}
+\def\x@mrow#1,{&#1\x@mrow}
+\def\endx@mrow#1{\\}
+\def\pmrowh#1{\expandafter\@gobble\x@mrowh#1\endx@mrowh,}
+\def\x@mrowh#1,{&#1\x@mrowh}
+\def\endx@mrowh#1{\\\hline}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Deprecated Functionality}
+%
+% These macros may go away at any time.
%
-% Finally, we need to terminate the file with a success mark for perl.
+% \begin{macro}{\parraylineh}
% \begin{macrocode}
-%<ltxml>1;
+\newcommand\parraylineh[2]{#1#2\\\hline}
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\parraycell}
+% \begin{macrocode}
+\newcommand\parraycell[1]{#1&}
+%</package>
+% \end{macrocode}
+% \end{macro}
+%
% \Finale
\endinput
%
% LocalWords: dtx CPERL RequirePackage keyval lbrack rbrack DefKeyVal omdoc cd
% LocalWords: Semiverbatim DefConstructor OptionalKeyVals pmml ltx XMath mii
% LocalWords: pii miii piii KeyVal egroup namedef attr precs foreach ToString
-% LocalWords: DefMacro stex srcref argprec mrow getSymmdefProperties
+% LocalWords: DefMacro stex srcref argprec mrow getSymmdefProperties funapp
% LocalWords: args arg LaTeX cvar iffalse scsys sc sc mathml openmath latexml
% LocalWords: cmathml activemath twintoo atwin atwintoo texttt fileversion foo
% LocalWords: Deyan Ginev maketitle setcounter tocdepth tableofcontents symdef
@@ -1435,4 +1037,6 @@ DefConstructor('\arraycell{}','<ltx:XMCell>#1</ltx:XMCell>');
% 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
+% LocalWords: arrayline arraycell qquad hrule cmath compactenum omtext smmtf
+% LocalWords: wrongfrac elidability elidable renewcommand tabularnewline
+% LocalWords: docsvlist refactorings