diff options
Diffstat (limited to 'macros/latex/contrib/semantex/semantex.tex')
-rw-r--r-- | macros/latex/contrib/semantex/semantex.tex | 43 |
1 files changed, 33 insertions, 10 deletions
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!. |