summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-01-18 21:31:12 +0000
committerKarl Berry <karl@freefriends.org>2022-01-18 21:31:12 +0000
commit65f9c8611e6e13d8d69b1c30a793493c32b92dee (patch)
tree8ef864571d349f7e5ae7283a46b30eb4427153a7 /Master/texmf-dist/tex/lualatex
parent1b2af0c8685288eeeec426e34a0e48297d7cab41 (diff)
autopuncitems (18jan22)
git-svn-id: svn://tug.org/texlive/trunk@61651 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex')
-rw-r--r--Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua4
-rw-r--r--Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty40
2 files changed, 28 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua b/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua
index 5e8e5b10c64..fc0a4b38b5e 100644
--- a/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua
+++ b/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.lua
@@ -1,6 +1,6 @@
--% Kale Ewasiuk (kalekje@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
diff --git a/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty b/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty
index 8045fa4737f..81c3f2dd6c3 100644
--- a/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty
+++ b/Master/texmf-dist/tex/lualatex/autopuncitems/autopuncitems.sty
@@ -1,6 +1,6 @@
% Kale Ewasiuk (kalekje@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,10 +23,15 @@
% 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'}
@@ -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,
+ }
}
-
-
-