summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/stex/modules
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-11-12 00:31:31 +0000
committerKarl Berry <karl@freefriends.org>2010-11-12 00:31:31 +0000
commit70e387eb63ce4723858c48592208e193dec294f3 (patch)
tree61ec42df871a70687151ed4a6d1bc6a5c81dc53c /Master/texmf-dist/tex/latex/stex/modules
parent2cee8f6dcf8e9596b5cfe9d1f3e55c61b261a320 (diff)
stex 0.9.3 (11nov10)
git-svn-id: svn://tug.org/texlive/trunk@20410 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/stex/modules')
-rw-r--r--Master/texmf-dist/tex/latex/stex/modules/modules.sty20
-rw-r--r--Master/texmf-dist/tex/latex/stex/modules/modules.sty.ltxml11
2 files changed, 21 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/stex/modules/modules.sty b/Master/texmf-dist/tex/latex/stex/modules/modules.sty
index 2e11bb955ad..4a422b69cc9 100644
--- a/Master/texmf-dist/tex/latex/stex/modules/modules.sty
+++ b/Master/texmf-dist/tex/latex/stex/modules/modules.sty
@@ -8,6 +8,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{modules}[2010/06/25 v1.0 Semantic Markup]
+\DeclareOption{showmeta}{\PassOptionsToPackage{\CurrentOption}{metakeys}}
\newif\ifmod@show\mod@showfalse
\DeclareOption{show}{\mod@showtrue}
\newif\ifmod@qualified\mod@qualifiedfalse
@@ -78,15 +79,19 @@
{\expandafter\def\csname#2atqualified\endcsname{\csname modules@#2@pres@qualified\endcsname}}%
\fi%
}\fi}
+\define@key{DefMathOp}{name}{\def\defmathop@name{#1}}
+\newcommand\DefMathOp[2][]{%
+\setkeys{DefMathOp}{#1}%
+\symdef[#1]{\defmathop@name}{#2}}
\def\resymdef{\@ifnextchar[{\@resymdef}{\@resymdef[]}}
\def\@resymdef[#1]#2{\@ifnextchar[{\@@resymdef[#1]{#2}}{\@@resymdef[#1]{#2}[0]}}
\def\@@resymdef[#1]#2[#3]#4{\expandafter\renewcommand\csname modules@#2@pres\endcsname[#3]{#4}}
\let\abbrdef\symdef
\def\mod@path{}
\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%
@@ -191,18 +196,19 @@
\else\input{\mod@savedprefix}%
\fi}}
\let\sinputref=\sinput
+\let\inputref=\input
\def\requirepackage#1#2{\makeatletter\input{#1.sty}\makeatother}
\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}%
diff --git a/Master/texmf-dist/tex/latex/stex/modules/modules.sty.ltxml b/Master/texmf-dist/tex/latex/stex/modules/modules.sty.ltxml
index 39d1584c14b..d8689c4a7b9 100644
--- a/Master/texmf-dist/tex/latex/stex/modules/modules.sty.ltxml
+++ b/Master/texmf-dist/tex/latex/stex/modules/modules.sty.ltxml
@@ -123,7 +123,11 @@ 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);
});
@@ -315,7 +319,7 @@ DefMacro('\defpath{}{}', sub {
my $paths = LookupValue('defpath')||{};
$$paths{"$arg1"}=$arg2;
AssignValue('defpath'=>$paths,'global');
- DefMacro('\\'.$arg1.' {}',$arg2."/#1");
+ DefMacro('\\'.$arg1.' Semiverbatim',$arg2."/#1");
});#$
DefPrimitive('\requiremodules{}', sub {
my($stomach,$module)=@_;
@@ -350,7 +354,8 @@ DefPrimitive('\sinput Semiverbatim', sub {
$GULLET->unread(Invocation(T_CS('\end@requiredmodule'),T_OTHER($module))->unlist);
$GULLET->input($module,['tex']);
return;});#$
-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'/>");
DefMacro('\@symdef@pres OptionalKeyVals:symdef {}[][]{}', sub {
my($self,$keys, $cs,$nargs,$opt,$presentation)=@_;