summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/penlight/penlight.tex
blob: 93d7bdbfc3e0999f22d26a36c3a4e1accd1672e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
% Kale Ewasiuk (kalekje@gmail.com)
% 2023-07-22
% Copyright (C) 2021-2023 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
% in the Software without restriction, including without limitation the rights
% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
% copies of the Software, and to permit persons to whom the Software is
% furnished to do so, subject to the following conditions:
%
% The above copyright notice and this permission notice shall be included in
% all copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
% ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
% TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
% PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
% SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
% ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
% ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
% OR OTHER DEALINGS IN THE SOFTWARE.


\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{xcolor}
\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@gmail.com})}
\usepackage[yyyymmdd]{datetime}\renewcommand{\dateseparator}{--}
\date{\today}


\RequirePackage{luacode}
\RequirePackage[pl,import]{penlight}
\title{penlight}
\subtitle{Lua libraries for use in LuaLaTeX}

\begin{document}

\maketitle

    Documentation for Penlight can be found here:\\
\mbox{\url{https://lunarmodules.github.io/Penlight}}
\\\\ This package uses version \cmd{1.13.1}

\subsection*{Importing Penlight from within LaTeX}
Loading this package runs the Lua code:  \texttt{penlight = require'penlight'}

Other options for the package are:
\vspace{1em}

\hspace*{-6ex}\begin{tabular}{lp{4.8in}}
\texttt{pl} & adds the alias \texttt{pl = penlight}\\\\
\texttt{stringx} & will import additional string functions into the string meta table via\\
                &  \texttt{require('penlight.stringx').import()}\\\\
\texttt{format} & allows the \% operator for Python-style string formatting via\\
        & \texttt{require('penlight.stringx').format\_operator()}\\\\
\texttt{func} & allows placeholder expressions eg. \texttt{\_1+1} to be used via\\
            &   \texttt{penlight.utils.import(penlight.func)}\\\\
\texttt{import} & does the above three\\
\end{tabular}


An example usage is: \cmd{\usepackage[pl,import]{penlight}}

%https://lunarmodules.github.io/Penlight/libraries/pl.func.html
%https://lunarmodules.github.io/Penlight/libraries/pl.stringx.html

\subsection*{Importing Penlight from within Lua}
Instead of using penlight.sty, you can simply:\\
\texttt{penlight = require'penlight'} ~~~ from within Lua.

\newpage
\section*{}
This package used to contain \cmd{penlightextras.lua}.
That functionality now belongs to a standalone package named \cmd{penlightplus}.

\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}\\\\
The author of this library has merged all penlight sub-modules into a single file for this distribution.

\end{document}