summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/semantex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-10-07 03:00:49 +0000
committerNorbert Preining <norbert@preining.info>2020-10-07 03:00:49 +0000
commit6a2f87148a137f5014278229a8175b7babf238cf (patch)
tree9dcfc63f084f80d07d68442a837f468630f71b98 /macros/latex/contrib/semantex
parent2884d8fdd76b2def1d759c76c03141710c219ad7 (diff)
CTAN sync 202010070300
Diffstat (limited to 'macros/latex/contrib/semantex')
-rw-r--r--macros/latex/contrib/semantex/semantex.pdfbin357405 -> 316030 bytes
-rw-r--r--macros/latex/contrib/semantex/semantex.sty35
-rw-r--r--macros/latex/contrib/semantex/semantex.tex111
-rw-r--r--macros/latex/contrib/semantex/stripsemantex.sty2
4 files changed, 83 insertions, 65 deletions
diff --git a/macros/latex/contrib/semantex/semantex.pdf b/macros/latex/contrib/semantex/semantex.pdf
index 009f3033c9..7a31129246 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 82cf996f5a..84ab00e470 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/03}{0.45}{}
+\ProvidesExplPackage{semantex}{2020/10/06}{0.46}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
@@ -1504,7 +1504,6 @@
% #2 = options
\group_begin:
\cs_set:Nn\semantex_this: { #1 }
- \semantex_data_tl_inherit:nn { #1 } { symbol } % Inherit the symbol from parent if not done already
#2 % This is where keys can be set up
\semantex_parse:n { #1 } % Run the "parse" routine, i.e. run the collection of code that the user has added via the key "parseoptions"
\semantex_data_bool_get:nnTF { #1 } { output } % Checks if the register is supposed to output
@@ -1530,7 +1529,8 @@
{
\semantex_data_bool_get:nnTF { #1 } { leftargument } % Checks if left or right argument
{
- \semantex_left_pre_return:n { #1 }
+ \semantex_left_indices_pre_return:n { #1 }
+ \semantex_left_arg_pre_return:n { #1 }
\tl_set:Nx\l__semantex_render_symbol_temp_tl { \semantex_data_tl_get_exp_not:nn { #1 } { symbol } } % Stores the symbol in a temporary command
\tl_set:Nx \l__semantex_render_temp_tl
{
@@ -1564,7 +1564,8 @@
}
}
{
- \semantex_right_pre_return:n { #1 }
+ \semantex_right_indices_pre_return:n { #1 }
+ \semantex_right_arg_pre_return:n { #1 }
\tl_set:Nx\l__semantex_render_symbol_temp_tl { \semantex_data_tl_get_exp_not:nn { #1 } { symbol } } % Stores the symbol in a temporary command
\tl_set:Nx \l__semantex_render_temp_tl
{
@@ -1897,8 +1898,10 @@
% This is an umbrella key that runs all of the three
% return routines, innerreturn, rightreturn, and leftreturn
\semantex_inner_return:n { #1 }
- \semantex_left_return:n { #1 }
- \semantex_right_return:n { #1 }
+ \semantex_left_index_return:n { #1 }
+ \semantex_left_arg_return:n { #1 }
+ \semantex_right_index_return:n { #1 }
+ \semantex_right_arg_return:n { #1 }
}
\cs_new_protected:Npn\semantex_pre_return:n#1
@@ -1909,8 +1912,10 @@
% resetting parameters in this case would just waste
% time.
\semantex_inner_pre_return:n { #1 }
- \semantex_left_pre_return:n { #1 }
- \semantex_right_pre_return:n { #1 }
+ \semantex_left_indices_pre_return:n { #1 }
+ \semantex_left_arg_pre_return:n { #1 }
+ \semantex_right_indices_pre_return:n { #1 }
+ \semantex_right_arg_pre_return:n { #1 }
}
\cs_new_protected:Npn\semantex_inner_return:n#1
@@ -1940,16 +1945,11 @@
\cs_new_protected:Npn\semantex_right_return:n#1
{
+ \semantex_inner_return:n { #1 }
\semantex_right_index_return:n { #1 }
\semantex_right_arg_return:n { #1 }
}
-\cs_new_protected:Npn\semantex_right_pre_return:n#1
-{
- \semantex_right_indices_pre_return:n { #1 }
- \semantex_right_arg_pre_return:n { #1 }
-}
-
\cs_new_protected:Npn\semantex_right_index_return:n#1
{
\semantex_right_indices_pre_return:n { #1 }
@@ -2010,16 +2010,11 @@
\cs_new_protected:Npn\semantex_left_return:n#1
{
+ \semantex_inner_return:n { #1 }
\semantex_left_index_return:n { #1 }
\semantex_left_arg_return:n { #1 }
}
-\cs_new_protected:Npn\semantex_left_pre_return:n#1
-{
- \semantex_left_indices_pre_return:n { #1 }
- \semantex_left_arg_pre_return:n { #1 }
-}
-
\cs_new_protected:Npn\semantex_left_index_return:n#1
{
\semantex_left_indices_pre_return:n { #1 }
diff --git a/macros/latex/contrib/semantex/semantex.tex b/macros/latex/contrib/semantex/semantex.tex
index c1a4a97f73..37ccd1c3bc 100644
--- a/macros/latex/contrib/semantex/semantex.tex
+++ b/macros/latex/contrib/semantex/semantex.tex
@@ -34,11 +34,15 @@
\usepackage[english=american]{csquotes}
-\usepackage[hidelinks]{hyperref}
+%\usepackage[hidelinks]{hyperref}
+\newcommand\hypersetup[1]{}
+\newcommand\href[2]{\texttt{#2}}
+\newcommand\url[1]{\texttt{#1}}
+\newcommand\texorpdfstring[2]{#1}
\usepackage[nameinlink]{cleveref}
-\title{Seman\!\TeX: semantic, keyval-based mathematics (v0.45)}
+\title{Seman\!\TeX: semantic, keyval-based mathematics (v0.46)}
\date{\today}
\author{Sebastian Ørsted (\href{mailto:sorsted@gmail.com}{sorsted@gmail.com})}
@@ -249,7 +253,7 @@ Still, suggestions, ideas, and bug reports are more than welcome!
},
definekeys[1]={
{der}{upper={ (#1) } },
- {res}{ rightreturn ,symbolputright={|}, lower={#1} },
+ {res}{ rightreturn, symbolputright={|}, lower={#1} },
{stalk}{seplower={#1}},
% "seplower" means "separator + lower", i.e. lower index
% separated from any previous lower index by a separator,
@@ -681,7 +685,7 @@ $\vh[\va,\vb,inv]$
\end{LTXexample}
Other keys might need to take one value.
-For defining these, we use the key~\lstinline!definekeys[1]!.
+For defining these, we use a different key, \lstinline!definekeys[1]!.
For instance, suppose we want a command for deriving a function \( n \)~times.
For this, we add the key~\lstinline!der!:
\begin{lstlisting}
@@ -1178,15 +1182,39 @@ For instance, if you want to comjugate the inverse of a function, the following
\begin{LTXexample}
$\vf[inv,conj]$
\end{LTXexample}
-Therefore, there is a command \lstinline!return! that can be applied at any point to invoke the routine of adding all indices and commands to the symbol. Let us try it out:
+Therefore, there is a key, called \lstinline!return!, that can be applied at any point to invoke the routine of adding all current commands, indices, and arguments to the symbol. Let us try it out:
\begin{LTXexample}
$\vf[inv,return,conj]$
\end{LTXexample}
-In fact, \lstinline!return! is an umbrella key that invokes three different return routines: \lstinline!leftreturn!, \lstinline!innerreturn!, and \lstinline!rightreturn!. The command \lstinline!leftreturn! adds the left indices to the symbol (we have not discussed left indices yet, though). The command \lstinline!innerreturn! adds all commands to the symbol (those defined using the \lstinline!command!~key).
-Finally, \lstinline!rightreturn! adds all right indices and arguments to the symbol.
-There is also a collection of partial return routines that add either the indices or the argument to the symbol.
-See~\cref{sec:fundamental_keys} for an overview of these.
-In general, most of the time, the user should probably be satisfied with just using~\lstinline!return!.
+Before we invoked~\lstinline!return!, the symbol was~\lstinline!f!, and the~\lstinline!-1! was stored as an upper index.
+But after the \lstinline!return! routine, the symbol is~\lstinline!f^{-1}!, and consequently, when we apply the~\lstinline!conj! key, you add a line above the whole thing.
+
+There are some cases when you do not want to add all commands, indices, and arguments to the symbol at the same time.
+Therefore, there exist a few extra, partial \lstinline!return! keys that only add some of them to the symbol and save the rest of later.
+We list the most important ones here and refer to~\cref{sec:fundamental_keys} for the remaining ones.
+Most users will probably only ever need the keys \lstinline!return! and~\lstinline!rightreturn!.
+\begin{itemize}
+ \item
+ \mylst!return!
+
+ Invokes the return routine, i.e.\ adds all commands, indices, and arguments to the symbol, if any such exist.
+
+ \item
+ \mylst!innerreturn!
+
+ Invokes the inner return routine, i.e.\ adds all commands to the symbol, if any such exist.
+
+ \item
+ \mylst!rightreturn!
+
+ Invokes the right return routine, i.e.\ adds all commands, right indices, and right arguments to the symbol, if any such exist.
+
+ \item
+ \mylst!leftreturn!
+
+ Invokes the left return routine, i.e.\ adds all commands, left indices, and left arguments to the symbol, if any such exist.
+\end{itemize}
+
\section{Keyval syntax conflicts}
@@ -1648,22 +1676,18 @@ This can be done the following way:
\SetupClass\MyVar{
definekeys[1]={
{Lder} {
- innerreturn,leftreturn,
- symbolputleft=\mathbb{L}^{#1},
+ leftreturn, symbolputleft=\mathbb{L}^{#1},
},
{Rder} {
- innerreturn,leftreturn,
- symbolputleft=\mathbb{R}^{#1},
+ leftreturn, symbolputleft=\mathbb{R}^{#1},
},
},
definekeys={
{Lder} {
- innerreturn,leftreturn,
- symbolputleft=\mathbb{L},
+ leftreturn, symbolputleft=\mathbb{L},
},
{Rder} {
- innerreturn,leftreturn,
- symbolputleft=\mathbb{R},
+ leftreturn, symbolputleft=\mathbb{R},
},
},
}
@@ -1671,22 +1695,18 @@ This can be done the following way:
\SetupClass\MyVar{
definekeys[1]={
{Lder} {
- innerreturn,leftreturn,
- symbolputleft=\mathbb{L}^{#1},
+ leftreturn, symbolputleft=\mathbb{L}^{#1},
},
{Rder} {
- innerreturn,leftreturn,
- symbolputleft=\mathbb{R}^{#1},
+ leftreturn, symbolputleft=\mathbb{R}^{#1},
},
},
definekeys={
{Lder} {
- innerreturn,leftreturn,
- symbolputleft=\mathbb{L},
+ leftreturn, symbolputleft=\mathbb{L},
},
{Rder} {
- innerreturn,leftreturn,
- symbolputleft=\mathbb{R},
+ leftreturn, symbolputleft=\mathbb{R},
},
},
}
@@ -1798,7 +1818,10 @@ $ \leftindex^* {A} $,
$ \leftindex[P]^* {A} $
\end{LTXexample}
We refer to the manual of the package \pack{leftindex} for details,
-see~\url{https://ctan.org/pkg/leftindex}.
+see
+\begin{center}
+ \url{https://ctan.org/pkg/leftindex}
+\end{center}
Our solution for left indices in \semantex is based directly on the one
from \pack{leftindex}. However, it works much better if you use \semantex
@@ -3365,52 +3388,52 @@ In the following sections, we include the full list.
\item
\mylst!return!
- Invokes the return routine.
+ Invokes the return routine, i.e.\ adds all commands, indices, and arguments to the symbol, if any such exist.
\item
- \mylst!leftreturn!
-
- Invokes the left return routine.
+ \mylst!innerreturn!
+ Invokes the inner return routine, i.e.\ adds all commands to the symbol, if any such exist.
+
\item
\mylst!rightreturn!
- Invokes the right return routine.
-
+ Invokes the right return routine, i.e.\ adds all commands, right indices, and right arguments to the symbol, if any such exist.
+
\item
- \mylst!innerreturn!
+ \mylst!leftreturn!
- Invokes the inner return routine.
+ Invokes the left return routine, i.e.\ adds all commands, left indices, and left arguments to the symbol, if any such exist.
\item
\mylst!leftindexreturn!
- Adds the left indices to the symbol, but not the left argument, if any such exists.
+ Adds the left indices to the symbol, if any such exists.
\item
\mylst!rightindexreturn!
- Adds the right indices to the symbol, but not the right argument, if any such exists.
+ Adds the right indices to the symbol, if any such exists.
\item
\mylst!indexreturn!
- Adds all indices to the symbol, left and right, but not the argument, if any such exists.
+ Adds all indices, left and right to the symbol, if any such exists.
\item
\mylst!leftargreturn!
- Adds the left argument, if any such exists, to the symbol, otherwise does nothing.
+ Adds the left argument, if any such exists, to the symbol.
\item
\mylst!rightargreturn!
- Adds the right argument, if any such exists, to the symbol, otherwise does nothing.
+ Adds the right argument, if any such exists, to the symbol.
\item
\mylst!argreturn!
- Adds the argument, if any such exists, to the symbol, otherwise does nothing.
+ Adds the argument, if any such exists, to the symbol.
\item
\mylst!output={$\<Class\>$}!
@@ -3636,7 +3659,7 @@ In the following sections, we include the full list.
\mylst!Otherspar={$\<left parenthesis\>$}{$\<right parenthesis\>$}{$\values\<normal|auto|*|{\textit{other}}\>$}!
Invokes the \lstinline!spar! routine, but with the assigned parentheses and size.
- Here,~\lstinline!normal! means normal size
+ Here, \lstinline!normal! means normal size
parentheses,
\lstinline!auto! and~\lstinline!*!
mean auto-scaled parentheses using~\lstinline!\left...\right!.
@@ -5207,8 +5230,8 @@ The following commands are available for programming inside keys, including \lst
\item
\mylst!\SemantexThis!
- Returns the name of the current class or object. The name is stored in the form \mylst!object_$\<name of object without backslash\>$!
- or~\mylst!class_$\<name of class without backslash\>$!,
+ Returns the name of the current class or object. It is returned in the format \mylst!object_$\<name of object without backslash\>$!
+ and \mylst!class_$\<name of class without backslash\>$!,
which is the way the names are stored internally.
\item
diff --git a/macros/latex/contrib/semantex/stripsemantex.sty b/macros/latex/contrib/semantex/stripsemantex.sty
index 679b2ab72c..221cc7cafe 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/03}{0.45}{}
+\ProvidesExplPackage{stripsemantex}{2020/10/06}{0.46}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %