texlive[61004] Master/texmf-dist: penlight (9nov21)

commits+karl at tug.org commits+karl at tug.org
Tue Nov 9 00:22:10 CET 2021


Revision: 61004
          http://tug.org/svn/texlive?view=revision&revision=61004
Author:   karl
Date:     2021-11-09 00:22:10 +0100 (Tue, 09 Nov 2021)
Log Message:
-----------
penlight (9nov21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/luatex/penlight/README.md
    trunk/Master/texmf-dist/doc/luatex/penlight/penlight.pdf
    trunk/Master/texmf-dist/doc/luatex/penlight/penlight.tex
    trunk/Master/texmf-dist/tex/luatex/penlight/penlight.sty
    trunk/Master/texmf-dist/tex/luatex/penlight/penlightextras.lua

Modified: trunk/Master/texmf-dist/doc/luatex/penlight/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/penlight/README.md	2021-11-08 23:21:49 UTC (rev 61003)
+++ trunk/Master/texmf-dist/doc/luatex/penlight/README.md	2021-11-08 23:22:10 UTC (rev 61004)
@@ -1,9 +1,8 @@
 # penlight  -- Lua libraries for use in LuaLaTeX
 
-This LuaLaTeX package provides a thin-wrapper to use the [penlight](https://github.com/lunarmodules/Penlight) Lua libraries with LuaLaTeX. It uses the `luapackageloader` package.
+This LuaLaTeX package provides a thin-wrapper to use the [penlight](https://github.com/lunarmodules/Penlight) Lua libraries with LuaLaTeX.
 
 
-
 # License
 
 Copyright (C) 2021 Kale Ewasiuk

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

Modified: trunk/Master/texmf-dist/doc/luatex/penlight/penlight.tex
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/penlight/penlight.tex	2021-11-08 23:21:49 UTC (rev 61003)
+++ trunk/Master/texmf-dist/doc/luatex/penlight/penlight.tex	2021-11-08 23:22:10 UTC (rev 61004)
@@ -1,6 +1,5 @@
 % Kale Ewasiuk (kalekje at gmail.com)
-% 2021-09-20
-%
+% 2021-11-07
 % Copyright (C) 2021 Kale Ewasiuk
 %
 % Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -23,13 +22,43 @@
 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
 % OR OTHER DEALINGS IN THE SOFTWARE.
 
-\documentclass{article}
+
+\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}''}
 \usepackage{url}
+\usepackage{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 at gmail.com})}
+\usepackage[yyyymmdd]{datetime}\renewcommand{\dateseparator}{--}
+\date{\today}
+
+
+\RequirePackage{penlight}
+\title{penlight}
+\subtitle{Lua libraries for use in LuaLaTeX}
+
 \begin{document}
+\maketitle
 
-    \section*{Penlight -- Lua libraries for use in LuaLaTeX}
-    v. 2021-09-20, Kale Ewasiuk, \url{kalekje at gmail.com}\\\\
-
         The official documentation for the Lua library can be found here:\\
   \mbox{\url{https://stevedonovan.github.io/Penlight/api/manual/01-introduction.md.html#}}
     \\

Modified: trunk/Master/texmf-dist/tex/luatex/penlight/penlight.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/penlight/penlight.sty	2021-11-08 23:21:49 UTC (rev 61003)
+++ trunk/Master/texmf-dist/tex/luatex/penlight/penlight.sty	2021-11-08 23:22:10 UTC (rev 61004)
@@ -1,6 +1,5 @@
 % Kale Ewasiuk (kalekje at gmail.com)
-% 2021-09-20
-%
+% 2021-11-07
 % Copyright (C) 2021 Kale Ewasiuk
 %
 % Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -23,21 +22,21 @@
 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
 % OR OTHER DEALINGS IN THE SOFTWARE.
 
-\ProvidesPackage{penlight}[2021-09-20]
+\ProvidesPackage{penlight}[2021-11-07]
 
-\RequirePackage{luapackageloader}
+\RequirePackage{luacode}
 
-\DeclareOption{pl}{\directlua{
+\DeclareOption{pl}{\luadirect{
     pl = require('penlight')
     __PENLIGHT__ = 'pl'
 }}
-\DeclareOption{penlight}{\directlua{
+\DeclareOption{penlight}{\luadirect{
     penlight = require('penlight')
     __PENLIGHT__ = 'penlight'
 }}
-\DeclareOption{stringx}{\directlua{_G[__PENLIGHT__].stringx.import()}}
-\DeclareOption{format}{\directlua{_G[__PENLIGHT__].text.format_operator()}}
-\DeclareOption{func}{\directlua{_G[__PENLIGHT__].utils.import(__PENLIGHT__..'.func')}}
-\DeclareOption{extras}{\directlua{require('penlightextras')}}
+\DeclareOption{stringx}{\luadirect{_G[__PENLIGHT__].stringx.import()}}
+\DeclareOption{format}{\luadirect{_G[__PENLIGHT__].text.format_operator()}}
+\DeclareOption{func}{\luadirect{_G[__PENLIGHT__].utils.import(__PENLIGHT__..'.func')}}
+\DeclareOption{extras}{\luadirect{require('penlightextras')}}
 
 \ProcessOptions*\relax

Modified: trunk/Master/texmf-dist/tex/luatex/penlight/penlightextras.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/penlight/penlightextras.lua	2021-11-08 23:21:49 UTC (rev 61003)
+++ trunk/Master/texmf-dist/tex/luatex/penlight/penlightextras.lua	2021-11-08 23:22:10 UTC (rev 61004)
@@ -2,17 +2,22 @@
 local pl = _G['penlight'] or _G['pl'] -- penlight for this namespace is pl
 local bind = bind or pl.func.bind
 
+-- some bonus string operations, % text operator, and functional programmng
+pl.stringx.import()
+pl.text.format_operator()
+pl.utils.import('pl.func')
+
 function help_wrt(s1, s2) -- helpful printing, makes it easy to debug, s1 is object, s2 is note
     local wrt = wrt or texio.write_nl
     local wrt = wrt or print
     s2 = s2 or ''
-    wrt('\nvvvvv '..s2)
+    wrt('\nvvvvv '..s2..'\n')
     if type(s1) == 'table' then
         wrt(pl.pretty.write(s1))
     else
         wrt(tostring(s1))
     end
-    wrt('^^^^^\n')
+    wrt('\n^^^^^\n')
 end
 
 
@@ -129,7 +134,7 @@
     return pl.array2d.new(r,c,v)
 end
 
-function from_table(t) -- turns a labelled table to a 2d, label-free array
+local function from_table(t) -- turns a labelled table to a 2d, label-free array
     t_new = {}
     for k, v in pairs(t) do
         if type(v) == 'table' then
@@ -145,7 +150,7 @@
     return t_new
 end
 
-function toTeX(M, EL) --puts & between columns, can choose to end line with \\ if EL is true (end-line)
+local function toTeX(M, EL) --puts & between columns, can choose to end line with \\ if EL is true (end-line)
     EL = EL or false
     if EL then EL = '\\\\' else EL = '' end
     return pl.array2d.reduce2(_1..EL.._2, _1..'&'.._2, M)..EL
@@ -221,10 +226,9 @@
 end
 
 function hasval(x)  -- if something has value
-    -- todo check for Lists, other penlight objects
     if (x == nil) or (x == false) or (x == 0) or (x == '') then
         return false
-    elseif type(x) == 'table' then
+    elseif (type(x) ~= 'number') or (type(x) ~= 'string') then
         if #x == 0 then
             return false
         else



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