-
-
Notifications
You must be signed in to change notification settings - Fork 97
/
c05-packages.sil
253 lines (179 loc) · 7.03 KB
/
c05-packages.sil
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
\begin{document}
\chapter{SILE Packages}
SILE comes with a number of packages which provide additional functionality.
In fact, the actual “core” of SILE’s functionality is small and
extensible, with most of the interesting features being provided by add-on
packages. SILE packages are written in the Lua programming language, and can
define new commands, change the way that the SILE system operates, or indeed
do anything that is possible to do in Lua.
As mentioned above, loading a package is done through the \code{\\script} command,
which runs Lua code. By convention packages live in the \code{packages/} subdirectory
of either your input file’s location, your current working directory, or SILE’s
installation directory. For instance, we’ll soon be talking about the
\code{grid} package, which normally can be found as
\code{/usr/local/lib/sile/packages/grid/init.lua}. To load this, we’d say:
\begin[type=autodoc:codeblock]{raw}
\use[module=packages.grid]
\end{raw}
\note{\notehead{How SILE locates files} SILE searches for paths in a variety of
directories: first, in the directory in which your input file is located,
then the current working directory; next, if the environment variable
\code{SILE_PATH} is set, it will look in that directory; then it will look in
the standard installation directories \code{/usr/lib/sile} and
\code{/usr/local/lib/sile}. Unlike TeX, it does not descend into subdirectories
when looking for a file; if you have arranged your personal macro, class
or package files into subdirectories, you will need to provide a full relative
path to them.}
\section{image}
\package-documentation{image}
\section{folio}
\package-documentation{folio}
\section{rules}
\package-documentation{rules}
\section{color}
\package-documentation{color}
\section{background}
\package-documentation{background}
\section{rotate}
\package-documentation{rotate}
\section{features}
\package-documentation{features}
\section{unichar}
\package-documentation{unichar}
\section{bidi}
\package-documentation{bidi}
\section{pullquote}
\package-documentation{pullquote}
\section{raiselower}
\package-documentation{raiselower}
\section{grid}
\package-documentation{grid}
\section{linespacing}
\package-documentation{linespacing}
\section{verbatim}
\package-documentation{verbatim}
\section{font-fallback}
\package-documentation{font-fallback}
\section{boustrophedon}
\package-documentation{boustrophedon}
\section{chordmode}
\package-documentation{chordmode}
\section{converters}
\package-documentation{converters}
\section{cropmarks}
\package-documentation{cropmarks}
\section{date}
\package-documentation{date}
\section{debug}
\package-documentation{debug}
\section{dropcaps}
\package-documentation{dropcaps}
\section{leaders}
\package-documentation{leaders}
\section{lorem}
\package-documentation{lorem}
\section{specimen}
\package-documentation{specimen}
\section{textcase}
\package-documentation{textcase}
\section{url}
\package-documentation{url}
\section{Packages usually used by other packages}
In addition, there are certain packages that you \em{probably} don’t need
to use directly, as their main job is to provide more
basic functionality to other packages and classes. Classes such as the
\code{book} class compose functionality from different auxiliary packages.
\subsection{footnotes}
\package-documentation{footnotes}
\subsection{color-fonts}
\package-documentation{color-fonts}
\subsection{counters}
\package-documentation{counters}
\subsection{pdf}
\package-documentation{pdf}
\subsection{ifattop}
\package-documentation{ifattop}
\subsection{frametricks}
\package-documentation{frametricks}
\subsection{insertions}
\package-documentation{insertions}
\subsection{twoside}
\package-documentation{twoside}
\subsection{masters}
\package-documentation{masters}
\subsection{infonode}
\package-documentation{infonode}
\subsection{inputfilter}
\package-documentation{inputfilter}
\subsection{break-firstfit}
\package-documentation{break-firstfit}
\subsection{chapterverse}
\package-documentation{chapterverse}
\subsection{parallel}
\package-documentation{parallel}
\subsection{rebox}
\package-documentation{rebox}
\subsection{scalebox}
\package-documentation{scalebox}
\subsection{tableofcontents}
\package-documentation{tableofcontents}
\subsection{xmltricks}
\package-documentation{xmltricks}
\section{Experimental packages}
\subsection{autodoc}
\package-documentation{autodoc}
\subsection{balanced-frames}
\package-documentation{balanced-frames}
\subsection{bibtex}
\package-documentation{bibtex}
\subsection{gutenberg}
\package-documentation{gutenberg}
\subsection{indexer}
\package-documentation{indexer}
\subsection{lists}
\package-documentation{lists}
\subsection{math}
\package-documentation{math}
\subsection{pdfstructure}
\package-documentation{pdfstructure}
\subsection{svg}
\package-documentation{svg}
\section{The package manager}
The SILE installation includes a core collection of packages we hope are generally useful.
But there’s more out there!
SILE can use packages installed via the LuaRocks package manager.
It can also be configured to read packages from any directory of your choosing.
A SILE compatible LuaRock simply installs the relevant class, package, language, internationalization resources, or similar files in a \code{sile} directory.
This directory could be in your system Lua directory, in your user directory, or any other location you specify.
By default SILE will look for packages in:
\begin{enumerate}
\item{The directory where the SILE source file is located.}
\item{The current working directory.}
\item{The default Lua search path.}
\item{The directory where SILE is installed on the system.}
\end{enumerate}
By default, LuaRocks will install packages to the Lua search path.
\begin[type=autodoc:codeblock]{raw}
$ luarocks install lilypond.sile
$ sile ...
\end{raw}
Depending on your system, this probably requires root permissions.
If you either don’t have root permissions or don’t want to pollute your system’s root file system, you can also install as a user.
To use packages installed as a user you will need to have LuaRocks add its user tree to your Lua search path before running SILE.
\begin[type=autodoc:codeblock]{raw}
$ luarocks --local install lilypond.sile
$ eval $(luarocks --local path)
$ sile ...
\end{raw}
Of course, you can add that eval statement to your shell profile to always include your user directory in your Lua path.
You can also add your own entries to the top of the search path list by setting the \code{SILE_PATH} variable. For example:
\begin[type=autodoc:codeblock]{raw}
$ export SILE_PATH="/path/to/my/library/"
$ sile ...
\end{raw}
To write a package and publish to LuaRocks, see the \code{package-template.sile} repository.
Packages are not limited to just the package interface.
They can include classes, languages, internationalization resources, or anything else provided by SILE.
Also because external locations are searched before SILE itself, they can even override any core part of SILE itself.
As such you should probably make sure you review what a package does before installing it!
\end{document}