summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/semantex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-11-06 03:00:45 +0000
committerNorbert Preining <norbert@preining.info>2020-11-06 03:00:45 +0000
commitac4210da60306c356c4f9344b65e1f8345314267 (patch)
tree25bbf0c3801fb3ca91e2832820171be1378573a2 /macros/latex/contrib/semantex
parentb8f26d1a3ca0ba4b66477af6bd2cff2071ddd0fc (diff)
CTAN sync 202011060300
Diffstat (limited to 'macros/latex/contrib/semantex')
-rw-r--r--macros/latex/contrib/semantex/semantex.pdfbin364165 -> 364816 bytes
-rw-r--r--macros/latex/contrib/semantex/semantex.sty28
-rw-r--r--macros/latex/contrib/semantex/semantex.tex43
-rw-r--r--macros/latex/contrib/semantex/stripsemantex.sty2
4 files changed, 49 insertions, 24 deletions
diff --git a/macros/latex/contrib/semantex/semantex.pdf b/macros/latex/contrib/semantex/semantex.pdf
index 766ee64717..9fa36eaa21 100644
--- a/macros/latex/contrib/semantex/semantex.pdf
+++ b/macros/latex/contrib/semantex/semantex.pdf
Binary files differ
diff --git a/macros/latex/contrib/semantex/semantex.sty b/macros/latex/contrib/semantex/semantex.sty
index b42e5d7976..7346d026b0 100644
--- a/macros/latex/contrib/semantex/semantex.sty
+++ b/macros/latex/contrib/semantex/semantex.sty
@@ -1,5 +1,5 @@
\RequirePackage{xparse,l3keys2e,leftindex,semtex}
-\ProvidesExplPackage{semantex}{2020/10/30}{0.462}{}
+\ProvidesExplPackage{semantex}{2020/11/05}{0.463}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
@@ -5734,8 +5734,10 @@
{argreturn}{ execute={ \semantex_arg_return:n { ##1 } } },
{parse}{ execute={ \semantex_parse:n { ##1 } } },
{clearcommand}{ execute={ \semantex_data_seq_clear:nn { ##1 } { commands_sequence } } },
- {...}{sepidots},
- {-}{sepislot},
+ {dots}{sepidots},
+ {...}{dots},
+ {slot}{sepislot},
+ {-}{slot},
{*}{sepd*},
{**}{sepd**},
},
@@ -5799,7 +5801,7 @@
{argwithoutkeyvalset}{ execute={ \semantex_arg_without_keyval:nn { ##1 } { #1 } } },
{setargwithoutkeyvalx}{ execute={ \semantex_arg_without_keyval:nx { ##1 } { #1 } } },
{argwithoutkeyvalsetx}{ execute={ \semantex_arg_without_keyval:nx { ##1 } { #1 } } },
- {prearg}{ execute={ \semantex_data_tl_put_left:nnn { ##1 } { prearg } { #1 } } },
+ {prearg}{ execute={ \semantex_data_tl_put_right:nnn { ##1 } { prearg } { #1 } } },
{postarg}{ execute={ \semantex_data_tl_put_left:nnn { ##1 } { postarg } { #1 } } },
{setargsep}{ execute={ \semantex_data_tl_set:nnn { ##1 } { argsep } { #1 } } },
{setargslot}{ execute={ \semantex_data_tl_set:nnn { ##1 } { argslot } { #1 } } },
@@ -5937,7 +5939,7 @@
% Accents, primes, bullets, etc.:
definekeys={
{smash}{command=\smash},
- {prime}{upper={\prime}},
+ {prime}{upper={\prime},nextupperwithsep=false},
{'}{prime},
{''}{prime,prime},
{'''}{prime,prime,prime},
@@ -6029,14 +6031,14 @@
{preupper}{
execute={
\tl_if_blank:nF{#1}{
- \semantex_data_tl_put_left:nnn { ##1 } { preupper } { #1 }
+ \semantex_data_tl_put_right:nnn { ##1 } { preupper } { #1 }
}
},
},
{postupper}{
execute={
\tl_if_blank:nF{#1}{
- \semantex_data_tl_put_right:nnn { ##1 } { postupper } { #1 }
+ \semantex_data_tl_put_left:nnn { ##1 } { postupper } { #1 }
}
},
},
@@ -6213,14 +6215,14 @@
{prelower}{
execute={
\tl_if_blank:nF{#1}{
- \semantex_data_tl_put_left:nnn { ##1 } { prelower } { #1 }
+ \semantex_data_tl_put_right:nnn { ##1 } { prelower } { #1 }
}
},
},
{postlower}{
execute={
\tl_if_blank:nF{#1}{
- \semantex_data_tl_put_right:nnn { ##1 } { postlower } { #1 }
+ \semantex_data_tl_put_left:nnn { ##1 } { postlower } { #1 }
}
},
},
@@ -6397,14 +6399,14 @@
{preupperleft}{
execute={
\tl_if_blank:nF{#1}{
- \semantex_data_tl_put_left:nnn { ##1 } { preupperleft } { #1 }
+ \semantex_data_tl_put_right:nnn { ##1 } { preupperleft } { #1 }
}
},
},
{postupperleft}{
execute={
\tl_if_blank:nF{#1}{
- \semantex_data_tl_put_right:nnn { ##1 } { postupperleft } { #1 }
+ \semantex_data_tl_put_left:nnn { ##1 } { postupperleft } { #1 }
}
},
},
@@ -6581,14 +6583,14 @@
{prelowerleft}{
execute={
\tl_if_blank:nF{#1}{
- \semantex_data_tl_put_left:nnn { ##1 } { prelowerleft } { #1 }
+ \semantex_data_tl_put_right:nnn { ##1 } { prelowerleft } { #1 }
}
},
},
{postlowerleft}{
execute={
\tl_if_blank:nF{#1}{
- \semantex_data_tl_put_right:nnn { ##1 } { postlowerleft } { #1 }
+ \semantex_data_tl_put_left:nnn { ##1 } { postlowerleft } { #1 }
}
},
},
diff --git a/macros/latex/contrib/semantex/semantex.tex b/macros/latex/contrib/semantex/semantex.tex
index 75282510c1..ab0d352a62 100644
--- a/macros/latex/contrib/semantex/semantex.tex
+++ b/macros/latex/contrib/semantex/semantex.tex
@@ -42,7 +42,7 @@
\usepackage[nameinlink]{cleveref}
-\title{Seman\!\TeX: semantic, keyval-based mathematics (v0.462)}
+\title{Seman\!\TeX: semantic, keyval-based mathematics (v0.463)}
\date{\today}
\author{Sebastian Ørsted (\href{mailto:sorsted@gmail.com}{sorsted@gmail.com})}
@@ -319,7 +319,8 @@ $ \vh[inverseimage]{\sheafF}[spar,stalk=\vp]
\usepackage{amsmath,semantex}
-\NewVariableClass\MyVar % creates a new class of variables, called "\MyVar"
+\NewVariableClass\MyVar % creates a new class of variables,
+ % called "\MyVar"
% Now we create a couple of variables of the class \MyVar:
\NewObject\MyVar\vf{f}
@@ -1039,7 +1040,7 @@ quotient~\( \vX[projquotient={\vchi}{\vG}] \) of~\( \vX \) with respect to the a
\begin{lstlisting}
\SetupClass\MyVar{
definekeys[2]={
- {projquotient}{ symbolputright={ /\!\!/ _ { #1 } #2 } },
+ {projquotient}{ symbolputright={ /\!\!/_{#1} #2 } },
}
}
\end{lstlisting}
@@ -1947,7 +1948,11 @@ $\vX \fibre[\vY,der] \vX$
\chapter{The \texorpdfstring{\texttt{Delimiter}}{Delimiter} class type}
\NewDelimiterClass\MyDelim[parent=\MyVar]
-\NewObject\MyDelim\norm{\lVert}{\rVert}
+\NewObject\MyDelim\norm{\lVert}{\rVert}[
+ definekeys[1]={
+ {default}{ outputoptions={ default={#1} } },
+ },
+]
\NewObject\MyDelim\inner{\langle}{\rangle}
Delimiters are what they sound like: functions like \( \norm{slot} \) and~\( \inner{slot,slot} \)
@@ -1970,6 +1975,23 @@ $\norm{\va}$,
$\inner{\va,\vb}$,
$\inner{slot,slot}$
\end{LTXexample}
+In the case where you want to use different kinds of
+norms, say \( \norm[2]{slot} \) or~\( \norm[\infty]{slot} \),
+you can use the key~\mylst!outputoptions={$\<options\>$}!.
+This allows you to pass the~\<options\> to the output class
+(in this case,~\lstinline!\MyVar!):
+\begin{lstlisting}
+\SetupObject\norm{
+ definekeys[1]={
+ {default}{ outputoptions={ default={#1} } },
+ },
+}
+\end{lstlisting}
+\begin{LTXexample}
+$\norm{\vx}$,
+$\norm[2]{\vx}$,
+$\norm[\infty]{\vx}$
+\end{LTXexample}
We can also use it for more complicated constructions, like sets.
The following is inspired from the \pack{mathtools} package where a similar construction is created using the commands from that package. My impression is that Lars Madsen is the main mastermind behind the code I use for the \lstinline!\where!~construction:
@@ -2109,7 +2131,7 @@ $\int \vf \wedgeD{\vx[1],
\vx[2],...,\vx[n]}$
\end{LTXexample}
-\chapter{Using \texorpdfstring{Seman\!\TeX}{SemanTeX} in other commands using \texorpdfstring{\texttt{\textbackslash UseClassInCommand}}{\UseClassInCommand}}\label{sec:UseClassInCommand}
+\chapter{Using \texorpdfstring{Seman\!\TeX{}}{SemanTeX} in other commands using \texorpdfstring{\texttt{\textbackslash UseClassInCommand}}{\UseClassInCommand}}\label{sec:UseClassInCommand}
\SemantexRecordObject{\Frac}
\newcommand\Frac[2]{
@@ -3521,12 +3543,12 @@ In the following sections, we include the full list.
Adds a double bullet to the \lstinline!d!-index.
\item
- \mylst!-!
+ \mylst!slot!, \mylst!-!
Adds a slot to the \lstinline!i!-index.
\item
- \mylst!...!
+ \mylst!dots!, \mylst!...!
Adds three dots to the \lstinline!i!-index.
@@ -3562,8 +3584,9 @@ In the following sections, we include the full list.
\mylst!prime!, \mylst!'!, \mylst!''!, \mylst!'''!
Adds one or more primes to the symbol in the upper index.
- Equivalent to \lstinline!upper={\prime}!, \lstinline!upper={\prime\prime}!,
- etc.
+ The first one is equivalent to \lstinline!upper={\prime},nextupperwithsep=false!,
+ and the rest are equivalent to multiple iterations
+ of~\lstinline!prime!.
\end{itemize}
\section{Keys for the argument parentheses}
@@ -5608,7 +5631,7 @@ the programming keys and commands:
\item
\mylst!mathclass!
(token list):
- the \TeX\ character class command that the final output
+ the \TeX\ math class command that the final output
is evnetually wrapped around;
the intended use of this is the \TeX\ commands
\lstinline!\mathord!, \lstinline!\mathop!, \lstinline!\mathbin!, \lstinline!\mathrel!, \lstinline!\mathopen!, \lstinline!\mathclose!, and~\lstinline!\mathpunct!.
diff --git a/macros/latex/contrib/semantex/stripsemantex.sty b/macros/latex/contrib/semantex/stripsemantex.sty
index e2a9b601c8..1a3d69f78e 100644
--- a/macros/latex/contrib/semantex/stripsemantex.sty
+++ b/macros/latex/contrib/semantex/stripsemantex.sty
@@ -1,5 +1,5 @@
\RequirePackage{xparse}
-\ProvidesExplPackage{stripsemantex}{2020/10/30}{0.462}{}
+\ProvidesExplPackage{stripsemantex}{2020/11/05}{0.463}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %