From 86150b021e30a24eeef3151108c04d3f31c3b114 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 5 Nov 2020 22:13:21 +0000 Subject: semantex (5nov20) git-svn-id: svn://tug.org/texlive/trunk@56863 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/semantex/semantex.pdf | Bin 364165 -> 364816 bytes Master/texmf-dist/doc/latex/semantex/semantex.tex | 43 ++++++++++++++++----- Master/texmf-dist/tex/latex/semantex/semantex.sty | 28 +++++++------- .../tex/latex/semantex/stripsemantex.sty | 2 +- 4 files changed, 49 insertions(+), 24 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/semantex/semantex.pdf b/Master/texmf-dist/doc/latex/semantex/semantex.pdf index 766ee647176..9fa36eaa214 100644 Binary files a/Master/texmf-dist/doc/latex/semantex/semantex.pdf and b/Master/texmf-dist/doc/latex/semantex/semantex.pdf differ diff --git a/Master/texmf-dist/doc/latex/semantex/semantex.tex b/Master/texmf-dist/doc/latex/semantex/semantex.tex index 75282510c11..ab0d352a62d 100644 --- a/Master/texmf-dist/doc/latex/semantex/semantex.tex +++ b/Master/texmf-dist/doc/latex/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={$\$}!. +This allows you to pass the~\ 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/Master/texmf-dist/tex/latex/semantex/semantex.sty b/Master/texmf-dist/tex/latex/semantex/semantex.sty index b42e5d7976c..7346d026b07 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/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/Master/texmf-dist/tex/latex/semantex/stripsemantex.sty b/Master/texmf-dist/tex/latex/semantex/stripsemantex.sty index e2a9b601c8a..1a3d69f78ea 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/30}{0.462}{} +\ProvidesExplPackage{stripsemantex}{2020/11/05}{0.463}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % -- cgit v1.2.3