summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/media9/ChangeLog7
-rw-r--r--macros/latex/contrib/media9/doc/media9.pdfbin3735778 -> 3737571 bytes
-rw-r--r--macros/latex/contrib/media9/media9.sty4
-rw-r--r--macros/latex/contrib/media9/pdfbase.sty137
-rw-r--r--macros/latex/contrib/memoir/README48
-rw-r--r--macros/latex/contrib/memoir/doc-src/memman.tex231
-rw-r--r--macros/latex/contrib/memoir/doc-src/memsty.sty5
-rw-r--r--macros/latex/contrib/memoir/memman.pdfbin2779593 -> 2779439 bytes
-rw-r--r--macros/latex/contrib/memoir/memoir.dtx489
-rw-r--r--macros/latex/contrib/semantex/semantex.pdfbin359206 -> 360914 bytes
-rw-r--r--macros/latex/contrib/semantex/semantex.sty308
-rw-r--r--macros/latex/contrib/semantex/semantex.tex43
-rw-r--r--macros/latex/contrib/semantex/semtex.sty83
-rw-r--r--macros/latex/contrib/semantex/stripsemantex.lua5
-rw-r--r--macros/latex/contrib/semantex/stripsemantex.sty2
-rw-r--r--macros/latex/contrib/semtex/semtex.pdfbin77110 -> 76606 bytes
-rw-r--r--macros/latex/contrib/semtex/semtex.sty34
-rw-r--r--macros/latex/contrib/semtex/semtex.tex2
18 files changed, 915 insertions, 483 deletions
diff --git a/macros/latex/contrib/media9/ChangeLog b/macros/latex/contrib/media9/ChangeLog
index 953a714fc0..be1f65e01d 100644
--- a/macros/latex/contrib/media9/ChangeLog
+++ b/macros/latex/contrib/media9/ChangeLog
@@ -1,4 +1,9 @@
-2020-05-06
+2020-09-10
+ * v1.13 : media9.sty
+ * v0.44 : pdfbase.sty
+ * fix : pdfbase.sty: improvements for producing xforms
+
+2020-07-08
* v1.12 : media9.sty
* v0.43 : pdfbase.sty
* fix : pdfbase.sty: \pbs_pdfxform:nnnnn (dvips version) missing `newpath'
diff --git a/macros/latex/contrib/media9/doc/media9.pdf b/macros/latex/contrib/media9/doc/media9.pdf
index 5b378b6781..93b95df193 100644
--- a/macros/latex/contrib/media9/doc/media9.pdf
+++ b/macros/latex/contrib/media9/doc/media9.pdf
Binary files differ
diff --git a/macros/latex/contrib/media9/media9.sty b/macros/latex/contrib/media9/media9.sty
index 610ff93c53..4deae7f519 100644
--- a/macros/latex/contrib/media9/media9.sty
+++ b/macros/latex/contrib/media9/media9.sty
@@ -37,8 +37,8 @@
\RequirePackage{xparse}
\RequirePackage{atbegshi}
-\def\g@mix@date@tl{2020/07/08}
-\def\g@mix@version@tl{1.12}
+\def\g@mix@date@tl{2020/09/10}
+\def\g@mix@version@tl{1.13}
\ProvidesExplPackage{media9}{\g@mix@date@tl}{\g@mix@version@tl}
{acrobat-9/X compatible media}
diff --git a/macros/latex/contrib/media9/pdfbase.sty b/macros/latex/contrib/media9/pdfbase.sty
index 9da881bd6d..6e86b60bf8 100644
--- a/macros/latex/contrib/media9/pdfbase.sty
+++ b/macros/latex/contrib/media9/pdfbase.sty
@@ -159,8 +159,8 @@
\RequirePackage{expl3}
\RequirePackage{l3keys2e}
-\def\g@pbs@date@tl{2020/07/08}
-\def\g@pbs@version@tl{0.43}
+\def\g@pbs@date@tl{2020/09/10}
+\def\g@pbs@version@tl{0.44}
\ProvidesExplPackage{pdfbase}{\g@pbs@date@tl}{\g@pbs@version@tl}
{driver independent access to low-level PDF features}
@@ -429,7 +429,10 @@
}
\cs_new_protected_nopar:Nn\pbs_pdfrefxform:n{% #1: xform obj ID
- \hbox_overlap_right:n{\smash{\pdfrefxform\pbs_reftonum:n{#1}}}
+ \hbox_set:Nn\l_tmpa_box{\pdfrefxform\pbs_reftonum:n{#1}}
+ \box_set_wd:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_ht:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_dp:Nn\l_tmpa_box{\c_zero_dim}\box_use_drop:N\l_tmpa_box
}
\cs_new_protected_nopar:Nn\pbs_pdfximage:n{
@@ -638,8 +641,8 @@
}
\cs_new_protected_nopar:Nn\pbs_pdfxform:nnnnn{ % #2 not used
- \begin{picture}(0,0)
- \put(0,0){
+ \group_begin:
+ \hbox_set:Nn\l_tmpa_box{
\special{pdf:bxobj~@pbs@obj\int_use:N\g_pbs_obj_int\space
width~\dim_eval:n{\box_wd:N#5}~
height~\space\dim_eval:n{\box_ht:N#5}~
@@ -671,7 +674,10 @@
\str_if_eq:eeF{\l_tmpa_tl}{}{<<\l_tmpa_tl>>}
}
}
- \end{picture}
+ \box_set_wd:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_ht:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_dp:Nn\l_tmpa_box{\c_zero_dim}\box_use_drop:N\l_tmpa_box
+ \group_end:
\tl_gset:Nx\g_pbs_pdflastxform_tl{@pbs@obj\int_use:N\g_pbs_obj_int}
\int_gincr:N\g_pbs_obj_int
}
@@ -712,7 +718,7 @@
\tl_gset:Nx\g_pbs_hash_tl{\token_to_str:N#}
%insert literal Postscript code
\cs_new_protected_nopar:Nn\pbs_literal:nn{ % #1: empty (`'), `direct' or
- \str_if_eq:nnTF{#1}{}{ % #2: raw Postscript `page'
+ \str_if_eq:nnTF{#1}{}{ % #2: raw Postscript | `page'
% set current location's coordinates to (0,0) and set unit vectors to
% 1bp right and 1bp upwards; graphics state is saved before and
% re-instated after insertion
@@ -726,28 +732,34 @@
\cs_new_protected_nopar:Nn\pbs_pdfannot:nnnn{
\special{dvisvgm:raw~{?nl}<path~d=}
- \group_begin:\dim_set:Nn\unitlength{1pt}
- \begin{picture}(0,0)% mark annotation rectangle
- \put(0,-\dim_to_decimal:n{#3}){% ll
- \special{dvisvgm:raw~'M{?x}~{?y}}
- }
- \put(\dim_to_decimal:n{#1},-\dim_to_decimal:n{#3}){% lr
- \special{dvisvgm:raw~{?nl}L{?x}~{?y}}
- }
- \put(\dim_to_decimal:n{#1},\dim_to_decimal:n{#2}){% ur
- \special{dvisvgm:raw~{?nl}L{?x}~{?y}}
- }
- \put(0,\dim_to_decimal:n{#2}){% ul
- \special{dvisvgm:raw~{?nl}L{?x}~{?y}~Z'}
+ \group_begin:
+ \hbox_set:Nn\l_tmpa_box{
+ \box_move_down:nn{#3}{\hbox_to_zero:n{% ll
+ \special{dvisvgm:raw~'M{?x}~{?y}}
+ }}
+ \hbox_to_zero:n{
+ \skip_horizontal:n{#1}
+ \box_move_down:nn{#3}{\hbox_to_zero:n{% lr
+ \special{dvisvgm:raw~L{?x}~{?y}}
+ }}
+ \box_move_up:nn{#2}{\hbox_to_zero:n{% ur
+ \special{dvisvgm:raw~L{?x}~{?y}}
+ }}\hss
+ }
+ \box_move_up:nn{#2}{\hbox_to_zero:n{% ul
+ \special{dvisvgm:raw~L{?x}~{?y}Z'}
+ }}
}
- \end{picture}
+ \box_set_wd:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_ht:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_dp:Nn\l_tmpa_box{\c_zero_dim}\box_use_drop:N\l_tmpa_box
\group_end:
\special{dvisvgm:raw~{?nl}opacity='0'~#4~class='annot'/>}
}
\cs_new_protected_nopar:Nn\pbs_pdfxform:nnnnn{
- \makebox[\c_zero_dim][l]{
- \raisebox{\c_zero_dim}[\c_zero_dim][\c_zero_dim]{
+ \group_begin:
+ \hbox_set:Nn\l_tmpa_box{
\special{dvisvgm:raw~{?nl}<defs>{?nl}
<g~
transform='translate({?(-(x))},{?(-(y))})'~#4~
@@ -759,7 +771,10 @@
\special{dvisvgm:bbox~unlock}
\special{dvisvgm:raw~{?nl}</g>{?nl}</defs>}
}
- }
+ \box_set_wd:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_ht:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_dp:Nn\l_tmpa_box{\c_zero_dim}\box_use_drop:N\l_tmpa_box
+ \group_end:
\tl_gset:Nx\g_pbs_pdflastxform_tl{
\g_pbs_hash_tl pbs@obj\int_use:N\g_pbs_obj_int}
\int_gincr:N\g_pbs_obj_int
@@ -795,9 +810,6 @@
}
}
\special{!~
- %keeping track of xform nesting level
- true~setglobal~globaldict~/pbs@xform@level~0~put~false~setglobal
- %
%back-transforms user coords to page coords (bigpoints with reference
%point [0,0] in the bottom-left page corner)
% user_x user_y pbs@user2page --> page_x page_y
@@ -944,15 +956,21 @@
\cs_new_protected_nopar:Nn\pbs_pdfannot:nnnn{
\group_begin:
- \dim_set:Nn\unitlength{1pt}
- \begin{picture}(0,0)% mark annotation rectangle
- \put(0,-\dim_to_decimal:n{#3}){
- \pbs_special:n{currentpoint~/pbs@lly~exch~def~/pbs@llx~exch~def}
- }
- \put(\dim_to_decimal:n{#1},\dim_to_decimal:n{#2}){
- \pbs_special:n{currentpoint~/pbs@ury~exch~def~/pbs@urx~exch~def}
+ % mark annotation rectangle
+ \hbox_set:Nn\l_tmpa_box{
+ % lower left
+ \box_move_down:nn{#3}{\hbox_to_zero:n{\pbs_special:n{
+ currentpoint~/pbs@lly~exch~def~/pbs@llx~exch~def
+ }}}
+ \skip_horizontal:n{#1}
+ % upper right
+ \box_move_up:nn{#2}{\hbox_to_zero:n{\pbs_special:n{
+ currentpoint~/pbs@ury~exch~def~/pbs@urx~exch~def
+ }}}
}
- \end{picture}
+ \box_set_wd:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_ht:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_dp:Nn\l_tmpa_box{\c_zero_dim}\box_use_drop:N\l_tmpa_box
\group_end:
\str_if_eq:eeF{#4}{}{
\pbs_special:n{
@@ -1086,15 +1104,7 @@
}
\cs_new_protected_nopar:Nn\pbs_pdfxform:nnnnn{ % #1, #3 not used (resources
- %this allows nesting \pbs_pdfxform:nnnnn{...} % are managed
- \pbs_special:n{ % automaticlly)
- gsave~
- pbs@xform@level~0~eq~{/pbs@ctm@0~matrix~currentmatrix~def}~if~
- pbs@ctm@0~setmatrix~
- true~setglobal~
- globaldict~/pbs@xform@level~pbs@xform@level~1~add~put~
- false~setglobal
- }
+ % are managed automatically)
%rescale box to fit within the papersize while distilling
\tl_gset:cx{scale_{pbs@obj\int_use:N\g_pbs_obj_int}}{\fp_eval:n{min(1.0,
\dim_ratio:nn{\paperwidth}{\box_wd:N#5},
@@ -1107,22 +1117,20 @@
}
\group_begin:
%mark bbox of box#5
- \dim_set:Nn\unitlength{1pt}
- \begin{picture}(0,0)
- \put(0,-\dim_to_decimal:n{\box_dp:N#5}){
- \pbs_special:n{
+ \hbox_set:Nn\l_tmpa_box{
+ % lower left
+ \box_move_down:nn{\box_dp:N#5}{\hbox_to_zero:n{\pbs_special:n{
currentpoint~/pbs@lly~exch~def~/pbs@llx~exch~def
- }
- }
- \put(
- \dim_to_decimal:n{\box_wd:N#5},
- \dim_to_decimal:n{\box_ht:N#5}
- ){
- \pbs_special:n{
+ }}}
+ \skip_horizontal:n{\box_wd:N#5}
+ % upper right
+ \box_move_up:nn{\box_ht:N#5}{\hbox_to_zero:n{\pbs_special:n{
currentpoint~/pbs@ury~exch~def~/pbs@urx~exch~def
- }
+ }}}
}
- \end{picture}
+ \box_set_wd:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_ht:Nn\l_tmpa_box{\c_zero_dim}
+ \box_set_dp:Nn\l_tmpa_box{\c_zero_dim}\box_use_drop:N\l_tmpa_box
\group_end:
%additional dict entries
\tl_set:Nx\l_tmpa_tl{#4} \tl_trim_spaces:N\l_tmpa_tl
@@ -1176,7 +1184,9 @@
}?pdfmark
}
}
- \begin{picture}(0,0)\put(0,0){\box_use:N#5}\end{picture}
+ \box_set_wd:Nn#5{\c_zero_dim}
+ \box_set_ht:Nn#5{\c_zero_dim}
+ \box_set_dp:Nn#5{\c_zero_dim}\box_use_drop:N#5
\pbs_special:n{~mark~/EP~pdfmark~grestore}
%insert additional dict entries (the Ghostscript way)
\str_if_eq:eeF{\l_tmpa_tl}{}{
@@ -1201,12 +1211,6 @@
}
}
}
- \pbs_special:n{
- true~setglobal~
- globaldict~/pbs@xform@level~pbs@xform@level~1~sub~put~
- false~setglobal~
- grestore
- }
}
\cs_new_protected_nopar:Nn\pbs_pdfrefxform:n{% #1: xform obj ID
@@ -1343,13 +1347,12 @@
% This can be fixed by placing a dumb (non-interactive) Widget dummy
% somewhere on the page.
\bool_if:NT\g_pbs_ocgbase_loaded_bool{
- \skip_horizontal:n{1bp}
- \box_move_down:nn{1bp}{\vbox:n{
+ \put(1,-1){
\pbs_pdfannot:nnnn{3bp}{\c_zero_dim}{3bp}{
/Ff~65537/FT/Btn/Subtype/Widget
/T~(pbs@ARFix@\int_use:N\g_pbs_page_int)
}
- }}
+ }
}
}
}
diff --git a/macros/latex/contrib/memoir/README b/macros/latex/contrib/memoir/README
index d50c43f474..ce656d845c 100644
--- a/macros/latex/contrib/memoir/README
+++ b/macros/latex/contrib/memoir/README
@@ -28,6 +28,54 @@ o Backmatter:
Bibliography, indexes ~ 50 pages
+Changed (2020/09/10)
+
+o memoir v3.7m
+
+In preparation for the LaTeX format/kernel update (2020/10/01) several
+class hook features have been changed to use these new features, see
+the manuals for lthooks, ltfilehook, ltshipout for details on these
+new hooks.
+
+Thus from the 2020/10/01 LaTeX forward onwards we have the changes
+below. Until 2020/10/01 the new format can be tested via
+e.g. pdflatex-dev
+
+-- trimmarks are now added via the shipout/background hook, and is
+ labeled memoir/trimmarks
+
+ See the ltshipout manual for more details.
+
+-- \AtBeginFile{filename}{code} and \AtEndFile{filename}{code} are now
+ implemented via the file/before/filename and
+ file/after/filename hooks.
+
+ **Breaking change:** In the old implementation of
+ \AtBegin/EndFile{file}: if file is a `.tex` file, then one could use
+ \AtEndFile{test}{code} to add code at the end of inputting
+ `test.tex`. Now you will have to use \AtEndFile{test.tex}{code}.
+
+ See the manual for ltfilehook for more details.
+
+-- \AtBeginPackage{name}{code}, \AtEndPackage{name}{code} and
+ \RequireAtEndPackage{name}{code} are now implemented via the
+ package/before/name and package/after/name hooks.
+
+-- \AtBeginClass{name}{code}, \AtEndClass{name}{code} and
+ \RequireAtEndClass{name}{code} are implemented via
+ class/before/name and class/after/name
+
+-- the redefinition of \trimmarks inside the definition of \quarkmarks
+ have been removed
+
+-- Whenever the caption package is loaded, memoir will reset it self
+ so the caption package can take over. We issue some information to
+ the user at this point. In this update we have changed this
+ information from a class warning to a class info as the warning
+ confused a ot of users.
+
+
+
Changed (2020/06/02)
o memoir v3.7l
diff --git a/macros/latex/contrib/memoir/doc-src/memman.tex b/macros/latex/contrib/memoir/doc-src/memman.tex
index 5ed8b9935c..8c24a50322 100644
--- a/macros/latex/contrib/memoir/doc-src/memman.tex
+++ b/macros/latex/contrib/memoir/doc-src/memman.tex
@@ -28144,8 +28144,8 @@ pdflatex memman
\svnidlong
{$Ignore: $}
-{$LastChangedDate: 2019-11-11 16:55:48 +0100 (Mon, 11 Nov 2019) $}
-{$LastChangedRevision: 661 $}
+{$LastChangedDate: 2020-08-06 14:38:28 +0200 (Thu, 06 Aug 2020) $}
+{$LastChangedRevision: 693 $}
{$LastChangedBy: daleif@math.au.dk $}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -28262,6 +28262,20 @@ declaration switches off the trim marks; the \cmd{\showtrimson} declaration,
which is the default, switches on the trim marks. These declarations do
nothing if the \Lopt{showtrims} option has not been used.
+
+\begin{Changed}
+ From the \LaTeX\ format dated 2020/10/01 we changed the way
+ trimmarks are added to the pages. It will now go through the
+ »\texttt{shipout/background}« hook instead of changing the
+ \cmd{\shipout} routine directly. This also have the advantage that
+ the hooks can be reordered if say you want something to be added to
+ \texttt{shipout/background} \emph{before} the trimmarks are added.
+ For more details about the hooks see \cite{LTHOOKS,LTSHIPOUT}.
+
+ The trimmarks will have the hook label »\texttt{memoir/trimmarks}«.
+\end{Changed}
+
+
\LMnote{2013/05/01}{added caveat}
\begin{caveat}
Most modern \LaTeX\ editors make use of the \emph{synctex} features
@@ -28275,10 +28289,17 @@ nothing if the \Lopt{showtrims} option has not been used.
line one is referred back to may be off by tens of lines.
Currently, there is no known workarounds for this deficiency.
+
+ NB: We have yet to see if the 2020/10/01 format update and change to
+ the trimmarks implementation will fix this issue.
+
\end{caveat}
+
+
+
Trim marks can be placed at each corner of the (trimmed) page, and also
at the middle of each side of the page.
@@ -30161,6 +30182,16 @@ in your preamble.
\subsection{Inserting code before and after a file, package or class}
+\begin{Changed}
+ As of \LaTeX\ format dated 2020/10/01 these \cs{At...} macros
+ described below will be implemented using kernel hooks as layed out
+ via \cite{LTFILEHOOK}. Which also means the order of the hooks can
+ actually be changed. See \cite{LTHOOKS} for general information
+ about the hooking feature.
+\end{Changed}
+
+
+
The kernel provides two commands, \cmd{\AtBeginDocument}
and \cmd{\AtEndDocument} which can only be used in the preamble,
for inserting code at the start and end
@@ -30176,31 +30207,57 @@ The class provides a more comprensive set of macros for code
insertions, which should be used before the relevant file is called for.
\begin{syntax}
-\cmd{\AtBeginFile}\marg{file}\marg{code} \\
-\cmd{\AtEndFile}\marg{file}\marg{code} \\
+\cmd{\AtBeginFile}\marg{filename}\marg{code} \\
+\cmd{\AtEndFile}\marg{filename}\marg{code} \\
\end{syntax}
\glossary(AtBeginFile)%
- {\cs{AtBeginFile}\marg{file}\marg{code}}%
- {Inserts \meta{code} just before the \meta{file} is input
+ {\cs{AtBeginFile}\marg{filename}\marg{code}}%
+ {Inserts \meta{code} just before the \meta{filename} is input
(or included, etc.).}%
\glossary(AtEndFile)%
- {\cs{AtEndFile}\marg{file}\marg{code}}%
- {Inserts \meta{code} just after the \meta{file} is input
- (or included, etc.).}%
-The \cmd{\AtBeginFile} macro inserts \meta{code} just before the \meta{file}
-file is \cmd{\input} (or \cmd{\include}d, etc.). Similarly
-\cmd{\AtEndFile} inserts the \meta{code} immediately after the
-\meta{file}. The \meta{file} argument must be the same as used in the
-corresponding \cmd{\input} command. If \meta{file} includes an
-extension, for example \texttt{fred.def}, then that is taken as
-the complete name, otherwise if there is no extension,
-for instance \texttt{fred}, then the \texttt{.tex} extension is
-automatically appended making the full name \texttt{fred.tex}.
+ {\cs{AtEndFile}\marg{filename}\marg{code}}%
+ {Inserts \meta{code} just after the \meta{filename} is input
+ (or included, etc.).}%
+The \cmd{\AtBeginFile} macro inserts \meta{code} just before the
+\meta{filename} file is \cmd{\input} (or \cmd{\include}d,
+etc.). Similarly \cmd{\AtEndFile} inserts the \meta{code}
+immediately after the \meta{filename}. The \meta{filename} argument
+must be the same as used in the corresponding \cmd{\input}
+command. If \meta{filename} includes an extension, for example
+\texttt{fred.def}, then that is taken as the complete name,
+otherwise if there is no extension, for instance \texttt{fred}, then
+the \texttt{.tex} extension is automatically appended making the
+full name \texttt{fred.tex}.
The \cs{At...File} commands
-must be issued \emph{before} the corresponding \meta{file} is input
+must be issued \emph{before} the corresponding \meta{filename} is input
otherwise nothing will happen.
+\begin{caveat}
+ As of \LaTeX\ format 2020/10/01 this is \textbf{no longer true!} You
+ will now have to provide the \texttt{.tex} extension if it is a
+ \texttt{.tex} file you want to hook into, as in:
+\begin{verbatim}
+\AtEndFile{test.tex}{\typeout{test.tex is done}}
+\end{verbatim}
+ Also note that the 2020/10/01 format will have some specific hooks
+ what apply to \cmd{\include}. The class does not provide an
+ interface for this and instead refers to \cite{LTFILEHOOK}.
+
+ Note that \cmd{\At...File} actually did not work correctly for
+ \cmd{\include} in the old implementation, it still needed the
+ extension! In this new implementation both \cmd{\input} and
+ \cmd{\include} trigger.
+\end{caveat}
+\begin{Changed}
+ By the 2020/10/01 format this is now implemented via the
+ \texttt{file/before/filename} and \texttt{file/after/filename}
+ hooks. We are not adding any hook label.
+\end{Changed}
+
+
+
+
\begin{syntax}
\cmd{\AtBeginPackage}\marg{pack}\marg{code} \\
\cmd{\AtEndPackage}\marg{pack}\marg{code} \\
@@ -30231,6 +30288,14 @@ at the end of the \meta{pack} package if it has not yet been used.
If the package has already been used then the \meta{code} is
called immediately.
+\begin{Changed}
+ By the 2020/10/01 format this is now implemented via the
+ \texttt{package/before/pack} and \texttt{package/after/pack}
+ hooks. We are not adding any hook label.
+\end{Changed}
+
+
+
\begin{syntax}
\cmd{\AtBeginClass}\marg{class}\marg{code} \\
@@ -30262,61 +30327,75 @@ at the end of the \meta{class} class if it has not yet been used.
If the class has already been used then the \meta{code} is
called immediately.
- There is an unfortunate interaction between the kernel's
-\cmd{\AtEndOfPackage} and the class's \cmd{\AtEndPackage}, and similarly
-for the \cmd{\AtEndOfClass} and \cmd{\AtEndClass}. I discovered this when
-I tried to automate using the \Lpack{memhfixc} package if \Lpack{hyperref}
-was being used by putting the following into the \Pclass{memoir} code
-\begin{lcode}
-\AtEndPackage{hyperref}{\usepackage{memhfixc}}
-\end{lcode}
-which caused all sorts of problems.
+\begin{Changed}
+ By the 2020/10/01 format this is now implemented via the
+ \texttt{class/before/pack} and \texttt{class/after/pack}
+ hooks. We are not adding any hook label.
+\end{Changed}
- The kernel scheme looks like this:
-\begin{lcode}
-\newcommand{\usepackage}[1]{%
- ...
- \InputIfFileExists{#1}
-<AtEndOfPackage code>}
-\end{lcode}
- The basic mechanism for implementing the class macros is by modifying
-the kernel's \cmd{\InputIfFileExists} macro, which internally uses a form of
-\cs{input} to read in the file, so that the inserted \meta{code} comes
-immediately before and after the \cs{input}, somewhat like:
-\begin{lcode}
-\renewcommand{\InputIfFileExists}[1]{%
- ...
- <before code> \input{#1} <after code>}
-\end{lcode}
- If \cmd{\AtEndPackage} is applied to a package that has an internal
-\cmd{\AtEndOfPackage} then the result can be sketched as:
-\begin{lcode}
-\newcommand{\usepackage}[1]{%
- ...
- <before code>
- \input{#1}
- <after code>
- <AtEndOfPackage code>
-}
-\end{lcode}
-In other words the body of the package is read in, the \cmd{\AtEndPackage} code
-is called, and then \emph{after} that the \cmd{\AtEndOfPackage} code is called.
- The \Lpack{hyperref} package internally uses \cmd{\AtEndOfPackage} to read
-some files and \Lpack{memhfixc} had to be input after these. A way to automate
-\Lpack{memhfixc} after \Lpack{hyperref} is:
-\begin{lcode}
-\AtEndPackage{hyperref}{%
- \AtBeginDocument{\usepackage{memhfixc}}}
-\end{lcode}
-but this seems more trouble than it's worth especially since
-Heiko\index{Oberdiek, Heiko} Oberdiek has kindly updated \Lpack{hyperref}
-so that versions after 2006/11/15 will automatically load the
-\Lpack{memhfixc} package.
+% There is an unfortunate interaction between the kernel's
+% \cmd{\AtEndOfPackage} and the class's \cmd{\AtEndPackage}, and similarly
+% for the \cmd{\AtEndOfClass} and \cmd{\AtEndClass}. I discovered this when
+% I tried to automate using the \Lpack{memhfixc} package if \Lpack{hyperref}
+% was being used by putting the following into the \Pclass{memoir} code
+% \begin{lcode}
+% \AtEndPackage{hyperref}{\usepackage{memhfixc}}
+% \end{lcode}
+% which caused all sorts of problems.
+
+% The kernel scheme looks like this:
+% \begin{lcode}
+% \newcommand{\usepackage}[1]{%
+% ...
+% \InputIfFileExists{#1}
+% <AtEndOfPackage code>}
+% \end{lcode}
+
+% The basic mechanism for implementing the class macros is by modifying
+% the kernel's \cmd{\InputIfFileExists} macro, which internally uses a form of
+% \cs{input} to read in the file, so that the inserted \meta{code} comes
+% immediately before and after the \cs{input}, somewhat like:
+% \begin{lcode}
+% \renewcommand{\InputIfFileExists}[1]{%
+% ...
+% <before code> \input{#1} <after code>}
+% \end{lcode}
+
+% If \cmd{\AtEndPackage} is applied to a package that has an internal
+% \cmd{\AtEndOfPackage} then the result can be sketched as:
+% \begin{lcode}
+% \newcommand{\usepackage}[1]{%
+% ...
+% <before code>
+% \input{#1}
+% <after code>
+% <AtEndOfPackage code>
+% }
+% \end{lcode}
+% In other words the body of the package is read in, the \cmd{\AtEndPackage} code
+% is called, and then \emph{after} that the \cmd{\AtEndOfPackage} code is called.
+
+% The \Lpack{hyperref} package internally uses \cmd{\AtEndOfPackage} to read
+% some files and \Lpack{memhfixc} had to be input after these. A way to automate
+% \Lpack{memhfixc} after \Lpack{hyperref} is:
+% \begin{lcode}
+% \AtEndPackage{hyperref}{%
+% \AtBeginDocument{\usepackage{memhfixc}}}
+% \end{lcode}
+% but this seems more trouble than it's worth especially since
+% Heiko\index{Oberdiek, Heiko} Oberdiek has kindly updated \Lpack{hyperref}
+% so that versions after 2006/11/15 will automatically load the
+% \Lpack{memhfixc} package.
+The 2020/10/01 format hooking features will solve a lot of issues we
+have had with file hooking, especially when things are delayed via
+\cmd{\AtBeginDocument} and you want to have your code to run after
+someone else's code. The hooking feature now offers users to add rules
+to reorder how the hooks are executed. See \cite{LTHOOKS} for details.
\renewcommand{\memsecinfo}[5]{\edef\Margi{#1}\edef\Margii{#2}%
\edef\Margiii{#3}\edef\Margiv{#4}%
@@ -39368,6 +39447,22 @@ I.~D. Faux and M.~J. Pratt.
\newblock (Available from CTAN (the \texttt{multicol} package) via
\CTANurl{/macros/latex/required/tools/})
+\bibitem[Mit2020a]{LTFILEHOOK}
+ Frank Mittelbach
+ \newblock \emph{The ltfilehook package}
+ \newblock July 2020.
+
+ \bibitem[Mit2020b]{LTHOOKS}
+ Frank Mittelbach
+ \newblock \emph{The lthooks package}
+ \newblock July 2020.
+
+ \bibitem[Mit2020c]{LTSHIPOUT}
+ Frank Mittelbach
+ \newblock \emph{The ltshipout package}
+ \newblock July 2020.
+
+
%%keep
\LMnote{2018/09/06}{Updated year}
\bibitem[MC18]{ARRAY}
diff --git a/macros/latex/contrib/memoir/doc-src/memsty.sty b/macros/latex/contrib/memoir/doc-src/memsty.sty
index b3362e981e..dfe40dc0b2 100644
--- a/macros/latex/contrib/memoir/doc-src/memsty.sty
+++ b/macros/latex/contrib/memoir/doc-src/memsty.sty
@@ -1132,7 +1132,10 @@ it to use the new width for the margin par}
\fancybreak{}
}
-\newenvironment{caveat}{\par\medskip\noindent\textbf{\textit{Caveat.}}\enskip\itshape}{\par\medskip}
+%\newenvironment{caveat}{\par\medskip\noindent\textbf{\textit{Caveat.}}\enskip\itshape}{\par\medskip}
+\newenvironment{caveat}{\begin{leftbar}\noindent\textbf{\textit{Caveat.}}\enskip}{\end{leftbar}}
+%\newenvironment{Changed}{\par\medskip\noindent\textbf{\textit{Changed.}}\enskip}{\par\medskip}
+\newenvironment{Changed}{\begin{leftbar}\noindent\textbf{\textit{Changed.}}\enskip}{\end{leftbar}}
\newenvironment{note}{\par\medskip\noindent\textbf{\textit{Note.}}\enskip\itshape}{\par\medskip}
\newenvironment{note*}[1]{\par\medskip\noindent\textbf{\textit{#1.}}\enskip\itshape}{\par\medskip}
\newenvironment{hint}{\par\medskip\noindent\textbf{\textit{Hint.}}\enskip\itshape}{\par\medskip}
diff --git a/macros/latex/contrib/memoir/memman.pdf b/macros/latex/contrib/memoir/memman.pdf
index 17ba03ba7a..1dfc60a1df 100644
--- a/macros/latex/contrib/memoir/memman.pdf
+++ b/macros/latex/contrib/memoir/memman.pdf
Binary files differ
diff --git a/macros/latex/contrib/memoir/memoir.dtx b/macros/latex/contrib/memoir/memoir.dtx
index be0f5d3651..3785106482 100644
--- a/macros/latex/contrib/memoir/memoir.dtx
+++ b/macros/latex/contrib/memoir/memoir.dtx
@@ -20,7 +20,7 @@
% This work consists of the files listed in the README file.
%
% \fi
-% \CheckSum{31157}
+% \CheckSum{31201}
%
% \changes{v0.1}{2001/05/20}{First public alpha release}
% \changes{v0.2}{2001/06/03}{First beta release}
@@ -122,6 +122,7 @@
% inside \cs{IfFileExists} \# needs to be doubled}
% \changes{v3.7k}{2020/03/25}{Maintenance}
% \changes{v3.7l}{2020/06/02}{Small preparation for october kernel update}
+% \changes{v3.7m}{2020/09/10}{More preparations for october kernel update}
%
% \def\dtxfile{memoir.dtx}
%
@@ -182,6 +183,7 @@
% \def\fileversion{v3.7j} \def\filedate{2019/11/21}
% \def\fileversion{v3.7k} \def\filedate{2020/03/25}
% \def\fileversion{v3.7l} \def\filedate{2020/06/02}
+% \def\fileversion{v3.7m} \def\filedate{2020/09/10}
% \title{The LaTeX \Lpack{memoir} class for configurable book
% typesetting: Source code\thanks{This
% file (\texttt{\dtxfile}) has version number \fileversion, last revised
@@ -412,11 +414,11 @@
% Announce the name, option files and version for LaTeX2e files:
% \begin{macrocode}
%<class>\ProvidesClass{memoir}%
-%<class> [2020/06/02 v3.7l configurable book, report, article document class]
+%<class> [2020/09/10 v3.7m configurable book, report, article document class]
% \end{macrocode}
% In the manual it is useful to know the current version.
% \begin{macrocode}
-%<class>\newcommand\memversion{v3.7l, 2020/06/02}
+%<class>\newcommand\memversion{v3.7m, 2020/09/10}
%<9pt>\ProvidesFile{mem9.clo}%
%<9pt> [2008/01/30 v0.4 memoir class 9pt size option]
%<10pt>\ProvidesFile{mem10.clo}%
@@ -579,6 +581,26 @@
% \end{macro}
% \end{macro}
%
+%
+% \changes{v3.7m}{2020/08/05}{Added \cs{IfFormatAtLeastTF}}
+% \begin{macro}{\IfFormatAtLeastTF}
+% Credit to Frank Mittelbach. Using
+% \cs{IfFormatAtLeastTF}\marg{date}\marg{true}\marg{false} we can
+% execute \meta{true} if the format is dated after the given
+% \meta{date} (in {\scriptsize\ttfamily YYYY/MM/DD} format) and
+% \meta{false} otherwise. The main use is for when we get info that
+% certain features are being added to the \LaTeX\ format, features
+% that we want to base class features on. Then this is an easy method
+% for providing the code only avaiable on newer formats and code left
+% over for those still using the older \LaTeX\ formats.\footnote{The \dots TF is a
+% \LaTeX3 convention.}
+% \begin{macrocode}
+\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
+
+% \end{macrocode}
+% \end{macro}
+%
+%
% \begin{macro}{\ifsamename}
% \begin{macro}{\nametest}
% The macro \cs{nametest}\marg{name1}\marg{name2} tests whether the
@@ -878,7 +900,78 @@
% \end{macrocode}
% \end{macro}
-%
+%
+% \noindent
+% From 2020/10/01 format onwards we will implement file hooks via the
+% features provided by the \LaTeX\ kernel. This makes our code easier
+% to do (actually, users really ought to use these hook macros instead
+% of the ones the class provides) and it eliminates the need for us to
+% redefine \cmd{\InputIfFileExists}.
+% \changes{v3.7m}{2020/08/06}{Reimplemented file/package/class hooks}
+% \begin{macrocode}
+\IfFormatAtLeastTF{2020/10/01}{
+% \end{macrocode}
+% As mentioned in \cite{LTHOOKS,LTFILEHOOK} the kernel provides hooks
+% at the start of files, packages and classes. The class you implement
+% the latter via our definition of the file hook. We will now instead
+% use the separate hooks. Note that we will \emph{not} be adding any
+% extra labels to these hooks and will provide no interface to do
+% so. If more control is needed, please use the kernel interface directly.
+% \begin{macro}{\AtBeginFile}
+% \begin{macro}{\AtEndFile}
+% \cs{AtBeginFile}\marg{file}\marg{code} inserts \meta{code}
+% just before \meta{file} is input. Similarly \cs{AtEndFile} inserts
+% just after input.
+%
+% \textbf{Breaking change:} In the old implemenation
+% \verb!\AtEndFile{file}! worked for \texttt{file.tex} even if one
+% did not speficy the extension. Now you will need to use
+% \verb!\AtEndFile{file.tex}! explicitly.
+% \begin{macrocode}
+ \newcommand\AtBeginFile[2]{\AddToHook{file/before/#1}{#2}}
+ \newcommand\AtEndFile[2]{\AddToHook{file/after/#1}{#2}}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\AtBeginPackage}
+% \begin{macro}{\AtEndPackage}
+% \begin{macro}{\RequireAtEndPackage}
+% \cs{AtBeginPackage}\marg{pack}\marg{code} inserts \meta{code}
+% just before the \meta{pack} package is input, and \cs{AtEndPackage}
+% is the equivalent for after input. \cs{RequireAtEndPackage} inserts
+% \meta{code} either at the end of \meta{pack}, or immediately if
+% \meta{pack} has already been input.
+% \begin{macrocode}
+ \newcommand\AtBeginPackage[2]{\AddToHook{package/before/#1}{#2}}
+ \newcommand\AtEndPackage[2]{\AddToHook{package/after/#1}{#2}}
+ \newcommand{\RequireAtEndPackage}[2]{%
+ \@ifpackageloaded{#1}{#2}{\AtEndPackage{#1}{#2}}}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\AtBeginClass}
+% \begin{macro}{\AtEndClass}
+% \begin{macro}{\RequireAtEndClass}
+% \cs{AtBeginClass}\marg{class}\marg{code} and friends are the class
+% equivalents of \cs{AtBeginPackage} and friends.
+% \begin{macrocode}
+ \newcommand\AtBeginClass[2]{\AddToHook{class/before/#1}{#2}}
+ \newcommand\AtEndClass[2]{\AddToHook{class/after/#1}{#2}}
+ \newcommand{\RequireAtEndClass}[2]{%
+ \@ifclassloaded{#1}{#2}{\AtEndClass{#1}{#2}}}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macrocode}
+}{% back to the code for older formats
+% \end{macrocode}
+% \noindent
+% Here follows the old code, which will still be used on older formats:
%
% Code, based on a hint from Morten H{\o}gholm\footnote{CTT posting
% 2005/11/08, \textit{Re: Checking for packages froma class...
@@ -913,26 +1006,26 @@
% \changes{3.7i}{2019/10/22}{Added latest kernel changes, special
% thanks to Phelype Oleinik}
% \begin{macrocode}
-\ifcsname InputIfFileExists \endcsname% looking for an explicit space
- % here aka the robust version
- \DeclareRobustCommand \InputIfFileExists[2]{%
- \IfFileExists{#1}%
- {%
- \expandafter\@swaptwoargs\expandafter
- {\@filef@und\m@matendf{#1}\killm@matf{#1}}{%
- #2\@addtofilelist{#1}\m@matbeginf{#1}\@@input%
+ \ifcsname InputIfFileExists \endcsname% looking for an explicit space
+ % here aka the robust version
+ \DeclareRobustCommand \InputIfFileExists[2]{%
+ \IfFileExists{#1}%
+ {%
+ \expandafter\@swaptwoargs\expandafter
+ {\@filef@und\m@matendf{#1}\killm@matf{#1}}{%
+ #2\@addtofilelist{#1}\m@matbeginf{#1}\@@input%
+ }%
}%
- }%
- }
-\else
- % Old definition
-\renewcommand{\InputIfFileExists}[2]{%
- \IfFileExists{#1}%
- {#2\@addtofilelist{#1}\m@matbeginf{#1}%
- \@@input \@filef@und
- \m@matendf{#1}%
- \killm@matf{#1}}}
-\fi
+ }
+ \else
+ % Old definition
+ \renewcommand{\InputIfFileExists}[2]{%
+ \IfFileExists{#1}%
+ {#2\@addtofilelist{#1}\m@matbeginf{#1}%
+ \@@input \@filef@und
+ \m@matendf{#1}%
+ \killm@matf{#1}}}
+ \fi
% \end{macrocode}
% \end{macro}
@@ -943,10 +1036,10 @@
% is defined. Similarly \cs{m@matendf}\marg{file} calls
% \cs{file-m@mfe} if it is defined.
% \begin{macrocode}
-\newcommand{\m@matbeginf}[1]{\@ifundefined{#1-m@mfb}{}%
- {\@nameuse{#1-m@mfb}}}
-\newcommand{\m@matendf}[1]{\@ifundefined{#1-m@mfe}{}%
- {\@nameuse{#1-m@mfe}}}
+ \newcommand{\m@matbeginf}[1]{\@ifundefined{#1-m@mfb}{}%
+ {\@nameuse{#1-m@mfb}}}
+ \newcommand{\m@matendf}[1]{\@ifundefined{#1-m@mfe}{}%
+ {\@nameuse{#1-m@mfe}}}
% \end{macrocode}
% \end{macro}
@@ -955,10 +1048,66 @@
% \begin{macro}{\killm@matf}
% \cs{killm@matf}\marg{file} undefines the \cs{file-m@mfb} and
% \cs{file-m@mfe} macros.
+% ^^A \begin{macrocode}
+% ^^A we use the better defintion below
+% ^^A % \newcommand*{\killm@matf}[1]{%
+% ^^A % \@namelet{#1-m@mfb}\relax
+% ^^A % \@namelet{#1-m@mfe}\relax}
+% ^^A
+% ^^A \end{macrocode}
+%
+% ^^A \subsection{Input files into tabulars, and etex}
+%
+% M.J. Williams (CTT \textit{\cs{noalign} problem with \cs{input} and
+% tabular in memoir class}, 28 Aug 2007) reported that using \cs{input} in a
+% tabular resulted in errors. His example was:
+% \begin{verbatim}
+% ...
+% \begin{tabular}{c|c} \hline
+% 1 & 2 \\ \hline
+% \input{data} \hline
+% 5 & 6 \\ \hline
+% \end{tabular}
+% \end{verbatim}
+% where \texttt{data.tex} contains the single line (and no newline) \\
+% \verb?3 & 4 \\?
+%
+% Morten H{\o}gholm noted that the problem
+% was caused by \Lpack{memoir}'s extension to \cs{input}
+% and gave a solution that depends on processing via
+% \texttt{etex} rather than \texttt{tex}.
+%
+% Here's Morten's fix. Quoting, in part:
+% \begin{quotation}
+% \Lpack{memoir} extends the file loading mechanism by providing
+% \cs{AtBeginFile} and \cs{AtEndFile} whose arguments are executed as
+% the names indicate. \ldots after inputting a file the storage bins are
+% emptied. The problem [in your case] is that this emptying is an
+% assignment and so starts a new tabular cell and \cs{hline} is only
+% allowed after \verb?\\? or other \cs{hline}s.
+%
+% \ldots the tabular environment wraps each tabular cell in additional
+% groups so one can do an explicit test for which type of group we are in.
+% If tested to be in an align group \emph{and} in vertical mode it means
+% TeX hasn't found something to start a new cell and
+% then \cs{noalign} can be used.
+% \end{quotation}
+%
% \begin{macrocode}
-\newcommand*{\killm@matf}[1]{%
- \@namelet{#1-m@mfb}\relax
- \@namelet{#1-m@mfe}\relax}
+ %% \ifetex
+ \newcommand*{\killm@matf}[1]{%
+ \ifnum 6=\currentgrouptype
+ \ifvmode
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \expandafter\expandafter\expandafter\noalign
+ \fi
+ \fi
+ \@firstofone
+ {\@namelet{#1-m@mfb}\relax
+ \@namelet{#1-m@mfe}\relax
+ }%
+ }
+ %% \fi
% \end{macrocode}
% \end{macro}
@@ -969,12 +1118,12 @@
% just before \meta{file} is input. Similarly \cs{AtEndFile} inserts
% just after input.
% \begin{macrocode}
-\newcommand{\AtBeginFile}[2]{\@ifundefined{#1-m@mfb}%
- {\@namedef{#1-m@mfb}{#2}}%
- {\expandafter\addtodef\csname #1-m@mfb\endcsname{}{#2}}}
-\newcommand{\AtEndFile}[2]{\@ifundefined{#1-m@mfe}%
- {\@namedef{#1-m@mfe}{#2}}%
- {\expandafter\addtodef\csname #1-m@mfe\endcsname{}{#2}}}
+ \newcommand{\AtBeginFile}[2]{\@ifundefined{#1-m@mfb}%
+ {\@namedef{#1-m@mfb}{#2}}%
+ {\expandafter\addtodef\csname #1-m@mfb\endcsname{}{#2}}}
+ \newcommand{\AtEndFile}[2]{\@ifundefined{#1-m@mfe}%
+ {\@namedef{#1-m@mfe}{#2}}%
+ {\expandafter\addtodef\csname #1-m@mfe\endcsname{}{#2}}}
% \end{macrocode}
% \end{macro}
@@ -989,13 +1138,13 @@
% \meta{code} either at the end of \meta{pack}, or immediately if
% \meta{pack} has already been input.
% \begin{macrocode}
-\newcommand{\AtBeginPackage}[2]{%
- \AtBeginFile{#1.\@pkgextension}{#2}}
-\newcommand{\AtEndPackage}[2]{%
- \AtEndFile{#1.\@pkgextension}{#2}}
-\newcommand{\RequireAtEndPackage}[2]{%
- \@ifpackageloaded{#1}{#2}%
- {\AtEndFile{#1.\@pkgextension}{#2}}}
+ \newcommand{\AtBeginPackage}[2]{%
+ \AtBeginFile{#1.\@pkgextension}{#2}}
+ \newcommand{\AtEndPackage}[2]{%
+ \AtEndFile{#1.\@pkgextension}{#2}}
+ \newcommand{\RequireAtEndPackage}[2]{%
+ \@ifpackageloaded{#1}{#2}%
+ {\AtEndFile{#1.\@pkgextension}{#2}}}
% \end{macrocode}
% \end{macro}
@@ -1008,19 +1157,22 @@
% \cs{AtBeginClass}\marg{class}\marg{code} and friends are the class
% equivalents of \cs{AtBeginPackage} and friends.
% \begin{macrocode}
-\newcommand{\AtBeginClass}[2]{%
- \AtBeginFile{#1.\@clsextension}{#2}}
-\newcommand{\AtEndClass}[2]{%
- \AtEndFile{#1.\@clsextension}{#2}}
-\newcommand{\RequireAtEndClass}[2]{%
- \@ifclassloaded{#1}{#2}%
- {\AtEndFile{#1.\@clsextension}{#2}}}
+ \newcommand{\AtBeginClass}[2]{%
+ \AtBeginFile{#1.\@clsextension}{#2}}
+ \newcommand{\AtEndClass}[2]{%
+ \AtEndFile{#1.\@clsextension}{#2}}
+ \newcommand{\RequireAtEndClass}[2]{%
+ \@ifclassloaded{#1}{#2}%
+ {\AtEndFile{#1.\@clsextension}{#2}}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
+% \begin{macrocode}
+} % end of els part of format check
+% \end{macrocode}
%
%
%
@@ -18626,61 +18778,6 @@
% \end{macrocode}
%
%
-% \subsection{Input files into tabulars, and etex}
-%
-% M.J. Williams (CTT \textit{\cs{noalign} problem with \cs{input} and
-% tabular in memoir class}, 28 Aug 2007) reported that using \cs{input} in a
-% tabular resulted in errors. His example was:
-% \begin{verbatim}
-% ...
-% \begin{tabular}{c|c} \hline
-% 1 & 2 \\ \hline
-% \input{data} \hline
-% 5 & 6 \\ \hline
-% \end{tabular}
-% \end{verbatim}
-% where \texttt{data.tex} contains the single line (and no newline) \\
-% \verb?3 & 4 \\?
-%
-% Morten H{\o}gholm noted that the problem
-% was caused by \Lpack{memoir}'s extension to \cs{input}
-% and gave a solution that depends on processing via
-% \texttt{etex} rather than \texttt{tex}.
-%
-% Here's Morten's fix. Quoting, in part:
-% \begin{quotation}
-% \Lpack{memoir} extends the file loading mechanism by providing
-% \cs{AtBeginFile} and \cs{AtEndFile} whose arguments are executed as
-% the names indicate. \ldots after inputting a file the storage bins are
-% emptied. The problem [in your case] is that this emptying is an
-% assignment and so starts a new tabular cell and \cs{hline} is only
-% allowed after \verb?\\? or other \cs{hline}s.
-%
-% \ldots the tabular environment wraps each tabular cell in additional
-% groups so one can do an explicit test for which type of group we are in.
-% If tested to be in an align group \emph{and} in vertical mode it means
-% TeX hasn't found something to start a new cell and
-% then \cs{noalign} can be used.
-% \end{quotation}
-%
-% \begin{macrocode}
-\ifetex
- \renewcommand*{\killm@matf}[1]{%
- \ifnum 6=\currentgrouptype
- \ifvmode
- \expandafter\expandafter\expandafter\@firstoftwo
- \expandafter\expandafter\expandafter\noalign
- \fi
- \fi
- \@firstofone
- {\@namelet{#1-m@mfb}\relax
- \@namelet{#1-m@mfe}\relax
- }%
- }
-\fi
-
-% \end{macrocode}
-%
%
% \subsection{Continuous tabulars}
%
@@ -30562,18 +30659,35 @@
% \changes{v1.4}{2003/11/22}{Fiddled \cs{protect} in \cs{trimmaks}
% (from patch v1.7)}
% \changes{v3.6h}{2010/12/05}{Added \cs{trimmarkscolor}}
+% \changes{v3.7m}{2020/08/05}{From the 2020/10/01 format, we don't
+% need the \cs{vskip}\texttt{-1in} and \cs{hskip}\texttt{-1in} as the
+% trimmarks are added in a different manner}
% \begin{macrocode}
\newcommand*\trimmarkscolor{}
+% \end{macrocode}
+% \changes{v3.7m}{2020/08/05}{Factored out two skips}
+% Factoring out two skips to make it easy to remove them in the
+% 2020/10/01 onwards.
+% \begin{macrocode}
+\newcommand\mem@trimmarks@initial@vskip{\vskip-1in}
+\newcommand\mem@trimmarks@initial@hskip{\hskip-1in}
\newcommand*{\trimmarks}{%
- \vbox to \z@{\vskip-1in \vskip\trimtop % top of logical page
- \hb@xt@\z@{\hskip-1in
+ \vbox to \z@{%
+ \mem@trimmarks@initial@vskip%
+ \vskip\trimtop % top of logical page
+ \hb@xt@\z@{%
+ \mem@trimmarks@initial@hskip%
\ifodd\c@page
- \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth
+ \hskip\stockwidth
+ \hskip-\trimedge
+ \hskip-\paperwidth
\else
\if@twoside
\hskip\trimedge % left of logical page
\else
- \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth
+ \hskip\stockwidth
+ \hskip-\trimedge
+ \hskip-\paperwidth
\fi
\fi
\vbox to \paperheight{%
@@ -30583,8 +30697,8 @@
\hb@xt@\paperwidth{\trimmarkscolor\tmarkml\hfil\tmarkmr}%
\vfil
\hb@xt@\paperwidth{\trimmarkscolor\tmarkbl\hfil\tmarkbm\hfil\tmarkbr}}%
- \hss}%
- \vss}}
+ \hss}%
+ \vss}}
% \end{macrocode}
% \end{macro}
@@ -30661,47 +30775,78 @@
\put(-24,-24){\line(0,1){48}}
\put(-24,0){\oval(12,12)}
\end{picture}}}
-\renewcommand*{\trimmarks}{%
-%% \special{papersize=\the\stockwidth,\the\stockheight}
- {%
- \vbox to \z@{\vskip-1in \vskip\trimtop % top of logical page
- \hb@xt@\z@{\hskip-1in
- \ifodd\c@page
- \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth
- \else
- \if@twoside
- \hskip\trimedge % left of logical page
- \else
- \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth
- \fi
- \fi
- \vbox to \paperheight{%
- \let\protect\relax % <- v1.4 addition
+% \end{macrocode}
+%
+% \changes{v3.7m}{2020/08/05}{Removed redefinition of \cs{trimmarks}
+% inside \cs{quarkmarks}, it only adds an extra group compared to the
+% normal \cs{trimmarks}}
+% Removed redefintion of \cmd{\trimmarks}, seemingly no need for it.
+% \begin{macrocode}
+%% \renewcommand*{\trimmarks}{%
+%% %% \special{papersize=\the\stockwidth,\the\stockheight}
+%% {%
+%% \vbox to \z@{\vskip-1in \vskip\trimtop % top of logical page
+%% \hb@xt@\z@{\hskip-1in
+%% \ifodd\c@page
+%% \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth
+%% \else
+%% \if@twoside
+%% \hskip\trimedge % left of logical page
+%% \else
+%% \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth
+%% \fi
+%% \fi
+%% \vbox to \paperheight{%
+%% \let\protect\relax % <- v1.4 addition
% \end{macrocode}
% We remember to add \cs{trimmarkscolor}
% \changes{v3.6h}{2010/12.05}{added \cs{trimmarkscolor}}
% \begin{macrocode}
- \hb@xt@\paperwidth{\trimmarkscolor\tmarktl\hfil\tmarktm\hfil\tmarktr}%
- \vfil
- \hb@xt@\paperwidth{\trimmarkscolor\tmarkml\hfil\tmarkmr}%
- \vfil
- \hb@xt@\paperwidth{\trimmarkscolor\tmarkbl\hfil\tmarkbm\hfil\tmarkbr}}%
- \hss}%
- \vss}}%
-}}
+%% \hb@xt@\paperwidth{\trimmarkscolor\tmarktl\hfil\tmarktm\hfil\tmarktr}%
+%% \vfil
+%% \hb@xt@\paperwidth{\trimmarkscolor\tmarkml\hfil\tmarkmr}%
+%% \vfil
+%% \hb@xt@\paperwidth{\trimmarkscolor\tmarkbl\hfil\tmarkbm\hfil\tmarkbr}}%
+%% \hss}%
+%% \vss}}%
+%% }
+}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%
-% Any marks are put onto the pages by adding to the \cs{shipout}
+% As of the format update 2020/10/01 a hooking mechanism was added
+% to the kernel. One of these provides a hook into the background of
+% the shipped out pages, ideal for adding trimmarks. This hooking
+% system saves us from messing with \cmd{\shipout} direction (in
+% potentially incompatible ways).
+%
+% \changes{v3.7m}{2020/08/05}{Applying a format check and adding
+% trimmarks via hook if available}
+%
+% Note that the hook will be named \texttt{memoir/trimmarks} of easy
+% reference if one ever need to do some order readjustments. See
+% \cite{LTHOOKS,LTSHIPOUT} for more details on the hooking system. The
+% extra \cmd{\ifshowtrims} inside the hook is to accommodate for the
+% \cmd{\showtrimson}/\cmd{\showtrimsoff} commands.
+% \begin{macrocode}
+\IfFormatAtLeastTF{2020/10/01}{
+ \renewcommand\mem@trimmarks@initial@vskip{}
+ \renewcommand\mem@trimmarks@initial@hskip{}
+ \ifshowtrims
+ \AddToHook{shipout/background}[./trimmarks]{\ifshowtrims\put(0,0){\trimmarks}\fi}
+ \fi
+}{
+% \end{macrocode}
+% Here follows then the old code where Any marks are put onto the pages by adding to the \cs{shipout}
% routine.
%
% \begin{macro}{\mem@oldshipout}
% Keep a copy of the current version of \cs{shipout} in \cs{mem@oldshipout}.
% \begin{macrocode}
-\let\mem@oldshipout\shipout
+ \let\mem@oldshipout\shipout
% \end{macrocode}
% \end{macro}
%
@@ -30719,13 +30864,13 @@
% \changes{v1.6180339c}{2009/11/13}{Replaced Dans fix with a fix from
% Heiko Oberdiek}
% \begin{macrocode}
-\newcommand*{\mem@shipi}{%
- \ifvoid\@cclv\expandafter\aftergroup\fi\mem@shipii}
-\newcommand*\mem@shipii{%
- \ifvoid\@cclv
- \mem@oldshipout\box\@cclv
- \else
- \ifshowtrims
+ \newcommand*{\mem@shipi}{%
+ \ifvoid\@cclv\expandafter\aftergroup\fi\mem@shipii}
+ \newcommand*\mem@shipii{%
+ \ifvoid\@cclv
+ \mem@oldshipout\box\@cclv
+ \else
+ \ifshowtrims
% \end{macrocode}
% Heiko Oberdiek responded to a problem reported by Rolf
% Niepraschk. The earlier implementation might cause the output box to
@@ -30740,15 +30885,15 @@
% Heiko also provided the fix used below. Actually Heikos fix also
% fixes a problem that might cause glue settings to disappear.
% \begin{macrocode}
- \mem@oldshipout\vbox{%
- \trimmarks
- \nointerlineskip
- \box\@cclv
- }%
- \else
- \mem@oldshipout\box\@cclv
- \fi
- \fi}
+ \mem@oldshipout\vbox{%
+ \trimmarks
+ \nointerlineskip
+ \box\@cclv
+ }%
+ \else
+ \mem@oldshipout\box\@cclv
+ \fi
+ \fi}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -30758,13 +30903,15 @@
% \Lopt{showtrims} option. This adds \cs{mem@shipi} to the page box
% which then calls the original version of \cs{shipout}.
% \begin{macrocode}
-\ifshowtrims
- \renewcommand*{\shipout}{\afterassignment\mem@shipi\setbox\@cclv=}
-\fi
-
+ \ifshowtrims
+ \renewcommand*{\shipout}{\afterassignment\mem@shipi\setbox\@cclv=}
+ \fi
% \end{macrocode}
% \end{macro}
-%
+% \begin{macrocode}
+} % end format check, else part
+
+% \end{macrocode}
%
% \section{Verbatims, boxes, and files}
%
@@ -36471,11 +36618,12 @@
% \begin{macrocode}
%%% revert changes to captioning macros if the caption package is used.
\AtBeginPackage{caption}{
- \ClassWarningNoLine{memoir}{%
+ %\ClassWarningNoLine{memoir}{%
+ \ClassInfo{memoir}{%
For the caption package to function properly with memoir,
- we will now reset\string\caption\space and friends to
- kernel defaults and then let the caption package take over.
- Remember: all caption configuration now goves via the caption
+ we will now reset \string\caption\space and friends to
+ kernel defaults and then let the^^Jcaption package take over.
+ Remember: all caption configuration now goes via the caption
package interface, not the interface from the memoir class.
}
@@ -36769,7 +36917,7 @@ keyword "\\glossaryentry"
%
% \bibitem[GMS94]{GOOSSENS94}
% Michel Goossens, Frank Mittelbach, and Alexander Samarin.
-% \newblock {\em The LaTeX Companion}.
+% \newblock \emph{The LaTeX Companion}.
% \newblock Addison-Wesley Publishing Company, 1994.
%
%
@@ -36814,6 +36962,21 @@ keyword "\\glossaryentry"
% \newblock (Available from CTAN in
% \texttt{/macros/latex/required/tools})
%
+% \bibitem[Mit2020a]{LTFILEHOOK}
+% Frank Mittelbach
+% \newblock \emph{The ltfilehook package}
+% \newblock July 2020.
+%
+% \bibitem[Mit2020b]{LTHOOKS}
+% Frank Mittelbach
+% \newblock \emph{The lthooks package}
+% \newblock July 2020.
+%
+% \bibitem[Mit2020c]{LTSHIPOUT}
+% Frank Mittelbach
+% \newblock \emph{The ltshipout package}
+% \newblock July 2020.
+%
% \bibitem[Oos96]{FANCYHDR}
% Piet van Oostrum.
% \newblock \emph{Page layout in LaTeX}.
diff --git a/macros/latex/contrib/semantex/semantex.pdf b/macros/latex/contrib/semantex/semantex.pdf
index 7fc0a4927a..b59654a54c 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 2da252301b..80825c4d44 100644
--- a/macros/latex/contrib/semantex/semantex.sty
+++ b/macros/latex/contrib/semantex/semantex.sty
@@ -1,5 +1,5 @@
-\RequirePackage{xparse,l3keys2e,semtex,leftindex}
-\ProvidesExplPackage{semantex}{2020/09/08}{0.41beta}{}
+\RequirePackage{xparse,l3keys2e,leftindex}
+\ProvidesExplPackage{semantex}{2020/09/10}{0.42}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
@@ -29,6 +29,94 @@
\keys_set:nn { semantex } { #1 }
}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% THE FOLLOWING SECTION IS IDENTICAL TO THE semtex PACKAGE
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% These are some essential commands that are needed for bullets and parentheses,
+% and they are the only ones that will not be stripped by running the
+% stripsemantex algorithm. Therefore, they are also available as a standalone
+% package, called "semtex". This name is meant to suggest "stripped SemanTeX",
+% and at the same time, semtex is the name of a plastic explosive, suggesting
+% "blown-up SemanTeX".
+% (Mathematicians are not famous for the quality of their humour.)
+
+% Bullets:
+
+\box_if_exist:NF \g__semantex_bullet_box
+{
+ \box_new:N \g__semantex_bullet_box
+ \hbox_set:Nn \g__semantex_bullet_box { $\cdot$ }
+ \box_scale:Nnn \g__semantex_bullet_box {1.2} {1.2}
+ \tl_set:Nn\g_semantex_bullet
+ {
+ \box_move_up:nn{-0.25ex}{\box_use:N \g__semantex_bullet_box}
+ }
+
+ \tl_set:Nn\g_semantex_double_bullet{\g_semantex_bullet \g_semantex_bullet}
+
+ \tl_set_eq:NN\SemantexBullet \g_semantex_bullet
+
+ \tl_set_eq:NN \SemantexDoubleBullet \g_semantex_double_bullet
+}
+
+% Parentheses:
+
+\cs_set:Npn\SemantexLeft { \mathopen{}\mathclose\bgroup\left }
+
+\cs_set:Npn\SemantexRight { \aftergroup\egroup\right }
+
+\tl_set:Nn\SemantexDelimiterSize{}
+
+\DeclareDocumentCommand\SemantexParentheses { mmmm }
+{
+ \str_case:nnF { #1 } % This is where \big,\Big, etc. go.
+ {
+ { normal } {
+ \group_begin:
+ \tl_clear:N \SemantexDelimiterSize
+ \str_if_eq:nnF { #2 } { . } { \mathopen #2 }
+ #4
+ \str_if_eq:nnF { #3 } { . } { \mathclose #3 }
+ \group_end:
+ }
+ { auto } {
+ \group_begin:
+ \tl_set_eq:NN \SemantexDelimiterSize \middle
+ \SemantexLeft #2
+ #4
+ \SemantexRight #3
+ \group_end:
+ }
+ { * } {
+ \group_begin:
+ \tl_set_eq:NN \SemantexDelimiterSize \middle
+ \SemantexLeft #2
+ #4
+ \SemantexRight #3
+ \group_end:
+ }
+ }
+ {
+ \group_begin:
+ \tl_set_eq:NN\SemantexDelimiterSize #1
+ \mathopen #1 #2
+ #4
+ \mathclose #1 #3
+ \group_end:
+ }
+}
+
+\DeclareDocumentCommand\SemantexNoParentheses { m }
+{
+ \group_begin:
+ \tl_clear:N\SemantexDelimiterSize
+ #1
+ \group_end:
+}
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% THE .semtex FILE
@@ -1830,29 +1918,19 @@
\cs_new_protected:Npn\semantex_right_return:n#1
{
- \semantex_right_indices_return_store:nN { #1 }
- \l__semantex_rightreturn_right_indices_temp
- \semantex_data_tl_put_right:nnx { #1 } { symbol }
- {
- \exp_not:V \l__semantex_rightreturn_right_indices_temp
- }
- \semantex_data_bool_get:nnTF { #1 } { leftargument }
- {
- % do nothing
- }
- {
- \semantex_arg_return_store:nN { #1 } \l__semantex_rightreturn_arg_temp
- \semantex_data_tl_put_right:nnx { #1 } { symbol }
- {
- \exp_not:V
- \l__semantex_rightreturn_arg_temp
- }
- \semantex_data_tl_clear:nn { #1 } { arg }
- \semantex_data_tl_clear:nn { #1 } { prearg }
- \semantex_data_tl_clear:nn { #1 } { postarg }
- \semantex_data_int_clear:nn { #1 } { numberofarguments }
- \semantex_data_bool_set_false:nn { #1 } { nextargwithsep }
- }
+ \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 }
\semantex_data_tl_clear:nn { #1 } { upper }
\semantex_data_tl_clear:nn { #1 } { preupper }
\semantex_data_tl_clear:nn { #1 } { postupper }
@@ -1865,30 +1943,17 @@
\semantex_data_int_clear:nn { #1 } { numberoflowerindices }
}
-\cs_new_protected:Npn\semantex_right_pre_return:n#1
+\cs_new_protected:Npn\semantex_right_indices_pre_return:n#1
{
- \semantex_right_indices_return_store:nN { #1 }
+ \_semantex_right_index_return_store:nN { #1 }
\l__semantex_rightreturn_right_indices_temp
\semantex_data_tl_put_right:nnx { #1 } { symbol }
{
\exp_not:V \l__semantex_rightreturn_right_indices_temp
}
- \semantex_data_bool_get:nnTF { #1 } { leftargument }
- {
- % do nothing
- }
- {
- \semantex_arg_return_store:nN { #1 } \l__semantex_rightreturn_arg_temp
- \semantex_data_tl_put_right:nnx { #1 } { symbol }
- {
- \exp_not:V
- \l__semantex_rightreturn_arg_temp
- }
- }
}
-
-\cs_new_protected:Npn \semantex_right_indices_return_store:nN#1#2
+\cs_new_protected:Npn \_semantex_right_index_return_store:nN#1#2
{
\tl_set:Nn#2{}
\semantex_data_int_if_positive:nnTF { #1 } { numberoflowerindices }
@@ -1923,28 +1988,19 @@
\cs_new_protected:Npn\semantex_left_return:n#1
{
- \semantex_left_indices_return_store:nN { #1 }
- \l__semantex_leftreturn_left_indices_temp
- \semantex_data_tl_put_left:nnx { #1 } { symbol }
- {
- \exp_not:V \l__semantex_leftreturn_left_indices_temp
- }
- \semantex_data_bool_get:nnTF { #1 } { leftargument }
- {
- \semantex_arg_return_store:nN { #1 } \l__semantex_leftreturn_arg_temp
- \semantex_data_tl_put_left:nnx { #1 } { symbol }
- {
- \exp_not:V \l__semantex_leftreturn_arg_temp
- }
- \semantex_data_tl_clear:nn { #1 } { arg }
- \semantex_data_tl_clear:nn { #1 } { prearg }
- \semantex_data_tl_clear:nn { #1 } { postarg }
- \semantex_data_int_clear:nn { #1 } { numberofarguments }
- \semantex_data_bool_set_false:nn { #1 } { nextargwithsep }
- }
- {
- % do nothing
- }
+ \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 }
\semantex_data_tl_clear:nn { #1 } { upperleft }
\semantex_data_tl_clear:nn { #1 } { preupperleft }
\semantex_data_tl_clear:nn { #1 } { postupperleft }
@@ -1962,28 +2018,17 @@
\semantex_data_tl_clear:nn { #1 } { slantingphantom }
}
-\cs_new_protected:Npn\semantex_left_pre_return:n#1
+\cs_new_protected:Npn\semantex_left_indices_pre_return:n#1
{
- \semantex_left_indices_return_store:nN { #1 }
+ \_semantex_left_index_return_store:nN { #1 }
\l__semantex_leftreturn_left_indices_temp
\semantex_data_tl_put_left:nnx { #1 } { symbol }
{
\exp_not:V \l__semantex_leftreturn_left_indices_temp
}
- \semantex_data_bool_get:nnTF { #1 } { leftargument }
- {
- \semantex_arg_return_store:nN { #1 } \l__semantex_leftreturn_arg_temp
- \semantex_data_tl_put_left:nnx { #1 } { symbol }
- {
- \exp_not:V \l__semantex_leftreturn_arg_temp
- }
- }
- {
- % do nothing
- }
}
-\cs_new_protected:Npn \semantex_left_indices_return_store:nN#1#2
+\cs_new_protected:Npn \_semantex_left_index_return_store:nN#1#2
{
\tl_set:Nn#2{}
\semantex_data_int_if_positive:nnTF { #1 } { numberofupperleftindices }
@@ -2039,8 +2084,109 @@
}
}
+\cs_new_protected:Npn\semantex_right_arg_return:n#1
+{
+ \semantex_data_bool_get:nnTF { #1 } { leftargument }
+ {
+ % do nothing
+ }
+ {
+ \_semantex_arg_return_store:nN { #1 } \l__semantex_rightreturn_arg_temp
+ \semantex_data_tl_put_right:nnx { #1 } { symbol }
+ {
+ \exp_not:V
+ \l__semantex_rightreturn_arg_temp
+ }
+ \semantex_data_tl_clear:nn { #1 } { arg }
+ \semantex_data_tl_clear:nn { #1 } { prearg }
+ \semantex_data_tl_clear:nn { #1 } { postarg }
+ \semantex_data_int_clear:nn { #1 } { numberofarguments }
+ \semantex_data_bool_set_false:nn { #1 } { nextargwithsep }
+ }
+}
+
+\cs_new_protected:Npn\semantex_right_arg_pre_return:n#1
+{
+ \semantex_data_bool_get:nnTF { #1 } { leftargument }
+ {
+ % do nothing
+ }
+ {
+ \_semantex_arg_return_store:nN { #1 } \l__semantex_rightreturn_arg_temp
+ \semantex_data_tl_put_right:nnx { #1 } { symbol }
+ {
+ \exp_not:V
+ \l__semantex_rightreturn_arg_temp
+ }
+ }
+}
+
+\cs_new_protected:Npn\semantex_left_arg_return:n#1
+{
+ \semantex_data_bool_get:nnTF { #1 } { leftargument }
+ {
+ \_semantex_arg_return_store:nN { #1 } \l__semantex_leftreturn_arg_temp
+ \semantex_data_tl_put_left:nnx { #1 } { symbol }
+ {
+ \exp_not:V \l__semantex_leftreturn_arg_temp
+ }
+ \semantex_data_tl_clear:nn { #1 } { arg }
+ \semantex_data_tl_clear:nn { #1 } { prearg }
+ \semantex_data_tl_clear:nn { #1 } { postarg }
+ \semantex_data_int_clear:nn { #1 } { numberofarguments }
+ \semantex_data_bool_set_false:nn { #1 } { nextargwithsep }
+ }
+ {
+ % do nothing
+ }
+}
+
+\cs_new_protected:Npn\semantex_left_arg_pre_return:n#1
+{
+ \semantex_data_bool_get:nnTF { #1 } { leftargument }
+ {
+ \_semantex_arg_return_store:nN { #1 } \l__semantex_leftreturn_arg_temp
+ \semantex_data_tl_put_left:nnx { #1 } { symbol }
+ {
+ \exp_not:V \l__semantex_leftreturn_arg_temp
+ }
+ }
+ {
+ % do nothing
+ }
+}
+
+\cs_new_protected:Npn\semantex_arg_return:n#1
+{
+ \semantex_arg_pre_return:n { #1 }
+ \semantex_data_tl_clear:nn { #1 } { arg }
+ \semantex_data_tl_clear:nn { #1 } { prearg }
+ \semantex_data_tl_clear:nn { #1 } { postarg }
+ \semantex_data_int_clear:nn { #1 } { numberofarguments }
+ \semantex_data_bool_set_false:nn { #1 } { nextargwithsep }
+}
+
+\cs_new_protected:Npn\semantex_arg_pre_return:n#1
+{
+ \semantex_data_bool_get:nnTF { #1 } { leftargument }
+ {
+ \_semantex_arg_return_store:nN { #1 } \l__semantex_leftreturn_arg_temp
+ \semantex_data_tl_put_left:nnx { #1 } { symbol }
+ {
+ \exp_not:V \l__semantex_leftreturn_arg_temp
+ }
+ }
+ {
+ \_semantex_arg_return_store:nN { #1 } \l__semantex_rightreturn_arg_temp
+ \semantex_data_tl_put_right:nnx { #1 } { symbol }
+ {
+ \exp_not:V
+ \l__semantex_rightreturn_arg_temp
+ }
+ }
+}
-\cs_new_protected:Npn \semantex_arg_return_store:nN#1#2
+\cs_new_protected:Npn \_semantex_arg_return_store:nN#1#2
{
\semantex_data_tl_get_store:nnN { #1 } { parsize } \l__arg_return_store_parsize_temp_tl
\semantex_data_bool_get:nnTF { #1 } { par }
@@ -5577,6 +5723,12 @@
{innerreturn}{ execute={ \semantex_inner_return:n { ##1 } } },
{rightreturn}{ execute={ \semantex_right_return:n { ##1 } } },
{leftreturn}{ execute={ \semantex_left_return:n { ##1 } } },
+ {rightindexreturn}{ execute={ \semantex_right_index_return:n { ##1 } } },
+ {leftindexreturn}{ execute={ \semantex_left_index_return:n { ##1 } } },
+ {indexreturn}{ leftindexreturn, rightindexreturn },
+ {rightargreturn}{ execute={ \semantex_right_arg_return:n { ##1 } } },
+ {leftargreturn}{ execute={ \semantex_left_arg_return:n { ##1 } } },
+ {argreturn}{ execute={ \semantex_arg_return:n { ##1 } } },
{parse}{ execute={ \semantex_parse:n { ##1 } } },
{clearcommand}{ execute={ \semantex_data_seq_clear:nn { ##1 } { commands_sequence } } },
{...}{sidots},
diff --git a/macros/latex/contrib/semantex/semantex.tex b/macros/latex/contrib/semantex/semantex.tex
index ca5f0cc8be..a2b7f200f1 100644
--- a/macros/latex/contrib/semantex/semantex.tex
+++ b/macros/latex/contrib/semantex/semantex.tex
@@ -38,7 +38,7 @@
\usepackage[nameinlink]{cleveref}
-\title{Seman\!\TeX: semantic, keyval-based mathematics (v$0.41\beta$)}
+\title{Seman\!\TeX: semantic, keyval-based mathematics (v0.42)}
\date{\today}
\author{Sebastian Ørsted (\href{mailto:sorsted@gmail.com}{sorsted@gmail.com})}
@@ -2357,7 +2357,7 @@ HTML-like syntax, e.g.:
\begin{LTXexample}
$ \GL[order=\vn,field=\vk] $,
$ \Mat[rows=\vm,columns=\vn,
- field=\vk] $,
+ field=\vk] $,
$ \co[d=0,coef=\vR,space=\vX] $
\end{LTXexample}
The \lstinline!parse! routine is a collection of code which is
@@ -2367,6 +2367,15 @@ By default, the parse routine contains no code.
However, you can add code to it using the
key~\mylst!parseoptions={$\<keys\>$}!.
+Even though the \lstinline!parse!~routine is automatically invoked right before rendering, you can also invoke it at any time by force
+using the key~\lstinline!parse!. This will also empty the code from the
+\lstinline!parse!~routine so that it will not be executed twice:
+\begin{LTXexample}
+$ \GL[order=\vn,field=\vk,parse,
+ spar,op] $
+\end{LTXexample}
+(here we used the key~\lstinline!op! from \cref{sec:algebra}).
+
\section{Example: Matrix sets and groups}
Suppose we want to be able to write the group of invertible \( \vn \times \vn \)-matrices with entries in~\( \vk \)
@@ -3426,6 +3435,36 @@ In the following sections, we include the full list.
Invokes the inner return routine.
\item
+ \mylst!leftindexreturn!
+
+ Adds the left indices to the symbol, but not the left argument, if any such exists.
+
+ \item
+ \mylst!rightindexreturn!
+
+ Adds the right indices to the symbol, but not the right argument, if any such exists.
+
+ \item
+ \mylst!indexreturn!
+
+ Adds all indices to the symbol, left and right, but not the argument, if any such exists.
+
+ \item
+ \mylst!leftargreturn!
+
+ Adds the left argument, if any such exists, to the symbol, otherwise does nothing.
+
+ \item
+ \mylst!rightargreturn!
+
+ Adds the right argument, if any such exists, to the symbol, otherwise does nothing.
+
+ \item
+ \mylst!argreturn!
+
+ Adds the argument, if any such exists, to the symbol, otherwise does nothing.
+
+ \item
\mylst!output={$\<Class\>$}!
Sets the output class to~\<Class\>.
diff --git a/macros/latex/contrib/semantex/semtex.sty b/macros/latex/contrib/semantex/semtex.sty
deleted file mode 100644
index 3b9196c361..0000000000
--- a/macros/latex/contrib/semantex/semtex.sty
+++ /dev/null
@@ -1,83 +0,0 @@
-\RequirePackage{xparse}
-\ProvidesExplPackage{semtex}{2020/07/29}{0.1beta}{}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% semtex -- for documents stripped of SemanTeX markup %
-% https://ctan.org/pkg/semantex %
-% (C) 2020 Sebastian Ørsted %
-% sorsted@gmail.com %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-% Bullets:
-
-\box_new:N \g__semantex_bullet_box
-\hbox_set:Nn \g__semantex_bullet_box { $\cdot$ }
-\box_scale:Nnn \g__semantex_bullet_box {1.2} {1.2}
-\tl_set:Nn\g_semantex_bullet
-{
- \box_move_up:nn{-0.25ex}{\box_use:N \g__semantex_bullet_box}
-}
-
-\tl_set:Nn\g_semantex_double_bullet{\g_semantex_bullet \g_semantex_bullet}
-
-\tl_set_eq:NN\SemantexBullet \g_semantex_bullet
-
-\tl_set_eq:NN \SemantexDoubleBullet \g_semantex_double_bullet
-
-
-% Parentheses:
-
-\cs_new:Npn\SemantexLeft { \mathopen{}\mathclose\bgroup\left }
-
-\cs_new:Npn\SemantexRight { \aftergroup\egroup\right }
-
-\tl_new:N\SemantexDelimiterSize
-
-\DeclareDocumentCommand\SemantexParentheses { mmmm }
-{
- \str_case:nnF { #1 } % This is where \big,\Big, etc. go.
- {
- { normal } {
- \group_begin:
- \tl_clear:N \SemantexDelimiterSize
- \str_if_eq:nnF { #2 } { . } { \mathopen #2 }
- #4
- \str_if_eq:nnF { #3 } { . } { \mathclose #3 }
- \group_end:
- }
- { auto } {
- \group_begin:
- \tl_set_eq:NN \SemantexDelimiterSize \middle
- \SemantexLeft #2
- #4
- \SemantexRight #3
- \group_end:
- }
- { * } {
- \group_begin:
- \tl_set_eq:NN \SemantexDelimiterSize \middle
- \SemantexLeft #2
- #4
- \SemantexRight #3
- \group_end:
- }
- }
- {
- \group_begin:
- \tl_set_eq:NN\SemantexDelimiterSize #1
- \mathopen #1 #2
- #4
- \mathclose #1 #3
- \group_end:
- }
-}
-
-\DeclareDocumentCommand\SemantexNoParentheses { m }
-{
- \group_begin:
- \tl_clear:N\SemantexDelimiterSize
- #1
- \group_end:
-} \ No newline at end of file
diff --git a/macros/latex/contrib/semantex/stripsemantex.lua b/macros/latex/contrib/semantex/stripsemantex.lua
index ba3eb9f2da..1ebce1f716 100644
--- a/macros/latex/contrib/semantex/stripsemantex.lua
+++ b/macros/latex/contrib/semantex/stripsemantex.lua
@@ -195,6 +195,11 @@ semantexIDluacommand = function(id, source, output)
output = output:gsub('\\mathclose \\rvert', '\\rvert')
output = output:gsub('\\mathopen \\lVert', '\\rVert')
output = output:gsub('\\mathclose \\rVert', '\\rVert')
+ output = output:gsub('%^{\\prime }', '\'')
+ output = output:gsub('%^{\\prime \\prime }', '\'\'')
+ output = output:gsub('%^{\\prime \\prime \\prime }', '\'\'\'')
+ output = output:gsub('%^{\\prime \\prime \\prime \\prime }', '\'\'\'\'')
+ output = output:gsub('%^{\\prime \\prime \\prime \\prime \\prime }', '\'\'\'\'\'')
output = output:gsub('%s+%f[{}%[%]%(%)%$,]','')
output = output:gsub('([}%]%)])%f[\\%w%+%-%(%[=]', '%1 ')
diff --git a/macros/latex/contrib/semantex/stripsemantex.sty b/macros/latex/contrib/semantex/stripsemantex.sty
index 96c40fdb87..19d3bc7db4 100644
--- a/macros/latex/contrib/semantex/stripsemantex.sty
+++ b/macros/latex/contrib/semantex/stripsemantex.sty
@@ -1,5 +1,5 @@
\RequirePackage{xparse}
-\ProvidesExplPackage{stripsemantex}{2020/09/05}{0.1alpha}{}
+\ProvidesExplPackage{stripsemantex}{2020/09/10}{0.42}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
diff --git a/macros/latex/contrib/semtex/semtex.pdf b/macros/latex/contrib/semtex/semtex.pdf
index 5ac49589d8..3fe2797582 100644
--- a/macros/latex/contrib/semtex/semtex.pdf
+++ b/macros/latex/contrib/semtex/semtex.pdf
Binary files differ
diff --git a/macros/latex/contrib/semtex/semtex.sty b/macros/latex/contrib/semtex/semtex.sty
index 1824d0389c..f7d979205d 100644
--- a/macros/latex/contrib/semtex/semtex.sty
+++ b/macros/latex/contrib/semtex/semtex.sty
@@ -1,5 +1,5 @@
\RequirePackage{xparse}
-\ProvidesExplPackage{semtex}{2020/09/07}{0.1beta}{}
+\ProvidesExplPackage{semtex}{2020/09/10}{0.2}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
@@ -12,28 +12,30 @@
% Bullets:
-\box_new:N \g__semantex_bullet_box
-\hbox_set:Nn \g__semantex_bullet_box { $\cdot$ }
-\box_scale:Nnn \g__semantex_bullet_box {1.2} {1.2}
-\tl_set:Nn\g_semantex_bullet
+\box_if_exist:NF \g__semantex_bullet_box
{
- \box_move_up:nn{-0.25ex}{\box_use:N \g__semantex_bullet_box}
-}
-
-\tl_set:Nn\g_semantex_double_bullet{\g_semantex_bullet \g_semantex_bullet}
-
-\tl_set_eq:NN\SemantexBullet \g_semantex_bullet
-
-\tl_set_eq:NN \SemantexDoubleBullet \g_semantex_double_bullet
+ \box_new:N \g__semantex_bullet_box
+ \hbox_set:Nn \g__semantex_bullet_box { $\cdot$ }
+ \box_scale:Nnn \g__semantex_bullet_box {1.2} {1.2}
+ \tl_set:Nn\g_semantex_bullet
+ {
+ \box_move_up:nn{-0.25ex}{\box_use:N \g__semantex_bullet_box}
+ }
+ \tl_set:Nn\g_semantex_double_bullet{\g_semantex_bullet \g_semantex_bullet}
+
+ \tl_set_eq:NN\SemantexBullet \g_semantex_bullet
+
+ \tl_set_eq:NN \SemantexDoubleBullet \g_semantex_double_bullet
+}
% Parentheses:
-\cs_new:Npn\SemantexLeft { \mathopen{}\mathclose\bgroup\left }
+\cs_set:Npn\SemantexLeft { \mathopen{}\mathclose\bgroup\left }
-\cs_new:Npn\SemantexRight { \aftergroup\egroup\right }
+\cs_set:Npn\SemantexRight { \aftergroup\egroup\right }
-\tl_new:N\SemantexDelimiterSize
+\tl_set:Nn\SemantexDelimiterSize{}
\DeclareDocumentCommand\SemantexParentheses { mmmm }
{
diff --git a/macros/latex/contrib/semtex/semtex.tex b/macros/latex/contrib/semtex/semtex.tex
index 10805c37bd..45e64e16da 100644
--- a/macros/latex/contrib/semtex/semtex.tex
+++ b/macros/latex/contrib/semtex/semtex.tex
@@ -38,7 +38,7 @@
\usepackage[nameinlink]{cleveref}
-\title{\texttt{semtex}: For stripped Seman\!\TeX\ documents (v$0.1\beta$)}
+\title{\texttt{semtex}: For stripped Seman\!\TeX\ documents (v0.2)}
\date{\today}
\author{Sebastian Ørsted (\href{mailto:sorsted@gmail.com}{sorsted@gmail.com})}