diff options
author | Karl Berry <karl@freefriends.org> | 2021-08-10 21:14:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-08-10 21:14:25 +0000 |
commit | eb0ceeef2244cb2709799c2a9738ba05d53e876d (patch) | |
tree | b02161f7027b3e4e22cd236669ab9f2ff590d6a7 /Master/texmf-dist | |
parent | 568066f46cf194676ba50742e218cb4bcf10ed88 (diff) |
semantex (10aug21)
git-svn-id: svn://tug.org/texlive/trunk@60215 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/semantex/semantex.pdf | bin | 385078 -> 384739 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/semantex/semantex.tex | 154 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/semantex/semantex.sty | 118 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/semantex/stripsemantex.sty | 2 |
4 files changed, 100 insertions, 174 deletions
diff --git a/Master/texmf-dist/doc/latex/semantex/semantex.pdf b/Master/texmf-dist/doc/latex/semantex/semantex.pdf Binary files differindex 9724b2643c5..b397d484450 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 681a51b1b84..563be874be1 100644 --- a/Master/texmf-dist/doc/latex/semantex/semantex.tex +++ b/Master/texmf-dist/doc/latex/semantex/semantex.tex @@ -9,7 +9,7 @@ \frenchspacing -\usepackage{mathtools,etoolbox, microtype,xspace,color} +\usepackage{mathtools,etoolbox, microtype,color} \usepackage[shortlabels]{enumitem}%control lists @@ -42,7 +42,7 @@ \usepackage[nameinlink]{cleveref} -\title{Seman\!\TeX: semantic, keyval-based mathematics (v0.511)} +\title{Seman\!\TeX: semantic, keyval-based mathematics (v0.512)} \date{\today} \author{Sebastian Ørsted (\href{mailto:sorsted@gmail.com}{sorsted@gmail.com})} @@ -93,9 +93,9 @@ \let\pack=\texttt -\newcommand\semantex{Seman\!\TeX\xspace} +\newcommand\semantex{Seman\!\TeX} -\newcommand\stripsemantex{\texttt{stripsemantex}\xspace} +\newcommand\stripsemantex{\texttt{stripsemantex}} \usepackage{hologo} @@ -221,12 +221,12 @@ \maketitle \noindent -The \semantex package for \LaTeX\ delivers a more semantic, systematized way of writing mathematics, compared to the classical math syntax in~\LaTeX. +The \semantex{} package for \LaTeX\ delivers a more semantic, systematized way of writing mathematics, compared to the classical math syntax in~\LaTeX. The system uses keyval syntax, and the user can define their own keys and customize the system down to the last detail. At the same time, care has been taken to make the syntax as simple, natural, practical, and lightweight as possible. Furthermore, the package has a companion package, called \stripsemantex, which allows you to completely strip -your documents of \semantex markup to prepare them e.g.~for publication. +your documents of \semantex{} markup to prepare them e.g.~for publication. The package is still in beta, but is considered feature-complete and more or less stable, so using it at this point should be safe. @@ -264,7 +264,7 @@ Still, suggestions, ideas, and bug reports are more than welcome! to demonstrate the idea of the package: Suppose we want to take the complex conjugate of a function~\( \vf \) and then derive it \( \vn \)~times, i.e.~take~\( \smash{ \vf[conj,der=\vn] } \). - \semantex allows you to typeset this something like this: + \semantex{} allows you to typeset this something like this: \begin{LTXexample} $ \vf[conj,der=\vn] $ \end{LTXexample} @@ -368,7 +368,7 @@ with \begin{lstlisting} \usepackage{semantex} \end{lstlisting} -The \semantex system is object-oriented; all entities are objects of some class. When you load the package, there +The \semantex{} system is object-oriented; all entities are objects of some class. When you load the package, there is only one class by default, which is simply called \lstinline!\SemantexBaseObject!. You should think of this as a low-level class, the parent of all other classes. Therefore, I highly advice against using it directly or modifying it. Instead, we create a new, more high-level variable class. @@ -380,7 +380,7 @@ pass some options to it in~\lstinline![...]!: \NewVariableClass\MyVar[output=\MyVar] \end{lstlisting} This \lstinline!output=\MyVar! option will be explained better below. -Roughly speaking, it tells \semantex that everything +Roughly speaking, it tells \semantex{} that everything a variable \emph{outputs} will also be a variable. For instance, if the function~\lstinline!\vf! (i.e.~\( \vf \)) is of class~\lstinline!\MyVar!, then \lstinline!\vf{\vx}!~(i.e.~\( \vf{\vx} \))~will also be of class~\lstinline!\MyVar!. @@ -413,7 +413,7 @@ Both \<options\> and \<argument\> are optional arguments (they can be left out if you do not need them). The \<options\> should consist of a list of options separated by commas, using keyval syntax. Naturally, \<argument\> is the actual argument of the function. -By a design choice, \semantex does not distinguish between variables and functions, so all variables can take arguments. +By a design choice, \semantex{} does not distinguish between variables and functions, so all variables can take arguments. This makes the system easier to use; after all, it is fairly common in mathematics that something is first a variable and then a moment later takes an argument. So we may write: \begin{LTXexample} @@ -767,7 +767,7 @@ $\vg[1,res=\vY]{\vy}$, $\vh[inv,res=\vT]{\vz}$ \end{LTXexample} -If the reader starts playing around with the \semantex functions, they will discover that whenever you apply a function to something, the result becomes a new function that can take an argument itself (this is why we wrote~\lstinline!output=\MyVar! in the definition of the class~\lstinline!\MyVar!). This behaviour is both useful and extremely necessary in order for the package to be useful in practice. For instance, you may write +If the reader starts playing around with the \semantex{} functions, they will discover that whenever you apply a function to something, the result becomes a new function that can take an argument itself (this is why we wrote~\lstinline!output=\MyVar! in the definition of the class~\lstinline!\MyVar!). This behaviour is both useful and extremely necessary in order for the package to be useful in practice. For instance, you may write \begin{LTXexample} $\vf[der=\vn]{\vx}{\vy}{\vz} =\vg{\vu,\vv,\vw}[3]{ @@ -830,7 +830,7 @@ Let me add that it is possible to create subclasses of existing classes. You jus }, } -Let us try to use \semantex to build some commands +Let us try to use \semantex{} to build some commands for doing algebra. As an algebraist, one of the first things you might want to do is to create polynomial rings~\( \vk[poly]{\vx,\vy,\vz} \). Since all variables can already be used as functions (this is a design choice we discussed earlier), all we need to do is find a way to change from using parentheses to square brackets. This can be done the following way: \begin{lstlisting} @@ -1054,7 +1054,7 @@ $ \vX[proj quotient={\vchi}{\vG}] $ \section{The \texttt{spar} key}\label{sec:spar} -The \lstinline!spar! key is one of the most important commands in \semantex at all. To understand why we need it, imagine you want to derive a function \( \vn \)~times and then invert it. Writing something like +The \lstinline!spar! key is one of the most important commands in \semantex{} at all. To understand why we need it, imagine you want to derive a function \( \vn \)~times and then invert it. Writing something like \begin{LTXexample} $\vf[der=\vn,inv]$ \end{LTXexample} @@ -1331,7 +1331,7 @@ Unfortunately, it only works in~\hologo{LuaTeX}. If you don't know what \hologo{LuaTeX} is, that means that you are not using \hologo{LuaTeX}, and you should note that switching is a rather drastic affair since your existing font settings might very well not work -with \hologo{LuaTeX}. Also, \semantex does not exactly make your document faster, +with \hologo{LuaTeX}. Also, \semantex{} does not exactly make your document faster, and \hologo{LuaTeX} makes it even slower, so think carefully before you make the switch just for this. In any case, with \pack{stricttex}, you will be able to make brackets \enquote{strict}, which means that any \lstinline![! will be replaced @@ -1397,7 +1397,7 @@ we need to be able to typeset comorphisms as well as the one hundred thousand di % sheaf !-pushforward }, } -We have added the command \lstinline!no par! to all pullback and pushforward commands since it is custom to write, say,~\( \vf[sheaf pull]{\sheafF} \) rather than~\( \vf[sheaf pull,par]{\sheafF} \). Of course, you can decide that for yourself, and in any case, you can write~\lstinline!\vf[sheaf pull,par]{\sheafF}! if you want to force it to use parentheses in a particular case. Of course, since all \semantex variables can be used as functions, so can whatever these pullback and pushforward operations output. So we may write: +We have added the command \lstinline!no par! to all pullback and pushforward commands since it is custom to write, say,~\( \vf[sheaf pull]{\sheafF} \) rather than~\( \vf[sheaf pull,par]{\sheafF} \). Of course, you can decide that for yourself, and in any case, you can write~\lstinline!\vf[sheaf pull,par]{\sheafF}! if you want to force it to use parentheses in a particular case. Of course, since all \semantex{} variables can be used as functions, so can whatever these pullback and pushforward operations output. So we may write: \begin{LTXexample} For a morphism~$ \vf \colon \vX \to \vY $ with @@ -1510,7 +1510,7 @@ $\dif{\vx} = 0$ In branches of mathematics such as homological algebra, people have very different opinions about the positions of the gradings. -As an algebraist, I am used to \emph{upper} gradings (\enquote{cohomological} grading), whereas many topologists prefer \emph{lower} gradings (\enquote{homological} grading). The \semantex system +As an algebraist, I am used to \emph{upper} gradings (\enquote{cohomological} grading), whereas many topologists prefer \emph{lower} gradings (\enquote{homological} grading). The \semantex{} system supports both, but the default is upper gradings. You can adjust this by writing \lstinline!grading position=upper! or~\lstinline!grading position=lower!. @@ -1593,7 +1593,7 @@ $\vf[d]$, $\vf[d=]$ \end{LTXexample} As we see, it is only when a \lstinline!d! or~\lstinline!i! key is followed by an equality sign~\lstinline!=! that the actions of these keys are invoked. -In fact, \semantex carefully separates keys taking +In fact, \semantex{} carefully separates keys taking a value from keys taking no values. We can similarly define a command for cohomology: @@ -1814,7 +1814,7 @@ see \url{https://ctan.org/pkg/leftindex} \end{center} -Our solution for left indices in \semantex is based directly on the one +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 than if you just used \pack{leftindex} alone, due to the ability to centrally control all your notation. This allows you to choose height and slanting phantoms once and for all in the preamble and never have to worry about it in your document body. @@ -1855,7 +1855,7 @@ Let us see it in action: } $ \vA[upper left=*] $ \end{LTXexample} -Note that \semantex at least does its best to try to guess +Note that \semantex{} at least does its best to try to guess new height and slanting phantoms when you use operations on objects: \begin{LTXexample} $ \vA[spar=\Bigg,upper left=*] $, @@ -1885,8 +1885,8 @@ $ \vP[command=\overline,return, }, ] -\semantex has facilities for printing tensor products~\( \tensor \) as well as derived tensor products~\( \tensor[der] \). -This is probably the right time to reveal that \semantex supports multiple class \emph{types}. +\semantex{} has facilities for printing tensor products~\( \tensor \) as well as derived tensor products~\( \tensor[der] \). +This is probably the right time to reveal that \semantex{} supports multiple class \emph{types}. So far, we have been exclusively using the \lstinline!Variable! class type, which is what you create when you apply the command~\lstinline!\NewVariableClass!. The first other class type we shall need is the \lstinline!Symbol! class type. @@ -2146,7 +2146,7 @@ do that would be something like Indeed, this will work fine for most people. In fact, the only case where this might cause issues is if you want to use the \pack{stripsemantex} algorithm to strip -your document of \semantex markup. But in order to prepare yourself for this possibility, I recommend getting used from the start to doing it +your document of \semantex{} markup. But in order to prepare yourself for this possibility, I recommend getting used from the start to doing it in a slightly more cumbersome way: \begin{lstlisting} \SemantexRecordObject{\Frac} @@ -2183,19 +2183,19 @@ in the \lstinline!\Frac!~command. Therefore, we do three things: \begin{itemize} \item We register the command~\lstinline!\Frac! - as a \semantex command using the + as a \semantex{} command using the line \begin{lstlisting} \SemantexRecordObject{\Frac} \end{lstlisting} - After this, \semantex \enquote{knows} + After this, \semantex{} \enquote{knows} that \lstinline!\Frac!~is part of the - family of \semantex markup. + family of \semantex{} markup. \item We use the command~\lstinline!\SemantexRecordSource! to \enquote{record} the source of the command internally. This way, \pack{stripsemantex} will know what to look for when it moves through the document, trying to strip - it of \semantex markup. + it of \semantex{} markup. It is therefore important that you record the source exactly like it will be written in the source. @@ -2206,7 +2206,7 @@ Therefore, we do three things: \item We write~\lstinline!\UseClassInCommand\MyVar! instead of just~\lstinline!\MyVar! in order to correctly record the output code internally. Roughly speaking, when you use the command~\lstinline!\UseClassInCommand!, - \semantex \enquote{knows} that the class~\lstinline!\MyVar! + \semantex{} \enquote{knows} that the class~\lstinline!\MyVar! is now used as part of some greater construction. \end{itemize} @@ -2410,7 +2410,7 @@ of other situations, like }, } -As you can see above, \semantex has a \enquote{waterfall-like} behaviour. It runs keys in the order it receives them. This works fine most of the time, but for some more complicated constructions, it is useful to be able to provide a collection of data in any order, +As you can see above, \semantex{} has a \enquote{waterfall-like} behaviour. It runs keys in the order it receives them. This works fine most of the time, but for some more complicated constructions, it is useful to be able to provide a collection of data in any order, and have the system take care of printing them in the right places, according to how you program the object in the preamble. For this purpose, we have the \lstinline!parse!~routine. @@ -2846,12 +2846,12 @@ As you see, we use the \lstinline!d!~key to tell the command what superscript it \chapter{\texorpdfstring{\texttt{stripsemantex}}{stripsemantex} -- stripping your document of \texorpdfstring{\semantex}{SemanTeX} markup} -\semantex is a big, heavy package, and it might raise eyebrows if you try using it in submissions to journals. On top of that, \url{arXiv.org} +\semantex{} is a big, heavy package, and it might raise eyebrows if you try using it in submissions to journals. On top of that, \url{arXiv.org} is using \TeX~Live~2016 at the time of writing this, and it has an old version of \LaTeX3 that seems unable to run \semantex. -To address this issue, \semantex has a companion package, +To address this issue, \semantex{} has a companion package, called \pack{stripsemantex}, which allows you to strip the -\semantex markup from your document and replace it with raw \LaTeX~code. +\semantex{} markup from your document and replace it with raw \LaTeX~code. While no such algorithm will ever be perfect, it generally works very well, even for quite complicated constructions, as long as you use the package in the \enquote{normal} @@ -2863,7 +2863,7 @@ the algorithm: \url{https://arxiv.org/abs/2008.04794}.) The system has the following limitations: \begin{itemize} - \item It is currently only able to strip the \semantex markup from your main document (so it will ignore anything in \lstinline!\input{...}! and~\lstinline!\include{...}!). So prior to running \pack{stripsemantex}, + \item It is currently only able to strip the \semantex{} markup from your main document (so it will ignore anything in \lstinline!\input{...}! and~\lstinline!\include{...}!). So prior to running \pack{stripsemantex}, you should include your entire document body in your main \texttt{.tex}~file. \item Partly because of the previous point, no attempt is made to remove @@ -2871,7 +2871,7 @@ The system has the following limitations: so commands like \lstinline!\NewObject!, \lstinline!\SetupObject!, and~\lstinline!\SetupClass! will remain in the document body. You will then have to remove these yourself afterwards. - But the \semantex markup itself should be stripped completely from your document. + But the \semantex{} markup itself should be stripped completely from your document. \item As mentioned, as long as you do normal, supported things, everything should work fine. Non-normal, non-supported things are tings like @@ -2880,7 +2880,7 @@ The system has the following limitations: \end{lstlisting} \item Things might go wrong if you define new keys between \lstinline!\begin{document}! and~\lstinline!\end{document}! - whose definitions make use of other \semantex objects or classes, + whose definitions make use of other \semantex{} objects or classes, since the algorithm will try to strip these from the definitions. For instance, don't do stuff like this after~\lstinline!\begin{document}!: @@ -2902,7 +2902,7 @@ The system has the following limitations: in order to run. You will be able to replace all of these commands by other commands and then render the package \pack{semtex} unnecessary. More on this in \cref{sec:semtex_package}. - \item When \semantex runs, the content of any argument is being wrapped + \item When \semantex{} runs, the content of any argument is being wrapped between \lstinline!\begingroup! and~\lstinline!\endgroup!. This is part of what makes it possible to use the command~\lstinline!\SemantexDelimiterSize!. However, these \lstinline!\begingroup! and~\lstinline!\endgroup! will not appear @@ -2916,7 +2916,7 @@ $ \def\foo{bar} \va{ \def\foo{barbar} \vx } \foo $ \end{itemize} As a small proof of concept, this is what the example in the introduction -would look like when stripped of \semantex markup: +would look like when stripped of \semantex{} markup: \begin{lstlisting} % Same preamble as before. @@ -2944,8 +2944,8 @@ you can have a look at my latest paper, which was stripped with \section{The \texttt{semtex} package}\label{sec:semtex_package} -When you have stripped your document and removed all \semantex package setup, it should be safe to remove -the loading of \semantex from your preamble. +When you have stripped your document and removed all \semantex{} package setup, it should be safe to remove +the loading of \semantex{} from your preamble. However, the stripping algorithm will automatically add the following lines to your document right before~\lstinline!\begin{document}!: \begin{lstlisting} @@ -2975,7 +2975,7 @@ The package \pack{leftindex} is loaded to take care of any possible left indices. The package~\pack{graphicx} is loaded to provide the command~\lstinline!\scalebox!. This package~\pack{semtex} is a small package whose sole purpose -is to be loaded by stripped \semantex documents. +is to be loaded by stripped \semantex{} documents. All it does is define the four commands \lstinline!\SemantexLeft!, \lstinline!\SemantexRight!, \lstinline!\SemantexBullet!, and~\lstinline!\SemantexDoubleBullet! @@ -3014,7 +3014,7 @@ separate document and compile it with \hologo{LuaTeX}. Suppose in the following that you \TeX\ document is called~\texttt{mydoc.tex}. \begin{enumerate}[(1)] - \item Make sure to collect all of the \semantex markup you want + \item Make sure to collect all of the \semantex{} markup you want stripped in the main document,~\texttt{mydoc.tex}. Also make sure to follow the recommendations in \cref{sec:UseClassInCommand}, in case you have created commands @@ -3028,7 +3028,7 @@ Suppose in the following that you \TeX\ document is called~\texttt{mydoc.tex}. Because of the previous step, there will now be a new file, \texttt{mydoc.semtex}, in your folder, where the raw output - of each \semantex command is stored. In a moment, + of each \semantex{} command is stored. In a moment, \pack{stripsemantex} will use this information to replace each command by the raw code it outputs. \item Create another \TeX\ document in the same folder @@ -3049,7 +3049,7 @@ Suppose in the following that you \TeX\ document is called~\texttt{mydoc.tex}. After this step, another document will have been created in the same folder, called~\lstinline!mydoc_prestripped.tex!. It will look just like \texttt{mydoc.tex}, - but in the document body, each \semantex markup command will now + but in the document body, each \semantex{} markup command will now have a command \mylst!\SemantexIDcommand{$\<a unique ID\>$}! preceding it. @@ -3059,7 +3059,7 @@ Suppose in the following that you \TeX\ document is called~\texttt{mydoc.tex}. \item\label{pt:strip_point} Compile the document~\lstinline!stripdoc.tex! again, this time also \textbf{using \hologo{LuaTeX}}. - \item After the previous step, some (but usually not all) \semantex markup will have been + \item After the previous step, some (but usually not all) \semantex{} markup will have been removed from the file~\lstinline!mydoc_prestripped.tex!. If the stripping algorithm has terminated (which it almost never does after a single run), there will now be a new document in your folder, called~\lstinline!mydoc_stripped.tex!. @@ -3068,16 +3068,16 @@ Suppose in the following that you \TeX\ document is called~\texttt{mydoc.tex}. Continue this way until the file \lstinline!mydoc_stripped.tex! appears. It can easily require three or more iterations, but each iteration will usually be faster than the previous one, and eventually, the file~\lstinline!mydoc_stripped.tex! will appear. (Note that at the point~\ref{pt:strip_point}, \pack{stripsemantex} will also issue a warning if the algorithm has not yet terminated, asking you to repeat the steps \ref{pt:pre_strip_point} and~\ref{pt:strip_point}). - Note again that your \semantex \textbf{setup} + Note again that your \semantex{} \textbf{setup} will not be removed, so there will still be commands like \lstinline!\NewObject!, \lstinline!\SetupObject!, \lstinline!\SetupClass!,~etc. left. You will then have to remove these few commands from your document manually. \end{enumerate} -Apart from the machinery for stripping \semantex markup from documents, +Apart from the machinery for stripping \semantex{} markup from documents, the package \pack{stripsemantex} also provides the command~\lstinline!\StripSemantexStripComments!, -which is in principle completely unrelated to \semantex itself. +which is in principle completely unrelated to \semantex{} itself. This command allows you to strip all comments between \lstinline!\begin{document}! and~\lstinline!\end{document}!. If your document is again called~\lstinline!mydoc.tex!, you can create the following document and compile it \textbf{with \hologo{LuaTeX}}: @@ -3137,7 +3137,7 @@ the keys that can be used inside the command~\lstinline!\SemantexSetup! are: This is mainly relevant when using \lstinline!stripsemantex!. \end{itemize} -Apart from this, \semantex has a large collection of keys that are predefined for the class \lstinline!\SemantexBaseObject!. +Apart from this, \semantex{} has a large collection of keys that are predefined for the class \lstinline!\SemantexBaseObject!. In the following sections, we include the full list. \section{Keys for defining and removing keys} @@ -3599,7 +3599,7 @@ In the following sections, we include the full list. Adds a double bullet to the \lstinline!d!-index. \item - \mylst!slot!, \mylst!-! + \mylst!slot! Adds a slot to the \lstinline!i!-index. @@ -3917,7 +3917,6 @@ In the following sections, we include the full list. argument by the \<separator\>. \item - \mylst!arg - with other sep={$\<separator\>$}!, \mylst!arg slot with other sep={$\<separator\>$}! Adds a slot to the argument, separated from any previous @@ -3938,14 +3937,14 @@ In the following sections, we include the full list. by a comma. \item - \mylst!arg slot!, \mylst!arg -! + \mylst!arg slot! Adds a slot to the argument, separated from any previous arguments by the standard separator. \item - \mylst!comma arg slot!, \mylst!comma arg -! + \mylst!comma arg slot! Adds a slot to the argument, separated from any previous arguments @@ -4030,20 +4029,20 @@ In the following sections, we include the full list. any prevous upper index by~\<separator\>. \item - \mylst!upper -!, \mylst!upper slot! + \mylst!upper slot! Adds a slot to the upper index, with no separator from any previous upper index. \item - \mylst!sep upper -!, \mylst!sep upper slot! + \mylst!sep upper slot! Adds a slot to the upper index, separated from any previous upper index by the default separator. \item - \mylst!comma upper -!, \mylst!comma upper slot! + \mylst!comma upper slot! Adds a slot to the upper index, separated from any previous upper @@ -4056,7 +4055,6 @@ In the following sections, we include the full list. By default, this is~\lstinline!{-}!. \item - \mylst!upper - with other sep={$\<separator\>$}!,\\ \mylst!upper slot with other sep={$\<separator\>$}! @@ -4229,20 +4227,20 @@ In the following sections, we include the full list. any prevous lower index by~\<separator\>. \item - \mylst!lower -!, \mylst!lower slot! + \mylst!lower slot! Adds a slot to the lower index, with no separator from any previous lower index. \item - \mylst!sep lower -!, \mylst!sep lower slot! + \mylst!sep lower slot! Adds a slot to the lower index, separated from any previous lower index by the default separator. \item - \mylst!comma lower -!, \mylst!comma lower slot! + \mylst!comma lower slot! Adds a slot to the lower index, separated from any previous lower @@ -4255,7 +4253,6 @@ In the following sections, we include the full list. By default, this is~\lstinline!{-}!. \item - \mylst!lower - with other sep={$\<separator\>$}!,\\ \mylst!lower slot with other sep={$\<separator\>$}! @@ -4428,20 +4425,20 @@ In the following sections, we include the full list. any prevous upper left index by~\<separator\>. \item - \mylst!upper left -!, \mylst!upper left slot! + \mylst!upper left slot! Adds a slot to the upper left index, with no separator from any previous upper left index. \item - \mylst!sep upper left -!, \mylst!sep upper left slot! + \mylst!sep upper left slot! Adds a slot to the upper left index, separated from any previous upper left index by the default separator. \item - \mylst!comma upper left -!, \mylst!comma upper left slot! + \mylst!comma upper left slot! Adds a slot to the upper left index, separated from any previous upper left @@ -4454,7 +4451,6 @@ In the following sections, we include the full list. By default, this is~\lstinline!{-}!. \item - \mylst!upper left - with other sep={$\<separator\>$}!,\\ \mylst!upper left slot with other sep={$\<separator\>$}! @@ -4627,20 +4623,20 @@ In the following sections, we include the full list. any prevous lower left index by~\<separator\>. \item - \mylst!lower left -!, \mylst!lower left slot! + \mylst!lower left slot! Adds a slot to the lower left index, with no separator from any previous lower left index. \item - \mylst!sep lower left -!, \mylst!sep lower left slot! + \mylst!sep lower left slot! Adds a slot to the lower left index, separated from any previous lower left index by the default separator. \item - \mylst!comma lower left -!, \mylst!comma lower left slot! + \mylst!comma lower left slot! Adds a slot to the lower left index, separated from any previous lower left @@ -4653,7 +4649,6 @@ In the following sections, we include the full list. By default, this is~\lstinline!{-}!. \item - \mylst!lower left - with other sep={$\<separator\>$}!,\\ \mylst!lower left slot with other sep={$\<separator\>$}! @@ -4826,20 +4821,20 @@ In the following sections, we include the full list. any prevous \lstinline!d!-index by~\<separator\>. \item - \mylst!d -!, \mylst!d slot! + \mylst!d slot! Adds a slot to the \lstinline!d!-index, with no separator from any previous \lstinline!d!-index. \item - \mylst!sep d -!, \mylst!sep d slot! + \mylst!sep d slot! Adds a slot to the \lstinline!d!-index, separated from any previous \lstinline!d!-index by the default separator. \item - \mylst!comma d -!, \mylst!comma d slot! + \mylst!comma d slot! Adds a slot to the \lstinline!d!-index, separated from any previous \lstinline!d!-index @@ -4852,7 +4847,6 @@ In the following sections, we include the full list. By default, this is~\lstinline!{-}!. \item - \mylst!d - with other sep={$\<separator\>$}!, \mylst!d slot with other sep={$\<separator\>$}! Adds a slot to the \lstinline!d!-index, separated @@ -5024,20 +5018,20 @@ In the following sections, we include the full list. any prevous \lstinline!i!-index by~\<separator\>. \item - \mylst!i -!, \mylst!i slot! + \mylst!i slot! Adds a slot to the \lstinline!i!-index, with no separator from any previous \lstinline!i!-index. \item - \mylst!sep i -!, \mylst!sep i slot! + \mylst!sep i slot! Adds a slot to the \lstinline!i!-index, separated from any previous \lstinline!i!-index by the default separator. \item - \mylst!comma i -!, \mylst!comma i slot! + \mylst!comma i slot! Adds a slot to the \lstinline!i!-index, separated from any previous \lstinline!i!-index @@ -5050,7 +5044,6 @@ In the following sections, we include the full list. By default, this is~\lstinline!{-}!. \item - \mylst!i - with other sep={$\<separator\>$}!, \mylst!i slot with other sep={$\<separator\>$}! @@ -5275,14 +5268,14 @@ These are the predefined keys that work inside the argument. by a comma. \item - \mylst!-!, \mylst!slot! + \mylst!slot! Adds a slot to the argument, separated from any previous argument by the default separator. \item - \mylst!comma -!, \mylst!comma slot! + \mylst!comma slot! Adds a slot to the argument, separated from any previous argument @@ -5310,7 +5303,6 @@ These are the predefined keys that work inside the argument. by~\<separator\>. \item - \mylst!- with other sep={$\<separator\>$}! , \mylst!slot with other sep={$\<separator\>$}! Adds a slot to the argument, separated @@ -5575,8 +5567,8 @@ The following commands are available for programming inside keys, including \lst \section{The class types} -The \semantex system uses several different \emph{class types}. -In fact, all class types are identical internally; the low-level machinery of \semantex does not \enquote{know} what type a class has. +The \semantex{} system uses several different \emph{class types}. +In fact, all class types are identical internally; the low-level machinery of \semantex{} does not \enquote{know} what type a class has. The only difference between the class types is the \emph{input syntax}. In other words, it determines which arguments an object of that class can take. The syntax for creating new objects @@ -5630,7 +5622,7 @@ class types: \end{lstlisting} \end{itemize} -Let me add that \semantex uses a very clear separation between the input syntax and the underlying machinery. Because of this, if the user needs a different kind of class type, it is not very hard to create one. You must simply open the source code of \semantex, find the class you want to modify, and then copy the definition of the command~\mylst!\New$\<Class type\>$Class! and modify it in whatever way you want. +Let me add that \semantex{} uses a very clear separation between the input syntax and the underlying machinery. Because of this, if the user needs a different kind of class type, it is not very hard to create one. You must simply open the source code of \semantex, find the class you want to modify, and then copy the definition of the command~\mylst!\New$\<Class type\>$Class! and modify it in whatever way you want. The last class type, called \lstinline!Simple!, is the class type of the class~\lstinline!\SemantexBaseObject!. This class is pretty useless as all it does is print its symbol, without allowing any keyval syntax. So you simply should not use it. diff --git a/Master/texmf-dist/tex/latex/semantex/semantex.sty b/Master/texmf-dist/tex/latex/semantex/semantex.sty index d9f313cc56d..5d7e6070a1c 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}{2021/07/25}{0.511}{} +\ProvidesExplPackage{semantex}{2021/08/10}{0.512}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -10,6 +10,7 @@ % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\tl_set:Nn\SemantexVersion{0.512} \cs_set_eq:NN \semantex_keyval_parse:NNn \keyval_parse:NNn \cs_set:Npn \semantex_singlekey_parse:Nn#1#2 { \clist_map_function:nN { #2 } #1 } @@ -7710,7 +7711,6 @@ {dots}{sep~i~dots}, {...}{dots}, {slot}{sep~i~slot}, - {-}{slot}, {*}{sep~d~*}, {**}{sep~d~**}, }, @@ -7745,9 +7745,7 @@ {comma~arg~dots}{set~arg~keys={comma~dots}}, {comma~arg~...}{set~arg~keys={comma~...}}, {arg~slot}{set~arg~keys={slot}}, - {arg-}{set~arg~keys={-}}, {comma~arg~slot}{set~arg~keys={comma~slot}}, - {comma~arg~-}{set~arg~keys={comma~-}}, {clear~arg}{ execute={ \semantex_data_tl_clear:nn { ##1 } { arg } \semantex_data_int_clear:nn { ##1 } { number~of~arguments } @@ -7920,7 +7918,6 @@ {arg~dots~with~other~sep}{set~arg~keys={dots~with~other~sep={#1}}}, {arg~...~with~other~sep}{set~arg~keys={dots~with~other~sep={#1}}}, {arg~slot~with~other~sep}{set~arg~keys={slot~with~other~sep={#1}}}, - {arg~-~with~other~sep}{set~arg~keys={slot~with~other~sep={#1}}}, }, define~keys[2]={ {arg~with~other~sep}{set~arg~keys={other~sep={#1}{#2}}}, @@ -7996,11 +7993,8 @@ data~provide=post~upper, define~keys={ {upper~slot}{ set~keys~x={ upper=\semantex_data_tl_get_exp_not:nn { ##1 } { upper~slot } } }, - {upper~-}{upper~slot}, {sep~upper~slot}{ set~keys~x={ sep~upper=\semantex_data_tl_get_exp_not:nn { ##1 } { upper~slot } } }, - {sep~upper~-}{sep~upper~slot}, {comma~upper~slot}{ set~keys~x={ comma~upper=\semantex_data_tl_get_exp_not:nn { ##1 } { upper~slot } } }, - {comma~upper~-}{comma~upper~slot}, {upper~dots}{ set~keys~x={ upper=\semantex_data_tl_get_exp_not:nn { ##1 } { upper~dots } } }, {upper~...}{upper~dots}, {sep~upper~dots}{ set~keys~x={ sep~upper=\semantex_data_tl_get_exp_not:nn { ##1 } { upper~dots } } }, @@ -8108,15 +8102,6 @@ } }, }, - {upper~-~with~other~sep}{ - execute={ - \semantex_valuekey:nnx { ##1 } { upper~with~other~sep } - { - { \exp_not:n { #1 } } - { \semantex_data_tl_get_exp_not:nn { ##1 } { upper~slot } } - } - }, - }, {set~upper~dots}{ execute={ \semantex_data_tl_set:nnn { ##1 } { upper~dots } { #1 } }, }, @@ -8181,11 +8166,8 @@ data~provide=post~lower, define~keys={ {lower~slot}{ set~keys~x={ lower=\semantex_data_tl_get_exp_not:nn { ##1 } { lower~slot } } }, - {lower~-}{lower~slot}, {sep~lower~slot}{ set~keys~x={ sep~lower=\semantex_data_tl_get_exp_not:nn { ##1 } { lower~slot } } }, - {sep~lower~-}{sep~lower~slot}, {comma~lower~slot}{ set~keys~x={ comma~lower=\semantex_data_tl_get_exp_not:nn { ##1 } { lower~slot } } }, - {comma~lower~-}{comma~lower~slot}, {lower~dots}{ set~keys~x={ lower=\semantex_data_tl_get_exp_not:nn { ##1 } { lower~dots } } }, {lower~...}{lower~dots}, {sep~lower~dots}{ set~keys~x={ sep~lower=\semantex_data_tl_get_exp_not:nn { ##1 } { lower~dots } } }, @@ -8205,12 +8187,12 @@ {clear~post~lower}{ execute={ \semantex_data_tl_clear:nn { ##1 } { post~lower } }, }, - {lower~**}{lower=\SemantexBullet}, - {lower~***}{lower=\SemantexDoubleBullet}, - {sep~lower~**}{sep~lower=\SemantexBullet}, - {sep~lower~***}{sep~lower=\SemantexDoubleBullet}, - {comma~lower~**}{comma~lower=\SemantexBullet}, - {comma~lower~***}{comma~lower=\SemantexDoubleBullet}, + {lower~*}{lower=\SemantexBullet}, + {lower~**}{lower=\SemantexDoubleBullet}, + {sep~lower~*}{sep~lower=\SemantexBullet}, + {sep~lower~**}{sep~lower=\SemantexDoubleBullet}, + {comma~lower~*}{comma~lower=\SemantexBullet}, + {comma~lower~**}{comma~lower=\SemantexDoubleBullet}, }, define~keys[1]={ {lower}{ @@ -8292,15 +8274,6 @@ } }, }, - {lower~-~with~other~sep}{ - execute={ - \semantex_valuekey:nnx { ##1 } { lower~with~other~sep } - { - { \exp_not:n { #1 } } - { \semantex_data_tl_get_exp_not:nn { ##1 } { lower~slot } } - } - }, - }, {set~lower~dots}{ execute={ \semantex_data_tl_set:nnn { ##1 } { lower~dots } { #1 } }, }, @@ -8322,8 +8295,8 @@ } }, }, - {lower~**~with~other~sep}{lower~with~other~sep={#1}{\SemantexBullet}}, - {lower~***~with~other~sep}{lower~with~other~sep={#1}{\SemantexDoubleBullet}}, + {lower~*~with~other~sep}{lower~with~other~sep={#1}{\SemantexBullet}}, + {lower~**~with~other~sep}{lower~with~other~sep={#1}{\SemantexDoubleBullet}}, {set~lower~sep}{ execute={ \semantex_data_tl_set:nnn { ##1 } { lower~sep } { #1 } }, }, @@ -8365,11 +8338,8 @@ data~provide=post~upper~left, define~keys={ {upper~left~slot}{ set~keys~x={ upper~left=\semantex_data_tl_get_exp_not:nn { ##1 } { upper~left~slot } } }, - {upper~left~-}{upper~left~slot}, {sep~upper~left~slot}{ set~keys~x={ sep~upper~left=\semantex_data_tl_get_exp_not:nn { ##1 } { upper~left~slot } } }, - {sep~upper~left~-}{sep~upper~left~slot}, {comma~upper~left~slot}{ set~keys~x={ comma~upper~left=\semantex_data_tl_get_exp_not:nn { ##1 } { upper~left~slot } } }, - {comma~upper~left~-}{comma~upper~left~slot}, {upper~left~dots}{ set~keys~x={ upper~left=\semantex_data_tl_get_exp_not:nn { ##1 } { upper~left~dots } } }, {upper~left~...}{upper~left~dots}, {sep~upper~left~dots}{ set~keys~x={ sep~upper~left=\semantex_data_tl_get_exp_not:nn { ##1 } { upper~left~dots } } }, @@ -8476,15 +8446,6 @@ } }, }, - {upper~left~-~with~other~sep}{ - execute={ - \semantex_valuekey:nnx { ##1 } { upper~left~with~other~sep } - { - { \exp_not:n { #1 } } - { \semantex_data_tl_get_exp_not:nn { ##1 } { upper~left~slot } } - } - }, - }, {set~upper~left~dots}{ execute={ \semantex_data_tl_set:nnn { ##1 } { upper~left~dots } { #1 } }, }, @@ -8549,11 +8510,8 @@ data~provide=post~lower~left, define~keys={ {lower~left~slot}{ set~keys~x={ lower~left=\semantex_data_tl_get_exp_not:nn { ##1 } { lower~left~slot } } }, - {lower~left~-}{lower~left~slot}, {sep~lower~left~slot}{ set~keys~x={ sep~lower~left=\semantex_data_tl_get_exp_not:nn { ##1 } { lower~left~slot } } }, - {sep~lower~left~-}{sep~lower~left~slot}, {comma~lower~left~slot}{ set~keys~x={ comma~lower~left=\semantex_data_tl_get_exp_not:nn { ##1 } { lower~left~slot } } }, - {comma~lower~left~-}{comma~lower~left~slot}, {lower~left~dots}{ set~keys~x={ lower~left=\semantex_data_tl_get_exp_not:nn { ##1 } { lower~left~dots } } }, {lower~left~...}{lower~left~dots}, {sep~lower~left~dots}{ set~keys~x={ sep~lower~left=\semantex_data_tl_get_exp_not:nn { ##1 } { lower~left~dots } } }, @@ -8660,15 +8618,6 @@ } }, }, - {lower~left~-~with~other~sep}{ - execute={ - \semantex_valuekey:nnx { ##1 } { lower~left~with~other~sep } - { - { \exp_not:n { #1 } } - { \semantex_data_tl_get_exp_not:nn { ##1 } { lower~left~slot } }, - } - }, - }, {set~lower~left~dots}{ execute={ \semantex_data_tl_set:nnn { ##1 } { lower~left~dots } { #1 } }, }, @@ -8732,19 +8681,16 @@ { upper~slot } { lower~slot }, }, - {d~-}{d~slot}, {sep~d~slot}{ bool~if~TF={upper~grading} { sep~upper~slot } { sep~lower~slot }, }, - {sep~d~-}{sep~d~slot}, {comma~d~slot}{ bool~if~TF={upper~grading} { comma~upper~slot } { comma~lower~slot }, }, - {comma~d~-}{comma~d~slot}, {d~dots}{ bool~if~TF={upper~grading} { upper~dots } @@ -8781,32 +8727,32 @@ {d~*}{ bool~if~TF={upper~grading} { upper~* } - { lower~** }, + { lower~* }, }, {d~**}{ bool~if~TF={upper~grading} { upper~** } - { lower~*** }, + { lower~** }, }, {sep~d~*}{ bool~if~TF={upper~grading} { sep~upper~* } - { sep~lower~** }, + { sep~lower~* }, }, {sep~d~**}{ bool~if~TF={upper~grading} { sep~upper~** } - { sep~lower~*** }, + { sep~lower~** }, }, {comma~d~*}{ bool~if~TF={upper~grading} { comma~upper~* } - { comma~lower~** }, + { comma~lower~* }, }, {comma~d~**}{ bool~if~TF={upper~grading} { comma~upper~** } - { comma~lower~*** }, + { comma~lower~** }, }, }, define~keys[1]={ @@ -8876,9 +8822,6 @@ lower~slot~with~other~sep={#1}, }, }, - {d~-~with~other~sep}{ - d~slot~with~other~sep={#1}, - }, {set~d~dots}{ bool~if~TF={upper~grading} { @@ -8903,12 +8846,12 @@ {d~*~with~other~sep}{ bool~if~TF={upper~grading} { upper~*~with~other~sep={#1} } - { lower~**~with~other~sep={#1} }, + { lower~*~with~other~sep={#1} }, }, {d~**~with~other~sep}{ bool~if~TF={upper~grading} { upper~**~with~other~sep={#1} } - { lower~***~with~other~sep={#1} }, + { lower~**~with~other~sep={#1} }, }, {set~d~sep}{ bool~if~TF={upper~grading} @@ -8965,19 +8908,16 @@ { lower~slot } { upper~slot }, }, - {i~-}{i~slot}, {sep~i~slot}{ bool~if~TF={upper~grading} { sep~lower~slot } { sep~upper~slot }, }, - {sep~i~-}{sep~i~slot}, {comma~i~slot}{ bool~if~TF={upper~grading} { comma~lower~slot } { comma~upper~slot }, }, - {comma~i~-}{comma~i~slot}, {i~dots}{ bool~if~TF={upper~grading} { lower~dots } @@ -9013,32 +8953,32 @@ }, {i~*}{ bool~if~TF={upper~grading} - { lower~** } + { lower~* } { upper~* }, }, {i~**}{ bool~if~TF={upper~grading} - { lower~*** } + { lower~** } { upper~** }, }, {sep~i~*}{ bool~if~TF={upper~grading} - { sep~lower~** } + { sep~lower~* } { sep~upper~* }, }, {sep~i~**}{ bool~if~TF={upper~grading} - { sep~lower~*** } + { sep~lower~** } { sep~upper~** }, }, {comma~i~*}{ bool~if~TF={upper~grading} - { comma~lower~** } + { comma~lower~* } { comma~upper~* }, }, {comma~i~**}{ bool~if~TF={upper~grading} - { comma~lower~*** } + { comma~lower~** } { comma~upper~** }, }, }, @@ -9108,9 +9048,6 @@ upper~slot~with~other~sep={#1}, }, }, - {i~-~with~other~sep}{ - i~slot~with~other~sep={#1}, - }, {set~i~dots}{ bool~if~TF={upper~grading} { @@ -9134,12 +9071,12 @@ }, {i~*~with~other~sep}{ bool~if~TF={upper~grading} - { lower~**~with~other~sep={#1} } + { lower~*~with~other~sep={#1} } { upper~*~with~other~sep={#1} }, }, {i~**~with~other~sep}{ bool~if~TF={upper~grading} - { lower~***~with~other~sep={#1} } + { lower~**~with~other~sep={#1} } { upper~**~with~other~sep={#1} }, }, {set~i~sep}{ @@ -9296,7 +9233,6 @@ {set~arg~without~keyval~x}{ execute={ \semantex_arg_without_keyval:nx { ##1 } { #1 } } }, {arg~without~keyval~set~x}{ execute={ \semantex_arg_without_keyval:nx { ##1 } { #1 } } }, {default}{sep={#1}}, - {-~with~other~sep}{slot~with~other~sep={#1}}, {...~with~other~sep}{dots~with~other~sep={#1}}, {sep}{ execute={ @@ -9374,7 +9310,6 @@ } }, }, - {-}{slot}, {comma~slot}{ execute={ \semantex_arg_valuekey:nnx { ##1 } { comma } @@ -9383,7 +9318,6 @@ } }, }, - {comma~-}{comma~slot}, }, define~arg~keys[2]={ {other~sep}{ diff --git a/Master/texmf-dist/tex/latex/semantex/stripsemantex.sty b/Master/texmf-dist/tex/latex/semantex/stripsemantex.sty index eaa7ea9a82a..c674680d6cf 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}{2021/07/25}{0.511}{} +\ProvidesExplPackage{stripsemantex}{2021/08/10}{0.512}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % |