texlive[61651] Master/texmf-dist: autopuncitems (18jan22)

commits+karl at tug.org commits+karl at tug.org
Tue Jan 18 22:31:12 CET 2022


Revision: 61651
          http://tug.org/svn/texlive?view=revision&revision=61651
Author:   karl
Date:     2022-01-18 22:31:12 +0100 (Tue, 18 Jan 2022)
Log Message:
-----------
autopuncitems (18jan22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/lualatex/autopuncitems/README.md
    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/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/autopuncitems/README.md	2022-01-18 21:31:01 UTC (rev 61650)
+++ trunk/Master/texmf-dist/doc/lualatex/autopuncitems/README.md	2022-01-18 21:31:12 UTC (rev 61651)
@@ -1,10 +1,10 @@
 # autopuncitems
 
-Automatically punctuate lists by passing the autopunc option to enumitem lists.
+Automatically punctuate lists by passing the autopunc option to enumitem lists. Requires LuaLaTeX.
 
 # License
 
-Copyright (C) 2021 Kale Ewasiuk
+Copyright (C) 2021-2022 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

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-01-18 21:31:01 UTC (rev 61650)
+++ trunk/Master/texmf-dist/doc/lualatex/autopuncitems/autopuncitems.tex	2022-01-18 21:31:12 UTC (rev 61651)
@@ -1,6 +1,6 @@
 % Kale Ewasiuk (kalekje at gmail.com)
-% 2021-12-20
-% Copyright (C) 2021 Kale Ewasiuk
+% 2022-01-18
+% Copyright (C) 2021-2022 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
@@ -62,12 +62,19 @@
 \begin{document}
 \maketitle
 
+{\Huge TODO make an environment that can be used outside of itemize, useful for beamer possibly}
+
 \section{Introduction}
-This package provides the \cmd{autopunc} option in the
-\cmd{enumitem} environemnts \cmd{itemize}, \cmd{enumerate}, and \cmd{description}
+This package provides environments \cmd{AutoPuncItemize}, \cmd{AutoPuncItemizeO}, and \cmd{AutoPuncItemizeE} (beta)
 to automatically punctuate the items.
+By default, it adds the \cmd{autopunc (O|E)} options in the
+\cmd{enumitem} environments \cmd{itemize}, \cmd{enumerate}, and \cmd{description}, to wrap the contents in these enviroments.
+If you want to skip this (say if you were using the beamer class which
+may be interefered with by enum item), pass the \cmd{noenumitem} option to this package. You can still use the environments with beamer, though.
 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.\\
@@ -84,7 +91,12 @@
 
 \end{addmargin}
 
+\section{Variants}
+\llcmd{autopunc}Does not expand the contents of environment. Tutorial on next section shows this.\\
+\llcmd{autopuncO}Expands the contents of environment once. Useful if \cmd{\item}'s are in a command \\
+\llcmd{autopuncE}Fully expands the contents of environment first. This is in-progress and should not be used.\\
 
+
 \section{Tutorial}
 \subsection{Basic Use}
 

Modified: trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua	2022-01-18 21:31:01 UTC (rev 61650)
+++ trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua	2022-01-18 21:31:12 UTC (rev 61651)
@@ -1,6 +1,6 @@
 --% Kale Ewasiuk (kalekje at gmail.com)
---% 2021-12-20
---% Copyright (C) 2021 Kale Ewasiuk
+--% 2022-01-18
+--% Copyright (C) 2021-2022 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

Modified: trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty	2022-01-18 21:31:01 UTC (rev 61650)
+++ trunk/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty	2022-01-18 21:31:12 UTC (rev 61651)
@@ -1,6 +1,6 @@
 % Kale Ewasiuk (kalekje at gmail.com)
-% 2021-12-20
-% Copyright (C) 2021 Kale Ewasiuk
+% 2022-01-18
+% Copyright (C) 2021-2022 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
@@ -23,11 +23,16 @@
 % OR OTHER DEALINGS IN THE SOFTWARE.
 
 
-\ProvidesPackage{autopuncitems}[2021-12-20]
+\ProvidesPackage{autopuncitems}[2022-01-18]
 
-\RequirePackage{enumitem}
 \RequirePackage{luacode}
+\RequirePackage{etoolbox}
 
+\newtoggle{noenumitem}
+
+\DeclareOption{noenumitem}{\toggletrue{noenumitem}}
+\ProcessOptions*\relax
+
 \luadirect{autopuncitems = require'autopuncitems'}
 
 \newcommand{\APomit}{} % blank flag used in '\item' to hide it from counting and auto
@@ -42,15 +47,22 @@
 \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}))}
-}{}
+\NewDocumentEnvironment{AutoPuncItems}{ +b }{\luadirect{tex.print(autopuncitems.go(\luastringN{#1}))}}{} % does not expand
+\NewDocumentEnvironment{AutoPuncItemsO}{ +b }{\luadirect{tex.print(autopuncitems.go(\luastringO{#1}))}}{} % expands once
+\NewDocumentEnvironment{AutoPuncItemsE}{ +b }{\luadirect{tex.print(autopuncitems.go(\luastring{#1}))}}{} % full expansion IN-PROGRESS
 
-\SetEnumitemKey{autopunc}{
-    first*=\expandafter\AutoPuncItemize,
-    after=\endAutoPuncItemize,
+\iftoggle{noenumitem}{}{% do nothing to enumitem if noenumitem is passed. Useful for beamer
+    \RequirePackage{enumitem}
+    \global\SetEnumitemKey{autopunc}{
+        first*=\expandafter\AutoPuncItems,
+        after=\endAutoPuncItems,
+    }
+    \global\SetEnumitemKey{autopuncO}{
+        first*=\expandafter\AutoPuncItemsO,
+        after=\endAutoPuncItemsO,
+    }
+    \global\SetEnumitemKey{autopuncE}{
+        first*=\expandafter\AutoPuncItemsE,
+        after=\endAutoPuncItemsE,
+    }
 }
-
-
-



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