diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/stex/presentation/presentation.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/stex/presentation/presentation.dtx | 143 |
1 files changed, 131 insertions, 12 deletions
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 |