summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/penlight/penlight.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-09-22 03:00:42 +0000
committerNorbert Preining <norbert@preining.info>2021-09-22 03:00:42 +0000
commit094234b56c200ad35a041aa579c18cbcac8933ed (patch)
tree730b37a8684e85e78d7098d8cf34facf76684b3d /macros/luatex/generic/penlight/penlight.tex
parent32e0f5d0a5abc4f2b6c7341f19b854b5945c3ebd (diff)
CTAN sync 202109220300
Diffstat (limited to 'macros/luatex/generic/penlight/penlight.tex')
-rw-r--r--macros/luatex/generic/penlight/penlight.tex65
1 files changed, 38 insertions, 27 deletions
diff --git a/macros/luatex/generic/penlight/penlight.tex b/macros/luatex/generic/penlight/penlight.tex
index 2259cf27fd..9d3330bc9b 100644
--- a/macros/luatex/generic/penlight/penlight.tex
+++ b/macros/luatex/generic/penlight/penlight.tex
@@ -1,5 +1,5 @@
% Kale Ewasiuk (kalekje@gmail.com)
-% 2021-09-19
+% 2021-09-20
%
% Copyright (C) 2021 Kale Ewasiuk
%
@@ -24,50 +24,60 @@
% OR OTHER DEALINGS IN THE SOFTWARE.
\documentclass{article}
-\usepackage[pl]{penlight}
\usepackage{url}
\begin{document}
- \section*{penlight -- Lua libraries for use in LuaLaTeX}
- v. 2021-09.19, Kale Ewasiuk, \url{kalekje@gmail.com}
+ \section*{Penlight -- Lua libraries for use in LuaLaTeX}
+ v. 2021-09-20, Kale Ewasiuk, \url{kalekje@gmail.com}\\\\
- \subsection*{Default}
-
- \begin{verbatim}
- \usepackage{penlight}
- \end{verbatim}
+ The official documentation for the Lua library can be found here:\\
+ \mbox{\url{https://stevedonovan.github.io/Penlight/api/manual/01-introduction.md.html#}}
+ \\
- If no options are used when using this package,
- then all penlight packages are available under the lua variable \texttt{penlight}.
- Here is an example:
+ \subsection*{Required Package Option}
+ The first option sent to this package MUST be one of: \\
+ \texttt{[penlight]} \ \ \ or \ \ \ \texttt{[pl]}.\\
+ All Penlight sub-modules are then available under this global variable by either\\
+ \texttt{penlight.XYZ} or \texttt{pl.XYZ}
- \begin{verbatim}
- \begin{luacode*}
- texio.write_nl(penlight.pretty.write(penlight.List('hello')))
- \end{luacode*}
- \end{verbatim}
- The official documentation for the lua library can be found here:\\
- \mbox{\url{https://stevedonovan.github.io/Penlight/api/manual/01-introduction.md.html#}}
- \subsection*{Package Options}
+ \subsection*{Additional Package Options}
\noindent
\begin{tabular}{lp{4.5in}}
- \texttt{pl} & will make penlight packages are available under the global lua variable \texttt{pl} or \texttt{penlight}.\\\\
\texttt{stringx} & will import additional string functions into the string meta table.\\
& this will be ran in pre-amble: \texttt{require('pl.stringx').import()}\\
& \hspace*{-4em}\url{https://stevedonovan.github.io/Penlight/api/libraries/pl.stringx.html}\\\\
\texttt{format} & allows \% operator for Python-style string formating\\
& this will be ran in pre-amble: \texttt{require('pl.text').format\_operator()}\\
& \hspace*{-4em}\url{https://stevedonovan.github.io/Penlight/api/libraries/pl.text.html}\\\\
- \texttt{func} & allows placehold expressions eg. \texttt{\_1 + 1} to be used \\
+ \texttt{func} & allows placehold expressions eg. \texttt{\_1+1} to be used \\
& this will be ran in pre-amble: \texttt{penlight.utils.import('pl.func')}\\
& \hspace*{-4em}\url{https://stevedonovan.github.io/Penlight/api/libraries/pl.func.html}\\\\
+ \texttt{extras} & adds some additional functions. Adds functions to some Penlight sub-modules. The following Lua globals will be defined:
+ \texttt{close\_bkt\_cnt,
+ add\_bkt\_cnt,
+ reset\_bkt\_cnt,
+ \_NumBkts,
+ \_xTrue,
+ \_xFalse,
+ \_xNoValue,
+ \_\_SKIP\_TEX\_\_,
+ hasval,
+ mod, mod2,
+ }\\
\end{tabular}
+ \\\\
+ If you want to use Penlight (and extras) with the \texttt{texlua} intrepreter (no document made, only for Lua files, useful for testing),
+ you can access it by the following:
\begin{verbatim}
-
+ package.path = package.path .. ';'..'path/to/texmf/tex/latex/penlight/?.lua'
+ penlight = require('penlight')
+ __SKIP_TEX__ = true --only required if you want to use
+ --penlightextras without a LaTeX run
+ require('penlightextras')
\end{verbatim}
@@ -75,10 +85,11 @@
\section*{}
- Disclaimer: I am not the author of the Lua penlight library.
- penlight is Copyright \textcopyright 2009-2016 Steve Donovan, David Manura.
- The distribution of penlight used for this library is:
-\url{https://github.com/lunarmodules/penlight}
+ Disclaimer: I am not the author of the Lua Penlight library.
+ Penlight is Copyright \textcopyright 2009-2016 Steve Donovan, David Manura.
+ The distribution of Penlight used for this library is:
+\url{https://github.com/lunarmodules/penlight}\\
+ The author of this library has merged all Lua sub-modules into one file for this package.
\end{document} \ No newline at end of file