Debian Codegraph @

texmf-dist/doc/luatex/penlight/penlight.tex

raw
1 % Kale Ewasiuk ([email protected])
2 % 2024-09-15
3 % Copyright (C) 2021-2024 Kale Ewasiuk
4 %
5 % Permission is hereby granted, free of charge, to any person obtaining a copy
6 % of this software and associated documentation files (the "Software"), to deal
7 % in the Software without restriction, including without limitation the rights
8 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 % copies of the Software, and to permit persons to whom the Software is
10 % furnished to do so, subject to the following conditions:
11 %
12 % The above copyright notice and this permission notice shall be included in
13 % all copies or substantial portions of the Software.
14 %
15 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
16 % ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
17 % TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
18 % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
19 % SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
20 % ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 % ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
23 % OR OTHER DEALINGS IN THE SOFTWARE.
24
25
26 \documentclass[11pt,parskip=half]{scrartcl}
27 \setlength{\parindent}{0ex}
28 \newcommand{\llcmd}[1]{\leavevmode\llap{\texttt{\detokenize{#1}}}}
29 \newcommand{\cmd}[1]{\texttt{\detokenize{#1}}}
30 \newcommand{\qcmd}[1]{``\cmd{#1}''}
31 \usepackage{url}
32 \usepackage{xcolor}
33 \usepackage{showexpl}
34 \lstset{explpreset={justification=\raggedright,pos=r,wide=true}}
35 \setlength\ResultBoxRule{0mm}
36 \lstset{
37 language=[LaTeX]TeX,
38 basicstyle=\ttfamily\small,
39 commentstyle=\ttfamily\small\color{gray},
40 frame=none,
41 numbers=left,
42 numberstyle=\ttfamily\small\color{gray},
43 prebreak=\raisebox{0ex}[0ex][0ex]{\color{gray}\ensuremath{\hookleftarrow}},
44 extendedchars=true,
45 breaklines=true,
46 tabsize=4,
47 }
48 \addtokomafont{title}{\raggedright}
49 \addtokomafont{author}{\raggedright}
50 \addtokomafont{date}{\raggedright}
51 \author{Kale Ewasiuk (\url{[email protected]})}
52 \usepackage[yyyymmdd]{datetime}\renewcommand{\dateseparator}{--}
53 \date{\today}
54
55
56 \RequirePackage{luacode}
57 \RequirePackage[pl,import]{penlight}
58 \title{penlight}
59 \subtitle{Lua libraries for use in LuaLaTeX}
60
61 \begin{document}
62
63 \maketitle
64
65 Documentation for Penlight can be found here:\\
66 \mbox{\url{https://lunarmodules.github.io/Penlight}}
67 \\\\ This package uses version \cmd{1.14.0} (2024-04-15)
68
69 \subsection*{Importing Penlight from within LaTeX}
70 Loading this package runs the Lua code: \texttt{penlight = require'penlight'}
71
72 Other options for the package are:
73 \vspace{1em}
74
75 \hspace*{-6ex}\begin{tabular}{lp{4.8in}}
76 \texttt{pl} & adds the alias \texttt{pl = penlight}\\\\
77 \texttt{stringx} & will import additional string functions into the string meta table via\\
78 & \texttt{require('penlight.stringx').import()}\\\\
79 \texttt{format} & allows the \% operator for Python-style string formatting via\\
80 & \texttt{require('penlight.stringx').format\_operator()}\\\\
81 \texttt{func} & allows placeholder expressions eg. \texttt{\_1+1} to be used via\\
82 & \texttt{penlight.utils.import(penlight.func)}\\\\
83 \texttt{import} & does the above three\\
84 \end{tabular}
85
86
87 An example usage is: \cmd{\usepackage[pl,import]{penlight}}
88
89 %https://lunarmodules.github.io/Penlight/libraries/pl.func.html
90 %https://lunarmodules.github.io/Penlight/libraries/pl.stringx.html
91
92 \subsection*{Importing Penlight from within Lua}
93 Instead of using penlight.sty, you can simply:\\
94 \texttt{penlight = require'penlight'} ~~~ from within Lua.
95
96 \newpage
97 \section*{}
98 Additional functionality is provided in the \cmd{penlightplus} package.
99
100 \section*{}
101 Disclaimer: I am not the author of the Lua Penlight library.
102 Penlight is Copyright \textcopyright 2009-2016 Steve Donovan, David Manura.
103 The distribution of Penlight used for this library is:
104 \url{https://github.com/lunarmodules/penlight}\\\\
105 The author of this library has merged all penlight sub-modules into a single file for this distribution.
106
107 \end{document}