diff options
author | Karl Berry <karl@freefriends.org> | 2020-10-06 22:00:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-10-06 22:00:21 +0000 |
commit | e938e4ed60bd97e22f999fed7003903c0fc40430 (patch) | |
tree | 3c72da4e77188fba29b9e7845aad624bc7200135 | |
parent | a7f0e43317c9507cb7ef6cc1ab2ba7fcdec39af8 (diff) |
semantex (6oct20)
git-svn-id: svn://tug.org/texlive/trunk@56577 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/semantex/semantex.pdf | bin | 357405 -> 316030 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/semantex/semantex.tex | 111 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/semantex/semantex.sty | 35 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/semantex/stripsemantex.sty | 2 |
4 files changed, 83 insertions, 65 deletions
diff --git a/Master/texmf-dist/doc/latex/semantex/semantex.pdf b/Master/texmf-dist/doc/latex/semantex/semantex.pdf Binary files differindex 009f3033c9d..7a311292463 100644 --- a/Master/texmf-dist/doc/latex/semantex/semantex.pdf +++ b/Master/texmf-dist/doc/latex/semantex/semantex.pdf diff --git a/Master/texmf-dist/doc/latex/semantex/semantex.tex b/Master/texmf-dist/doc/latex/semantex/semantex.tex index c1a4a97f73a..37ccd1c3bcb 100644 --- a/Master/texmf-dist/doc/latex/semantex/semantex.tex +++ b/Master/texmf-dist/doc/latex/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/Master/texmf-dist/tex/latex/semantex/semantex.sty b/Master/texmf-dist/tex/latex/semantex/semantex.sty index 82cf996f5a9..84ab00e4709 100644 --- a/Master/texmf-dist/tex/latex/semantex/semantex.sty +++ b/Master/texmf-dist/tex/latex/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/Master/texmf-dist/tex/latex/semantex/stripsemantex.sty b/Master/texmf-dist/tex/latex/semantex/stripsemantex.sty index 679b2ab72c3..221cc7cafe4 100644 --- a/Master/texmf-dist/tex/latex/semantex/stripsemantex.sty +++ b/Master/texmf-dist/tex/latex/semantex/stripsemantex.sty @@ -1,5 +1,5 @@ \RequirePackage{xparse} -\ProvidesExplPackage{stripsemantex}{2020/10/03}{0.45}{} +\ProvidesExplPackage{stripsemantex}{2020/10/06}{0.46}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % |