texlive[63045] Master/texmf-dist: autopuncitems (16apr22)

commits+karl at tug.org commits+karl at tug.org
Sat Apr 16 22:24:43 CEST 2022


Revision: 63045
          http://tug.org/svn/texlive?view=revision&revision=63045
Author:   karl
Date:     2022-04-16 22:24:43 +0200 (Sat, 16 Apr 2022)
Log Message:
-----------
autopuncitems (16apr22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/lualatex/autopuncitems/autopuncitems.pdf
    trunk/Master/texmf-dist/doc/lualatex/autopuncitems/autopuncitems.tex
    trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua
    trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty

Modified: trunk/Master/texmf-dist/doc/lualatex/autopuncitems/autopuncitems.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/lualatex/autopuncitems/autopuncitems.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/autopuncitems/autopuncitems.tex	2022-04-16 20:24:29 UTC (rev 63044)
+++ trunk/Master/texmf-dist/doc/lualatex/autopuncitems/autopuncitems.tex	2022-04-16 20:24:43 UTC (rev 63045)
@@ -1,5 +1,5 @@
 % Kale Ewasiuk (kalekje at gmail.com)
-% 2022-01-30
+% 2022-04-16
 % Copyright (C) 2021-2022 Kale Ewasiuk
 %
 % Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -208,24 +208,36 @@
 \end{itemize}
 \end{LTXexample}
 
-You may want to use the \cmd{AutoPuncItems} environment outside a list environment instead,
-say perhaps if you're using the \cmd{beamer}.
-Note that  nested lists are normally not punctuated, and since the first-level list is inside the environment, it's considered nested.
-If you would like to disable the prevention of auto-punctuating all nested lists, use the \cmd{\disableAPprotectnest}.
-Note that nested lists will cause an error to occur.
-
+\subsection{Expanding list contents}
 \begin{LTXexample}
-\disableAPprotectnest
-\begin{AutoPuncItems}
-\begin{itemize}
+\def\listexample{
     \item one
     \item two
     \item three
     \item four
+}
+--will work fine (expand once)
+\begin{itemize}[autopuncO]
+    \listexample
 \end{itemize}
-\end{AutoPuncItems}
+
+--will throw error
+  (author to fix this)
+%\begin{itemize}[autopuncE]
+%    \listexample
+%\end{itemize}
+
+--does not give desired result
+  (no items found)
+\begin{itemize}[autopunc]
+    \listexample
+\end{itemize}
+
 \end{LTXexample}
 
+
+\subsection{Using the environment}
+
 The normal way to use the environment should be inside the first list, like so.
 
 \begin{LTXexample}
@@ -240,6 +252,27 @@
 \end{itemize}
 \end{LTXexample}
 
+You may want to use the \cmd{AutoPuncItems} environment outside a list environment instead,
+say perhaps if you're using the \cmd{beamer}.
+Note that  nested lists are normally not punctuated, and since the first-level list is inside the environment, it's considered nested.
+If you would like to disable the prevention of auto-punctuating all nested lists, use the \cmd{\disableAPprotectnest}.
+Note that nested lists will cause an error to occur.
 
+\begin{LTXexample}
+\disableAPprotectnest
+\begin{AutoPuncItems}
+\begin{itemize}
+    \item one
+    \item two
+    \item three
+    \item four
+\end{itemize}
+\end{AutoPuncItems}
+\end{LTXexample}
+
+
+
+
+
 \end{document}
 

Modified: trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua	2022-04-16 20:24:29 UTC (rev 63044)
+++ trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua	2022-04-16 20:24:43 UTC (rev 63045)
@@ -1,5 +1,5 @@
 --% Kale Ewasiuk (kalekje at gmail.com)
---% 2022-01-30
+--% 2022-04-16
 --% Copyright (C) 2021-2022 Kale Ewasiuk
 --%
 --% Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -110,4 +110,17 @@
     return s
 end
 
+function ap.gotab(s)
+    -- very simple, does not work if \\ in tabular, doesn't factor in header or footer
+    local s, c = s:gsub('%s*\\\\', '\0')
+    if c > 2 then
+        s = s:gsub('\0', ap.punc[0]..'\\\\', c-2)
+    end
+    if c > 1 then
+        s = s:gsub('\0', ap.punc[2]..'\\\\', 1)
+    end
+    s = s:gsub('\0', ap.punc[1]..'\\\\', 1)
+    return s
+end
+
 return ap
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty	2022-04-16 20:24:29 UTC (rev 63044)
+++ trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty	2022-04-16 20:24:43 UTC (rev 63045)
@@ -1,5 +1,5 @@
 % Kale Ewasiuk (kalekje at gmail.com)
-% 2022-01-30
+% 2022-04-16
 % Copyright (C) 2021-2022 Kale Ewasiuk
 %
 % Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -23,7 +23,7 @@
 % OR OTHER DEALINGS IN THE SOFTWARE.
 
 
-\ProvidesPackage{autopuncitems}[2022-01-30]
+\ProvidesPackage{autopuncitems}[2022-04-16]
 
 \RequirePackage{luacode}
 \RequirePackage{etoolbox}
@@ -68,3 +68,6 @@
         after=\endAutoPuncItemsE,
     }
 }
+
+\NewDocumentEnvironment{AutoPuncTabular}{ +b }{\luadirect{tex.print(autopuncitems.gotab(\luastringN{#1}))}}{} % does not expand
+



More information about the tex-live-commits mailing list.