summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-12-22 03:01:35 +0000
committerNorbert Preining <norbert@preining.info>2021-12-22 03:01:35 +0000
commit9105ca38c03b7a88ed0c306472d9560cc5f206bd (patch)
treec3fb0be880a7aa14f36f5d05a0137c9ee61d9603 /macros
parent3bffd8b7dfcee8333bb2841ea194a0daa26af8cd (diff)
CTAN sync 202112220301
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx7
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin593475 -> 593497 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex6
-rw-r--r--macros/latex/contrib/fancyvrb/Changes1
-rw-r--r--macros/latex/contrib/fancyvrb/doc/fancyvrb-doc.pdfbin141135 -> 141124 bytes
-rw-r--r--macros/latex/contrib/fancyvrb/doc/fancyvrb-doc.tex20
-rw-r--r--macros/latex/contrib/fancyvrb/latex/fancyvrb.sty6
-rw-r--r--macros/latex/contrib/spbmark/spbmark.pdfbin70115 -> 70953 bytes
-rw-r--r--macros/latex/contrib/spbmark/spbmark.sty9
-rw-r--r--macros/latex/contrib/spbmark/spbmark.tex11
-rw-r--r--macros/luatex/generic/autopuncitems/README.md28
-rw-r--r--macros/luatex/generic/autopuncitems/autopuncitems.lua106
-rw-r--r--macros/luatex/generic/autopuncitems/autopuncitems.pdfbin0 -> 35326 bytes
-rw-r--r--macros/luatex/generic/autopuncitems/autopuncitems.sty56
-rw-r--r--macros/luatex/generic/autopuncitems/autopuncitems.tex201
15 files changed, 433 insertions, 18 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 2081fc7d3d..45926cc09e 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/12/20}{1.42}
+\ProvidesExplClass{easybook}{2021/12/20}{1.42A}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -307,7 +307,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2021/12/20}{1.42}
+\ProvidesExplPackage{easybase}{2021/12/20}{1.42A}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -405,6 +405,7 @@
\cs_new_protected:Npn \eb_at_end_preamble:n
{ \BeforeBeginEnvironment{document} }
\cs_gset_eq:NN \PackageWarning \PackageInfo
+\msg_redirect_module:nnn { hooks } { warning } { info }
\bool_set_true:N \l__eb_class_mode_book_bool
\bool_set_false:N \l__eb_compile_draft_bool
@@ -2430,7 +2431,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/20}{1.42}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/12/20}{1.42A}
{Customization of tcolorbox for easybook}
\cs_set_protected:Npn \setexercise #1
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index 6ddf277387..9447e54476 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex
index 5b20e761a2..00bfeac3aa 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -20,7 +20,7 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK 使用手册,
- version = v1.42,
+ version = v1.42A,
date = 2021/12/20,
authors = 瞿毅,
info = 排版简体中文学位论文和书籍,
@@ -369,7 +369,7 @@
关于这三个命令键值列表中共同的选项如下所示。如果 \option{vmove}、\option{hmove} 和 \option{cmd} 选项用于 \module*{style} 模块的全局设置,它们将根据前面最近一个命令的类型设定相应值。
\begin{options}
\keyval-{vmove}{刚性长度}\Default{0pt}
- 上标或下标的垂直偏移。如果是上下标命令使用则代表上标和上标间的垂直距离 \option{vsep}。
+ 上标或下标的垂直偏移。如果是上下标命令使用则代表上标和上标间的额外垂直距离 \option{vsep}。
\keyval-{hmove}{刚性长度}\Default{0pt}
上标或下标的水平偏移。如果是上下标命令使用则代表上标和上标的共同偏移。
\keyval-{cmd}{格式命令}\Default
@@ -480,7 +480,7 @@
\kvsplit{spbcmd}{上标格式,下标格式}\Default
上下标命令 \cs{supersub} 对应的上下标格式命令。以英文逗号分隔为前后两个部分分别设置上下标格式,也可以只有前部分,表示上标的格式。
\keyval-{vsep}{刚性长度}\Default{0.6ex}
- 上下标命令 \cs{supersub} 对应的上下标垂直距离。
+ 上下标命令 \cs{supersub} 对应的上下标额外垂直距离。
\keychoice{halign}{l,c,r}\Default{l}
上下标命令 \cs{supersub} 对应的上下标水平对齐方式,有左 \code{l}、居中 \code{c} 和右 \code{r} 三种对齐方式。
\end{options}
diff --git a/macros/latex/contrib/fancyvrb/Changes b/macros/latex/contrib/fancyvrb/Changes
index 31b72a061c..c903c62ef2 100644
--- a/macros/latex/contrib/fancyvrb/Changes
+++ b/macros/latex/contrib/fancyvrb/Changes
@@ -1,4 +1,5 @@
--- fancyvrb.sty
+4.1b 2021/12/21 - fix for ~ in message (hv)
4.1a 2021/11/24 - updated filedate (hv)
4.1 2021/11/24 - make lastline without argument possible (hv)
4.0 2021/11/19 - added lastline=0 for no output (hv)
diff --git a/macros/latex/contrib/fancyvrb/doc/fancyvrb-doc.pdf b/macros/latex/contrib/fancyvrb/doc/fancyvrb-doc.pdf
index 532bcc51d2..55ccaceaab 100644
--- a/macros/latex/contrib/fancyvrb/doc/fancyvrb-doc.pdf
+++ b/macros/latex/contrib/fancyvrb/doc/fancyvrb-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/fancyvrb/doc/fancyvrb-doc.tex b/macros/latex/contrib/fancyvrb/doc/fancyvrb-doc.tex
index 434aa99f99..40cb65ff83 100644
--- a/macros/latex/contrib/fancyvrb/doc/fancyvrb-doc.tex
+++ b/macros/latex/contrib/fancyvrb/doc/fancyvrb-doc.tex
@@ -678,8 +678,22 @@ numbering, and the counter used is \texttt{FancyVerbLine}:
\begin{optlist}
\item[firstline (integer)]: first line to print
(\emph{Default: empty} \Dash all lines from the first are printed).
+ \item[lastline (integer)]: last line to print
+ (\emph{Default: empty} \Dash all lines until the last one are printed).
\end{optlist}
+
+\begin{SideBySideExample}
+ \begin{Verbatim}[gobble=2,firstline,lastline,
+ numbers=left,numbersep=2pt]
+ First verbatim line.
+ Second verbatim line.
+ Third verbatim line.
+ \end{Verbatim}
+\end{SideBySideExample}
+
+
+
\begin{SideBySideExample}
\begin{Verbatim}[gobble=2,firstline=2,
numbers=left,numbersep=2pt]
@@ -689,10 +703,6 @@ numbering, and the counter used is \texttt{FancyVerbLine}:
\end{Verbatim}
\end{SideBySideExample}
-\begin{optlist}
- \item[lastline (integer)]: last line to print
- (\emph{Default: empty} \Dash all lines until the last one are printed).
-\end{optlist}
\begin{SideBySideExample}
\begin{Verbatim}[gobble=2,lastline=1,
@@ -714,7 +724,7 @@ bit klunky. Initially you must define the strings with
\begin{SideBySideExample}[gobble=2]
\newcommand*\FancyVerbStartString{FROM}
- \renewcommand*\FancyVerbStopString{TO}
+ \newcommand*\FancyVerbStopString{TO}
\begin{Verbatim}
First verbatim line.
FROM
diff --git a/macros/latex/contrib/fancyvrb/latex/fancyvrb.sty b/macros/latex/contrib/fancyvrb/latex/fancyvrb.sty
index 75f418e7be..86fdbef54e 100644
--- a/macros/latex/contrib/fancyvrb/latex/fancyvrb.sty
+++ b/macros/latex/contrib/fancyvrb/latex/fancyvrb.sty
@@ -13,9 +13,9 @@
%% verbatim environments and commands and extensive documentation.
%%
\NeedsTeXFormat{LaTeX2e}
-\def\fileversion{4.1a}
-\def\filedate{2021/11/24}
-\ProvidesPackage{fancyvrb}[\filedate~ \fileversion ~verbatim text (tvz,hv)]
+\def\fileversion{4.1b}
+\def\filedate{2021/12/21}
+\ProvidesPackage{fancyvrb}[\filedate\space \fileversion\space verbatim text (tvz,hv)]
%\message{Style option: `fancyvrb' v\fileversion \space <\filedate> (tvz)}
\csname fancyvrb@loaded\endcsname
\let\fancyvrb@loaded\endinput
diff --git a/macros/latex/contrib/spbmark/spbmark.pdf b/macros/latex/contrib/spbmark/spbmark.pdf
index 0dc97fd394..90254e4b4e 100644
--- a/macros/latex/contrib/spbmark/spbmark.pdf
+++ b/macros/latex/contrib/spbmark/spbmark.pdf
Binary files differ
diff --git a/macros/latex/contrib/spbmark/spbmark.sty b/macros/latex/contrib/spbmark/spbmark.sty
index 10defa9e25..3bc3a3dd01 100644
--- a/macros/latex/contrib/spbmark/spbmark.sty
+++ b/macros/latex/contrib/spbmark/spbmark.sty
@@ -9,7 +9,7 @@
% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}[2018/12/31]
\RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{spbmark}{2021/12/20}{1.2E}
+\ProvidesExplPackage{spbmark}{2021/12/21}{1.2F}
{Customize superscripts and subscripts}
\cs_generate_variant:Nn \dim_max:nn { VV }
@@ -53,6 +53,11 @@
{ supersub } {#4}
}
}
+\cs_new_protected:Npn \defspbstyle #1#2
+ {
+ \spb_define:n
+ { style/#1 .code:n = \keys_set:nn { ctex/style } {#2} }
+ }
\spb_define:n
{
spvmove .tl_set:N = \l__spb_super_vmove_tl,
@@ -105,6 +110,8 @@
vsep .initial:n = 0.6ex,
halign .tl_set:N = \l__spb_supersub_halign_tl,
halign .initial:n = l,
+ style .choice:,
+ style .value_required:n = true,
mode .tl_set:N = \l__spb_mode_value_tl,
mode .initial:n = match
}
diff --git a/macros/latex/contrib/spbmark/spbmark.tex b/macros/latex/contrib/spbmark/spbmark.tex
index 93620fd8a7..12c8cacfd0 100644
--- a/macros/latex/contrib/spbmark/spbmark.tex
+++ b/macros/latex/contrib/spbmark/spbmark.tex
@@ -6,8 +6,8 @@
{
package = spbmark,
title = the spbmark package,
- version = v1.2E,
- date = 2021/12/20,
+ version = v1.2F,
+ date = 2021/12/21,
authors = Qu Yi,
info = Customize superscript and subscript,
email = q1jx@foxmail.com,
@@ -67,6 +67,8 @@ There are currently three commands to set superscript and subscript. Their forma
This is a subscript output command. The two \meta{kv list} are equivalent.
\command{supersub}[\oarg{kv list}\marg{super cont}\marg{sub cont}\oarg{kv list}]
This is a command that outputs both superscript and subscript at the same time. You can also use the shorter command \cs{spb} instead of it. The two \meta{kv list} are equivalent.
+ \command{defspbstyle}[\marg{style name}\marg{kv list}]
+ Defines the style of the superscript or subscript used for the \option{style} option.
\command{spbifmath}[\marg{math code}\marg{text code}]
In some cases, \code{math} or \code{text} output modes require different code for format or move. This command can be used when using the \code{match} option or changing the output mode locally, whitch should be used in the move or format options. It can switch the corresponding code according to different output modes.
\end{commands}
@@ -83,6 +85,8 @@ The options common to \meta{kv list} of the three commands are as follows. They
The format commands of superscript or subscript. The last command can take a parameter, which accepts superscript or subscript. Represents the format of superscript and subscript in the superscript and subscript commands.
\keyval{cmd+}{format cmds}\Default
Add code to the previous global superscript or subscript format commands.
+ \keyval{style}{style name}\Default
+ Use the \meta{style name} defined by the \cs{defspbstyle} command to make it work global or local.
\keychoice{mode}{text,math,match}\Default{match}
The mode of superscript or subscript output can be \code{text} or \code{math} mode. The \code{match} option automatically matches output modes according to the current mode.
\end{options}
@@ -137,9 +141,10 @@ The following list of keys control the format of superscript and subscript.
\section{Examples of use}
Here is a list of the three commands, please pay attention to the usage of optional parameters. Note when the horizontal move is negative, the starting point is at the right end of the mark.
\begin{example}
+\defspbstyle{fancy}{cmd=\color{purple}}
\spbset{spbcmd={\spbifmath{\mathtt}{\ttfamily},\color{blue}}}
A\super[vmove=0.2ex,hmove=0.2em,cmd=\textcolor{red}]{exam}B \\
-$A\sub[cmd=\mathsf,mode=math]{exam}B$ \\
+$A\sub[style=fancy,cmd+=\mathsf,mode=math]{exam}B$ \\
A\supersub[vsep=0.6ex,halign=c]{examsuper}{sub}B \\
A\super{c}[vmove=5pt,hmove=-5.5pt]B\sub[vmove=5pt,hmove=-5pt]{d}AB
\end{example}
diff --git a/macros/luatex/generic/autopuncitems/README.md b/macros/luatex/generic/autopuncitems/README.md
new file mode 100644
index 0000000000..3cd4844b10
--- /dev/null
+++ b/macros/luatex/generic/autopuncitems/README.md
@@ -0,0 +1,28 @@
+# autopuncitems
+
+Automatically punctuate lists by passing the autopunc option to enumitem lists.
+
+# License
+
+Copyright (C) 2021 Kale Ewasiuk
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/macros/luatex/generic/autopuncitems/autopuncitems.lua b/macros/luatex/generic/autopuncitems/autopuncitems.lua
new file mode 100644
index 0000000000..5e8e5b10c6
--- /dev/null
+++ b/macros/luatex/generic/autopuncitems/autopuncitems.lua
@@ -0,0 +1,106 @@
+--% Kale Ewasiuk (kalekje@gmail.com)
+--% 2021-12-20
+--% Copyright (C) 2021 Kale Ewasiuk
+--%
+--% Permission is hereby granted, free of charge, to any person obtaining a copy
+--% of this software and associated documentation files (the "Software"), to deal
+--% in the Software without restriction, including without limitation the rights
+--% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+--% copies of the Software, and to permit persons to whom the Software is
+--% furnished to do so, subject to the following conditions:
+--%
+--% The above copyright notice and this permission notice shall be included in
+--% all copies or substantial portions of the Software.
+--%
+--% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+--% ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+--% TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+--% PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+--% SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+--% ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+--% ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+--% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+--% OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+local ap = {} -- module table
+
+function ap.rtrim(s)
+ return (s:gsub("^(.-)%s*$", "%1"))
+end
+
+ap.punc = {}
+ap.punc = {'.', '; and'} -- punctuation table, 1 is last val, 2 is 2nd last val
+ap.punc[0] = ';' -- [0] is default punctuation
+ap.total = 0 -- total num of items (int)
+ap.curr = 0 -- current item we're on (int)
+ap.itemp = '\9' -- temporary item, item which WILL be affected by autopunc
+ap.item = '\\item' -- item
+ap.omit = '\\APomit' -- flag for hiding an item from punc and count, acts as if item is not there
+ap.pass = '\\APpass' -- flag for passing item from punc, but still considered in count
+ap.code = 0 -- code for skipping punc if > 0, keep in count if == 1, omit from count if == 2
+
+ap.autopassnested = true
+
+function ap.start(s)
+ ap.curr = 0
+ _, ap.total = s:gsub(ap.itemp, '')
+ local _, omit = s:gsub(ap.omit, '')
+ ap.total = ap.total - omit
+end
+
+function ap.setcode(s)
+ local _, code1 = s:gsub(ap.pass, '', 1)
+ local _, code2 = s:gsub(ap.omit, '', 1)
+ ap.code = code1 + 2*code2
+end
+
+function ap.addcount(s)
+ ap.setcode(s)
+ if ap.code < 2 then -- if not omitting, we still keep counter going
+ ap.curr = ap.curr + 1 -- increment counter
+ end
+end
+
+function ap.getdelim()
+ local d = ''
+ if ap.code == 0 then -- d limiter -- if not passing look at punctuation table for delimiter
+ d = ap.punc[ap.total-ap.curr+1] or ap.punc[0]
+ end
+ return d
+end
+
+function ap.protectnest(s)
+ local x = ''
+ if ap.autopassnested then x = ap.pass..'{}' end
+ s = s:gsub("\0", "\0", 0) -- dummy replacement to make code easier
+ :gsub("\\begin%s*{itemize}", x.."\1%0") -- pad \1 and \2 in inner envirnments
+ :gsub("\\end%s*{itemize}", "%0\2")
+ :gsub("\\begin%s*{enumerate}", x.."\1%0")
+ :gsub("\\end%s*{enumerate}", "%0\2")
+ :gsub("\\begin%s*{description}", x.."\1%0")
+ :gsub("\\end%s*{description}", "%0\2")
+ :gsub("%b\1\2", "\0%0\0") -- use bracket to place \0 (on OUTER) nested lists only
+ :gsub("(%Z*)%z?(%Z*)%z?", -- only affect matches outside list
+ function(a, b) return a:gsub(ap.item, ap.itemp)..b:gsub("[\1\2]", "") end)
+ return s
+end
+
+
+function ap.go(s)
+ s = ap.protectnest(s)
+ ap.start(s) -- start counters
+ --texio.write_nl('yooo...'..s)
+ s = s:gsub(ap.itemp, '\0\0'):gsub('\0', '', 1) -- make all items \0\0 then change first item to one \0
+ s = s:gsub('(%z)(%Z*)(%z?)', -- find betwen \0 .. \0
+ function(it, s, _it) -- discarding duplicate item '_it' that was made in first gsub
+ ap.addcount(s) -- add count, helps determine delimiter
+ return ap.rtrim(it..s)..ap.getdelim()..' '
+ end
+ )
+ s = s:gsub('\0', ap.itemp) -- replace items
+ s = s:gsub(ap.itemp, ap.item) -- replace items
+ return s
+end
+
+return ap \ No newline at end of file
diff --git a/macros/luatex/generic/autopuncitems/autopuncitems.pdf b/macros/luatex/generic/autopuncitems/autopuncitems.pdf
new file mode 100644
index 0000000000..fd743e4d99
--- /dev/null
+++ b/macros/luatex/generic/autopuncitems/autopuncitems.pdf
Binary files differ
diff --git a/macros/luatex/generic/autopuncitems/autopuncitems.sty b/macros/luatex/generic/autopuncitems/autopuncitems.sty
new file mode 100644
index 0000000000..8045fa4737
--- /dev/null
+++ b/macros/luatex/generic/autopuncitems/autopuncitems.sty
@@ -0,0 +1,56 @@
+% Kale Ewasiuk (kalekje@gmail.com)
+% 2021-12-20
+% Copyright (C) 2021 Kale Ewasiuk
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy
+% of this software and associated documentation files (the "Software"), to deal
+% in the Software without restriction, including without limitation the rights
+% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+% copies of the Software, and to permit persons to whom the Software is
+% furnished to do so, subject to the following conditions:
+%
+% The above copyright notice and this permission notice shall be included in
+% all copies or substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+% ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+% TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+% PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+% SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+% ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+% ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+% OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+\ProvidesPackage{autopuncitems}[2021-12-20]
+
+\RequirePackage{enumitem}
+\RequirePackage{luacode}
+
+\luadirect{autopuncitems = require'autopuncitems'}
+
+\newcommand{\APomit}{} % blank flag used in '\item' to hide it from counting and auto
+\newcommand{\APpass}{} % blank flag used in '\item', autopunc is skipped, but count is still
+
+\newcommand{\disableAPautopassnest}{\luadirect{autopuncitems.autopassnested = false}}
+\newcommand{\enableAPautopassnest}{\luadirect{autopuncitems.autopassnested = true}}
+
+\NewDocumentCommand{\setAPeach}{m m m}{\setAPdef{#1}\setAPseclast{#2}\setAPlast{#3}} % set each one, default, second last, last
+\NewDocumentCommand{\setAPall}{m}{\setAPdef{#1}\setAPseclast{#1}\setAPlast{#1}} % set all the same
+\NewDocumentCommand{\setAPdef}{m}{\luadirect{autopuncitems.punc[0] = \luastring{#1}}} % default punc value
+\NewDocumentCommand{\setAPlast}{m}{\luadirect{autopuncitems.punc[1] = \luastring{#1}}} % second last punc value
+\NewDocumentCommand{\setAPseclast}{m}{\luadirect{autopuncitems.punc[2] = \luastring{#1}}} % final punc value
+
+\NewDocumentEnvironment{AutoPuncItemize}{ +b }{
+% \luadirect{texio.write_nl('auto >>>'..autopuncitems.go(\luastringN{#1}))}
+ \luadirect{tex.print(autopuncitems.go(\luastringN{#1}))}
+}{}
+
+\SetEnumitemKey{autopunc}{
+ first*=\expandafter\AutoPuncItemize,
+ after=\endAutoPuncItemize,
+}
+
+
+
diff --git a/macros/luatex/generic/autopuncitems/autopuncitems.tex b/macros/luatex/generic/autopuncitems/autopuncitems.tex
new file mode 100644
index 0000000000..fd829b81e6
--- /dev/null
+++ b/macros/luatex/generic/autopuncitems/autopuncitems.tex
@@ -0,0 +1,201 @@
+% Kale Ewasiuk (kalekje@gmail.com)
+% 2021-12-20
+% Copyright (C) 2021 Kale Ewasiuk
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy
+% of this software and associated documentation files (the "Software"), to deal
+% in the Software without restriction, including without limitation the rights
+% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+% copies of the Software, and to permit persons to whom the Software is
+% furnished to do so, subject to the following conditions:
+%
+% The above copyright notice and this permission notice shall be included in
+% all copies or substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+% ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+% TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+% PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+% SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+% ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+% ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+% OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+\documentclass[11pt,parskip=half]{scrartcl}
+\setlength{\parindent}{0ex}
+\newcommand{\llcmd}[1]{\leavevmode\llap{\texttt{\detokenize{#1}\ }}}
+\newcommand{\cmd}[1]{\texttt{\detokenize{#1}}}
+\newcommand{\qcmd}[1]{``\cmd{#1}''}
+\RequirePackage{url}
+\RequirePackage{xcolor}
+\RequirePackage{showexpl}
+\lstset{explpreset={justification=\raggedright,pos=r,wide=true}}
+\setlength\ResultBoxRule{0mm}
+\lstset{
+ language=[LaTeX]TeX,
+ basicstyle=\ttfamily\small,
+ commentstyle=\ttfamily\small\color{gray},
+ frame=none,
+ numbers=left,
+ numberstyle=\ttfamily\small\color{gray},
+ prebreak=\raisebox{0ex}[0ex][0ex]{\color{gray}\ensuremath{\hookleftarrow}},
+ extendedchars=true,
+ breaklines=true,
+ tabsize=4,
+}
+\addtokomafont{title}{\raggedright}
+\addtokomafont{author}{\raggedright}
+\addtokomafont{date}{\raggedright}
+\author{Kale Ewasiuk (\url{kalekje@gmail.com})}
+\RequirePackage[yyyymmdd]{datetime}\renewcommand{\dateseparator}{--}
+\date{\today}
+
+
+\usepackage{autopuncitems}
+\setlist{nosep}
+
+\title{autopuncitems}
+
+
+\begin{document}
+\maketitle
+
+\section{Introduction}
+This package provides the \cmd{autopunc} option in the
+\cmd{enumitem} environemnts \cmd{itemize}, \cmd{enumerate}, and \cmd{description}
+to automatically punctuate the items.
+It uses lua pattern matching to modify the environment's contents.
+
+\section{Some commands}
+\llcmd{\APomit}Used in an \cmd{\item} to signify that that item should not be automatically punctuated, and not be counted. Expands to nothing.\\
+\llcmd{\APpass}Used in an \cmd{\item} to signify that that item should not be automatically punctuated, and but still counted. Expands to nothing.\\
+
+\begin{addmargin}[0.8in]{0in}
+\llcmd{\setAPeach{}{}{}}Set the default, second last, and last punctuation point in that order.\\
+\llcmd{\setAPall{}}Set all punctuation points the same.\\
+\llcmd{\setAPdef{}}Set the default punctuation point. \cmd{;} by default.\\
+\llcmd{\setAPseclast{}}Set the second last punctuation point. \cmd{; and} by default.\\
+\llcmd{\setAPlast{}}Set the second last punctuation point. \cmd{.} by default.\\
+
+\llcmd{\enableAPautopassnest}Automatically put an \cmd{\APpass} on items that introduce a nested list. Default behaviour.\\
+\llcmd{\disableAPautopassnest}Do not automatically put an \cmd{\APpass} on items that introduce a nested list.\\
+
+\end{addmargin}
+
+
+\section{Tutorial}
+\subsection{Basic Use}
+
+\begin{LTXexample}
+\begin{itemize}[autopunc]
+ \item one
+ \item two
+ \item three
+ \item four
+\end{itemize}
+\end{LTXexample}
+
+
+\subsection{Demonstrating Pass}
+
+\begin{LTXexample}
+\begin{itemize}[autopunc]
+ \item one
+ \item two
+ \item three \APpass
+ \item four
+\end{itemize}
+\end{LTXexample}
+
+\begin{LTXexample}
+\begin{itemize}[autopunc]
+ \item one
+ \item two
+ \item three \APpass
+ \item four \APpass
+\end{itemize}
+\end{LTXexample}
+
+
+\subsection{Demonstrating Omit}
+
+\begin{LTXexample}
+\begin{itemize}[autopunc]
+ \item one
+ \item two
+ \item three \APomit
+ \item four
+\end{itemize}
+\end{LTXexample}
+
+\begin{LTXexample}
+\begin{itemize}[autopunc]
+ \item one
+ \item two
+ \item three \APomit
+ \item four \APomit
+\end{itemize}
+\end{LTXexample}
+
+\subsection{Nested}
+You must use \cmd{autopunc} on each nested list if you want that sub-list to be automatically punctuated.
+Note that by default, the item introducing (before) a sub-list will not be automatically punctuated.
+
+\begin{LTXexample}
+\begin{itemize}[autopunc]
+ \item one
+ \item two
+ \item three:
+ \begin{enumerate}[autopunc]
+ \item alpha:
+ \begin{description}[autopunc]
+ \item[hello] world
+ \end{description}
+ \item beta
+ \item delta
+ \end{enumerate}
+ \item four
+\end{itemize}
+\end{LTXexample}
+
+
+\subsubsection{If you forget to use APpass}
+If you disable auto-pass nested lists, and don't use \cmd{\APpass}, here is what happens. Notice the extra ``; and'' below hello world and beta.
+\begin{LTXexample}
+\disableAPautopassnest
+\begin{itemize}[autopunc]
+ \item one
+ \item two
+ \item three
+ \begin{enumerate}[autopunc]
+ \item alpha
+ \begin{description}[autopunc]
+ \item[hello] world
+ \end{description}
+ \item beta
+ \end{enumerate}
+ \item four
+\end{itemize}
+\end{LTXexample}
+
+\begin{LTXexample}
+\enableAPautopassnest
+\begin{itemize}[autopunc]
+ \item one
+ \item two
+ \item three
+ \begin{enumerate}
+ \item alpha
+ \begin{description}[autopunc]
+ \item[hello] world
+ \end{description}
+ \item beta
+ \end{enumerate}
+ \item four
+\end{itemize}
+\end{LTXexample}
+
+\end{document}
+