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