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