Skip to content

Type definitions / Stubs for the Lua API / interface of LuaTeX and related Lua modules.

License

Notifications You must be signed in to change notification settings

AndreasMatthias/LuaTeX_Lua-API

 
 

Repository files navigation

LuaTeX Lua API

Type definitions / Stubs for the Lua API / interface of LuaTeX and related Lua modules.

Work in progress! Please contribute!

LuaTeX has a very large Lua API. This project tries to make this API accessible in the text editor of your choice. This is made possible by the lua-language-server - a server that implements the Language Server Protocol (LSP) for the Lua language.

Features such as code completion syntax highlighting and marking of warnings and errors, should therefore not only be possible in Visual Studio Code, but in a large number of editors that support the LSP.

Related projects

Subprojects (upstream / pull) detached from this repository

Subprojects (push) detached from this repository

Structure of this project / documentation

In the subfolder library are files named after the global libraries they document. For example, the library/tex.lua file contains the documentation for the tex library. These Lua files don’t contain really Lua code. They consist of just function bodies and empty tables. The main focus lies in the docstrings.

The API docmentation is written in a well documented annotation format. This format is based on the EmmyLua format. Unfortunately, the Lua community has not yet been able to agree on a standarized annotation format. Many Lua project are documented in the LDoc format. However, the differences between these formats are marginal.

library

The actual definitions are located in the directory library. This directory is divided into further subdirectories. In the folder luatex you will find the definitions that the engine LuaTeX provides. The folder lualibs documents the extension library of the same name. If you use lualatex, you may be interested in the folder of the same name.

resources

The folder resources contains TeX manuals and HTML online documentation converted into Lua docstrings.

examples

The example folder contains TeX files for demonstrating and testing the documented Lua API.

Installation / Setup for Visual Studio Code

Install Visual Studio Code and the lua-language-server.

git clone https://github.com/Josef-Friedrich/LuaTeX_Lua-API.git

.vscode/settings.json:

{
"Lua.workspace.library": [
    "<repo>/library"
  ]
}

How to contribute

The preferred method of contributing to the project is via Github pull requests. You can also email patches to josef@friedrich.rocks. It is ok if you only document the data types of the input parameters.

Use imperative mood for the first line: https://peps.python.org/pep-0257/

Please contribute! messages

Default message:

---😱 [Types](https://github.com/Josef-Friedrich/LuaTeX_Lua-API/blob/main/library/luatex/pdf.lua) incomplete or incorrect? 🙏 [Please contribute!](https://github.com/Josef-Friedrich/LuaTeX_Lua-API/pulls)

No documentation at all:

---
---Warning! Undocumented code!<p>
---TODO: Please contribute
---https://github.com/Josef-Friedrich/LuaTeX_Lua-API#how-to-contribute

Minimal example of tex.sp()

---
---@param s string
function tex.sp(s) end

Less minimal example of tex.sp()

---
---@param s string
---
---@return integer
function tex.sp(s) end

Or if you have more time you can also expand the documentation to this level:

Prime example of tex.sp()

---@meta

tex = {}

---
---Convert a string `s` that represents an explicit
---dimension into an integer number of scaled points.
---
---For parsing the string, the same scanning and conversion rules are used that
---*LuaTeX* would use if it was scanning a dimension specifier in its *TeX*-like
---input language (this includes generating errors for bad values), expect for the
---following:
---
---* only explicit values are allowed, control sequences are not handled
---* infinite dimension units (`fil...`) are forbidden
---* `mu` units do not generate an error (but may not be useful either)
---
---__Example:__
---
---```lua
---local scaled_points = tex.sp('1cm')
---print(scaled_points) -- 1864679
---```
---
---__Reference:__
---
---* `LuaTeX` manual: 10.3.15.5 `sp` page 204
---* Source code of the `LuaTeX` manual: [luatex-tex.tex#L1386-L1413](https://github.com/TeX-Live/luatex/blob/f52b099f3e01d53dc03b315e1909245c3d5418d3/manual/luatex-tex.tex#L1386-L1413)
---
---@param s string # A string to convert into scaled points.
---
---@return integer # The dimension in the scaled points format.
function tex.sp(s) end

The docstring above is rendered as follows in Visual Studio Code:

The description text can be or was taken from the official LuaTeX reference manual. In the project folder resources/manuals/luatex you will find slightly edited Lua versions of the LuaTeX manual sources.

  1. Preamble
  2. Basic TEX enhancements
  3. Modifications
  4. Using LUATEX
  5. Languages, characters, fonts and glyphs
  6. Font structure
  7. Math
  8. Nodes
  9. LUA callbacks
  10. The TEX related libraries
  11. The graphic libraries
  12. The fontloader
  13. The HarfBuzz libraries
  14. The backend libraries

This quick hacked and very ugly Python script resources/manuals/convert-tex-to-lua-docstrings.py was used to convert the source files.

Navigation table _N

Some Lua files contain a table named _N. _N stands for navigation. With the help of this table and the outline view of the editor, it is easier to navigate through the documentation. The name is inspired by the global Lua table _G. Many parts of the documentation, such as the definition of the various Node classes, are not shown in the outline. If the API documentation is published, the _N table can be commented out.

Documentation of function overloading

LuaTeX makes extensive use of function overloading. The following example is taken from the LuaTeX manual:

<number> w, <number> h, <number> d =
  node.dimensions(<node> n)
<number> w, <number> h, <number> d =
  node.dimensions(<node> n, <string> dir)
<number> w, <number> h, <number> d =
  node.dimensions(<node> n, <node> t)
<number> w, <number> h, <number> d =
  node.dimensions(<node> n, <node> t, <string> dir)
<number> w, <number> h, <number> d =
  node.dimensions(<number> glue_set, <number> glue_sign, <number> glue_order, <node> n)
<number> w, <number> h, <number> d =
  node.dimensions(<number> glue_set, <number> glue_sign, <number> glue_order, <node> n, <string> dir)
<number> w, <number> h, <number> d =
  node.dimensions(<number> glue_set, <number> glue_sign, <number> glue_order, <node> n, <node> t)
<number> w, <number> h, <number> d =
  node.dimensions(<number> glue_set, <number> glue_sign, <number> glue_order, <node> n, <node> t, <string> dir)

This can easily be done by documenting the function with the same name but different signatures multiple times.

Issue for further improvement of the function loading

Function overloading in tex.sp()

Documentation of nodes

A node (object) can be described by the @class annotation and provided with some documentation about its attributes using @field. There is a base class Node for all node type classes.

---
---A node that comprise actual typesetting commands. A few fields are
---present in all nodes regardless of their type, these are:
---
---@class Node
---@field next Node|nil # the next node in a list, or nil
---@field prev Node|nil # That prev field is always present, but only initialized on explicit request ...

The KernNode class for example inherits from Node and represents a kern node.

---
---The `kern` command creates such nodes but for instance the font and math
---machinery can also add them.
---
---@class KernNode: Node
---@field subtype KernNodeSubtype
---@field kern integer # Fixed horizontal or vertical advance (in scaled points)
---@alias KernNodeSubtype
---|0 # fontkern
---|1 # userkern
---|2 # accentkern
---|3 # italiccorrection

The @cast annotation forces a unspecific node to a distinct node type.

while n do
  if n.id == node.id('kern') then
    ---@cast n KernNode
    print(n.kern)
  end
  n = n.next
end

Use --[[@as <node type>]] to force a node type onto an expression.

local kern = node.new('kern') --[[@as KernNode]]

Documentation of callback functions

How a callback function is documented is shown using the pre_linebreak_filter as an example.

@alias PreLinebreakFilterGroupCode

---
---The string called `groupcode` identifies the nodelist's context within
---*TeX*'s processing. The range of possibilities is given in the table below, but
---not all of those can actually appear in `pre_linebreak_filter`, some are
---for the `hpack_filter` and `vpack_filter` callbacks that will be
---explained in the next two paragraphs.
---@alias PreLinebreakFilterGroupCode
---|'' # main vertical list
---|'hbox' # hbox` in horizontal mode
---|'adjusted_hbox' #hbox` in vertical mode
---|'vbox' # vbox`
---|'vtop' # vtop' #
---|'align' # halign` or `valign`
---|'disc' # discretionaries
---|'insert' # packaging an insert
---|'vcenter' # vcenter`
---|'local_box' # localleftbox` or `localrightbox`
---|'split_off' # top of a `vsplit`
---|'split_keep' # remainder of a `vsplit`
---|'align_set' # alignment cell
---|'fin_row' # alignment row

@alias NodeCallbackReturn

---
---As for all the callbacks that deal with nodes, the return value can be one of
---three things:
---
---* boolean `true` signals successful processing
---* `<node>` signals that the “head” node should be replaced by the
---  returned node
---* boolean `false` signals that the “head” node list should be
---  ignored and flushed from memory
---@alias NodeCallbackReturn true|false|Node

@alias PreLinebreakFilter

---
---# `pre_linebreak_filter` callback
---
---This callback is called just before *LuaTeX* starts converting a list of nodes
---into a stack of `hbox`es, after the addition of `parfillskip`.
---
---```lua
------@type PreLinebreakFilter
---function(head, groupcode)
---  --- true|false|node
---  return true
---end
---```
---
---This callback does not replace any internal code.
---@alias PreLinebreakFilter fun(head: Node, groupcode: PreLinebreakFilterGroupCode): NodeCallbackReturn

Annotation your custom callback function with @type.

---@type PreLinebreakFilter
local function visit_nodes(head, group)
  return true
end

luatexbase.add_to_callback('pre_linebreak_filter', visit_nodes, 'visit nodes')

Quick info node.id(type)

Type error in node.id(type)

node.id(type) type definition

Quick info node.write(n)

Documentation for the field data of the pdf_colorstack node:

Documentation

Howtos

Other type definition / stub repos:

---
---__Reference:__
---
---* Source code of the `LuaTeX` manual: [luatex-nodes.tex#L1199-L1211](https://github.com/TeX-Live/luatex/blob/f52b099f3e01d53dc03b315e1909245c3d5418d3/manual/luatex-nodes.tex#L1199-L1211)
---
---
---__Reference:__
---
---* Source code of the `LuaTeX` manual: []()
---

Global namespace

The following listing is generated inside from LuaTeX using the small script below.

arg

  • arg.0 (string)
  • arg.1 (string)

bit32

  • bit32.arshift (function)
  • bit32.band (function)
  • bit32.bnot (function)
  • bit32.bor (function)
  • bit32.btest (function)
  • bit32.bxor (function)
  • bit32.extract (function)
  • bit32.lrotate (function)
  • bit32.lshift (function)
  • bit32.replace (function)
  • bit32.rrotate (function)
  • bit32.rshift (function)

callback

  • callback.find (function)
  • callback.list (function)
  • callback.register (function)

config

  • config.actions (table)
  • config.lualibs (table)
  • config.luaotfload (table)

dir

  • dir.collectpattern (function)
  • dir.current (function)
  • dir.expandname (function)
  • dir.found (function)
  • dir.glob (function)
  • dir.globdirs (function)
  • dir.globfiles (function)
  • dir.globpattern (function)
  • dir.ls (function)
  • dir.makedirs (function)
  • dir.mkdirs (function)
  • dir.pop (function)
  • dir.push (function)

file

  • file.addsuffix (function)
  • file.basename (function)
  • file.checksum (function)
  • file.collapse_path (function)
  • file.collapsepath (function)
  • file.copy (function)
  • file.dirname (function)
  • file.expandname (function)
  • file.extname (function)
  • file.is_qualified_path (function)
  • file.is_readable (function)
  • file.is_rootbased_path (function)
  • file.is_writable (function)
  • file.isreadable (function)
  • file.iswritable (function)
  • file.join (function)
  • file.joinpath (function)
  • file.loadchecksum (function)
  • file.nameonly (function)
  • file.nametotable (function)
  • file.needs_updating (function)
  • file.needsupdating (function)
  • file.pathpart (function)
  • file.readdata (function)
  • file.removesuffix (function)
  • file.replacesuffix (function)
  • file.reslash (function)
  • file.robustname (function)
  • file.savechecksum (function)
  • file.savedata (function)
  • file.size (function)
  • file.split_path (function)
  • file.splitbase (function)
  • file.splitname (function)
  • file.splitpath (function)
  • file.strip (function)
  • file.suffix (function)
  • file.suffixes (function)
  • file.suffixesonly (function)
  • file.suffixonly (function)
  • file.syncmtimes (function)
  • file.withinbase (function)

fio

  • fio.getposition (function)
  • fio.read2dot14 (function)
  • fio.readbytes (function)
  • fio.readbytetable (function)
  • fio.readcardinal1 (function)
  • fio.readcardinal1le (function)
  • fio.readcardinal2 (function)
  • fio.readcardinal2le (function)
  • fio.readcardinal3 (function)
  • fio.readcardinal3le (function)
  • fio.readcardinal4 (function)
  • fio.readcardinal4le (function)
  • fio.readcardinaltable (function)
  • fio.readfixed2 (function)
  • fio.readfixed4 (function)
  • fio.readinteger1 (function)
  • fio.readinteger1le (function)
  • fio.readinteger2 (function)
  • fio.readinteger2le (function)
  • fio.readinteger3 (function)
  • fio.readinteger3le (function)
  • fio.readinteger4 (function)
  • fio.readinteger4le (function)
  • fio.readintegertable (function)
  • fio.readline (function)
  • fio.setposition (function)
  • fio.skipposition (function)

font

  • font.addcharacters (function)
  • font.current (function)
  • font.define (function)
  • font.each (function)
  • font.fonts (table)
  • font.frozen (function)
  • font.getcopy (function)
  • font.getfont (function)
  • font.getparameters (function)
  • font.id (function)
  • font.max (function)
  • font.nextid (function)
  • font.originaleach (function)
  • font.read_tfm (function)
  • font.read_vf (function)
  • font.setexpansion (function)
  • font.setfont (function)

fontloader

  • fontloader.apply_afmfile (function)
  • fontloader.apply_featurefile (function)
  • fontloader.close (function)
  • fontloader.fields (function)
  • fontloader.info (function)
  • fontloader.open (function)
  • fontloader.to_table (function)

fonts

  • fonts.analyzers (table)
  • fonts.cid (table)
  • fonts.constructors (table)
  • fonts.definers (table)
  • fonts.encodings (table)
  • fonts.expansions (table)
  • fonts.formats (table)
  • fonts.handlers (table)
  • fonts.hashes (table)
  • fonts.helpers (table)
  • fonts.loggers (table)
  • fonts.mappings (table)
  • fonts.names (table)
  • fonts.privateoffsets (table)
  • fonts.protrusions (table)
  • fonts.readers (table)
  • fonts.specifiers (table)
  • fonts.tables (table)
  • fonts.tracers (table)

functions

  • functions.dummy (function)

gzip

  • gzip.close (function)
  • gzip.compress (function)
  • gzip.compressed (function)
  • gzip.decompress (function)
  • gzip.lines (function)
  • gzip.load (function)
  • gzip.open (function)
  • gzip.save (function)
  • gzip.suffix (function)

img

  • img.boxes (function)
  • img.copy (function)
  • img.fields (function)
  • img.immediatewrite (function)
  • img.immediatewriteobject (function)
  • img.keys (function)
  • img.new (function)
  • img.node (function)
  • img.scan (function)
  • img.types (function)
  • img.write (function)

kpse

  • kpse.check_permission (function)
  • kpse.default_texmfcnf (function)
  • kpse.expand_braces (function)
  • kpse.expand_path (function)
  • kpse.expand_var (function)
  • kpse.find_file (function)
  • kpse.init_prog (function)
  • kpse.lookup (function)
  • kpse.new (function)
  • kpse.readable_file (function)
  • kpse.record_input_file (function)
  • kpse.record_output_file (function)
  • kpse.set_program_name (function)
  • kpse.show_path (function)
  • kpse.var_value (function)
  • kpse.version (function)

lang

  • lang.clean (function)
  • lang.clear_hyphenation (function)
  • lang.clear_patterns (function)
  • lang.gethjcode (function)
  • lang.hyphenate (function)
  • lang.hyphenation (function)
  • lang.hyphenationmin (function)
  • lang.id (function)
  • lang.new (function)
  • lang.patterns (function)
  • lang.postexhyphenchar (function)
  • lang.posthyphenchar (function)
  • lang.preexhyphenchar (function)
  • lang.prehyphenchar (function)
  • lang.sethjcode (function)

lfs

  • lfs._COPYRIGHT (string)
  • lfs._DESCRIPTION (string)
  • lfs._VERSION (string)
  • lfs.attributes (function)
  • lfs.chdir (function)
  • lfs.currentdir (function)
  • lfs.dir (function)
  • lfs.isdir (function)
  • lfs.isfile (function)
  • lfs.isfound (function)
  • lfs.link (function)
  • lfs.lock (function)
  • lfs.lock_dir (function)
  • lfs.mkdir (function)
  • lfs.mkdirs (function)
  • lfs.modification (function)
  • lfs.readlink (function)
  • lfs.rmdir (function)
  • lfs.setmode (function)
  • lfs.shortname (function)
  • lfs.symlinkattributes (function)
  • lfs.touch (function)
  • lfs.unlock (function)

logs

  • logs.disable (function)
  • logs.enable (function)
  • logs.name (string)
  • logs.newline (function)
  • logs.reporter (function)

lpeg

  • lpeg.B (function)
  • lpeg.C (function)
  • lpeg.Carg (function)
  • lpeg.Cb (function)
  • lpeg.Cc (function)
  • lpeg.Cf (function)
  • lpeg.Cg (function)
  • lpeg.Cmt (function)
  • lpeg.Cp (function)
  • lpeg.Cs (function)
  • lpeg.Ct (function)
  • lpeg.P (function)
  • lpeg.R (function)
  • lpeg.S (function)
  • lpeg.UP (function)
  • lpeg.UR (function)
  • lpeg.US (function)
  • lpeg.V (function)
  • lpeg.afterprefix (function)
  • lpeg.anywhere (function)
  • lpeg.append (function)
  • lpeg.balancer (function)
  • lpeg.beforesuffix (function)
  • lpeg.checkedsplit (function)
  • lpeg.containsws (function)
  • lpeg.counter (function)
  • lpeg.endstripper (function)
  • lpeg.finder (function)
  • lpeg.firstofsplit (function)
  • lpeg.frontstripper (function)
  • lpeg.instringchecker (function)
  • lpeg.is_lpeg (function)
  • lpeg.keeper (function)
  • lpeg.locale (function)
  • lpeg.match (function)
  • lpeg.oneof (function)
  • lpeg.patterns (table)
  • lpeg.pcode (function)
  • lpeg.print (function)
  • lpeg.ptree (function)
  • lpeg.replacer (function)
  • lpeg.secondofsplit (function)
  • lpeg.setmaxstack (function)
  • lpeg.setutfcasers (function)
  • lpeg.split (function)
  • lpeg.splitat (function)
  • lpeg.splitter (function)
  • lpeg.splitters (table)
  • lpeg.stripper (function)
  • lpeg.times (function)
  • lpeg.tsplitat (function)
  • lpeg.tsplitter (function)
  • lpeg.type (function)
  • lpeg.utfchartabletopattern (function)
  • lpeg.utfreplacer (function)
  • lpeg.version (function)

ltn12

  • ltn12.BLOCKSIZE (number)
  • ltn12._M (table)
  • ltn12._NAME (string)
  • ltn12._PACKAGE (string)
  • ltn12._VERSION (string)
  • ltn12.filter (table)
  • ltn12.pump (table)
  • ltn12.sink (table)
  • ltn12.source (table)

ltx

  • ltx.utils (table)

lua

  • lua.bytecode (table)
  • lua.get_functions_table (function)
  • lua.getbytecode (function)
  • lua.getcalllevel (function)
  • lua.getcodepage (function)
  • lua.getluaname (function)
  • lua.getstacktop (function)
  • lua.name (table)
  • lua.newtable (function)
  • lua.setbytecode (function)
  • lua.setluaname (function)
  • lua.version (string)

luaharfbuzz

  • luaharfbuzz.Blob (table)
  • luaharfbuzz.Buffer (table)
  • luaharfbuzz.Direction (table)
  • luaharfbuzz.Face (table)
  • luaharfbuzz.Feature (table)
  • luaharfbuzz.Font (table)
  • luaharfbuzz.Language (table)
  • luaharfbuzz.Script (table)
  • luaharfbuzz.Tag (table)
  • luaharfbuzz.Variation (table)
  • luaharfbuzz.ot (table)
  • luaharfbuzz.shape_full (function)
  • luaharfbuzz.shapers (function)
  • luaharfbuzz.unicode (table)
  • luaharfbuzz.version (function)

lualibs

  • lualibs.basic_loaded (boolean)
  • lualibs.extended_loaded (boolean)
  • lualibs.info (function)
  • lualibs.load_extended (boolean)
  • lualibs.loadmodule (function)
  • lualibs.module_info (table)
  • lualibs.prefer_merged (boolean)
  • lualibs.warn (function)

luaotfload

  • luaotfload.add_colorscheme (function)
  • luaotfload.add_fallback (function)
  • luaotfload.add_multiscript (function)
  • luaotfload.apply_default_features (function)
  • luaotfload.aux (table)
  • luaotfload.default_config (table)
  • luaotfload.define_font (function)
  • luaotfload.features (table)
  • luaotfload.fontloader (table)
  • luaotfload.fontloader_package (string)
  • luaotfload.get_script_mark (function)
  • luaotfload.harf (table)
  • luaotfload.harfbuzz (table)
  • luaotfload.letterspace (table)
  • luaotfload.loaders (table)
  • luaotfload.log (table)
  • luaotfload.main (function)
  • luaotfload.parsers (table)
  • luaotfload.resolvers (table)
  • luaotfload.set_colorhandler (function)
  • luaotfload.set_transparent_colorstack (function)
  • luaotfload.set_transparenthandler (function)
  • luaotfload.version (string)

luatexbase

  • luatexbase.add_to_callback (function)
  • luatexbase.attributes (table)
  • luatexbase.call_callback (function)
  • luatexbase.callback_descriptions (function)
  • luatexbase.callbacktypes (table)
  • luatexbase.create_callback (function)
  • luatexbase.declare_callback_rule (function)
  • luatexbase.disable_callback (function)
  • luatexbase.in_callback (function)
  • luatexbase.module_error (function)
  • luatexbase.module_info (function)
  • luatexbase.module_warning (function)
  • luatexbase.new_attribute (function)
  • luatexbase.new_bytecode (function)
  • luatexbase.new_chunkname (function)
  • luatexbase.new_luafunction (function)
  • luatexbase.new_whatsit (function)
  • luatexbase.provides_module (function)
  • luatexbase.registernumber (function)
  • luatexbase.remove_from_callback (function)
  • luatexbase.uninstall (function)

mbox

  • mbox.parse (function)
  • mbox.parse_from (function)
  • mbox.parse_header (function)
  • mbox.parse_headers (function)
  • mbox.parse_message (function)
  • mbox.split_headers (function)
  • mbox.split_mbox (function)
  • mbox.split_message (function)

md5

  • md5.HEX (function)
  • md5.crypt (function)
  • md5.dec (function)
  • md5.decrypt (function)
  • md5.exor (function)
  • md5.hex (function)
  • md5.sum (function)
  • md5.sumHEXA (function)
  • md5.sumhexa (function)

mime

  • mime._VERSION (string)
  • mime.b64 (function)
  • mime.decode (function)
  • mime.decodet (table)
  • mime.dot (function)
  • mime.encode (function)
  • mime.encodet (table)
  • mime.eol (function)
  • mime.normalize (function)
  • mime.qp (function)
  • mime.qpwrp (function)
  • mime.stuff (function)
  • mime.unb64 (function)
  • mime.unqp (function)
  • mime.wrap (function)
  • mime.wrapt (table)
  • mime.wrp (function)

modules

  • modules.data-con (table)
  • modules.font-afk (table)
  • modules.font-cff (table)
  • modules.font-cid (table)
  • modules.font-con (table)
  • modules.font-def (table)
  • modules.font-dsp (table)
  • modules.font-imp-effects (table)
  • modules.font-imp-italics (table)
  • modules.font-imp-ligatures (table)
  • modules.font-imp-tex (table)
  • modules.font-ini (table)
  • modules.font-lua (table)
  • modules.font-map (table)
  • modules.font-ocl (table)
  • modules.font-one (table)
  • modules.font-onr (table)
  • modules.font-osd (table)
  • modules.font-ota (table)
  • modules.font-otc (table)
  • modules.font-oti (table)
  • modules.font-otj (table)
  • modules.font-otl (table)
  • modules.font-oto (table)
  • modules.font-otr (table)
  • modules.font-ots (table)
  • modules.font-ott (table)
  • modules.font-oup (table)
  • modules.font-shp (table)
  • modules.font-ttf (table)
  • modules.font-vfc (table)
  • modules.l-boolean (table)
  • modules.l-dir (table)
  • modules.l-file (table)
  • modules.l-functions (table)
  • modules.l-io (table)
  • modules.l-lpeg (table)
  • modules.l-lua (table)
  • modules.l-math (table)
  • modules.l-md5 (table)
  • modules.l-number (table)
  • modules.l-os (table)
  • modules.l-package (table)
  • modules.l-set (table)
  • modules.l-string (table)
  • modules.l-table (table)
  • modules.l-unicode (table)
  • modules.l-url (table)
  • modules.luat-basics-gen (table)
  • modules.luatex-font-enc (table)
  • modules.luatex-font-mis (table)
  • modules.luatex-fonts-def (table)
  • modules.luatex-fonts-ext (table)
  • modules.luatex-fonts-gbn (table)
  • modules.luatex-fonts-nod (table)
  • modules.luatex-fonts-tfm (table)
  • modules.trac-inf (table)
  • modules.util-deb (table)
  • modules.util-dim (table)
  • modules.util-fil (table)
  • modules.util-jsn (table)
  • modules.util-lua (table)
  • modules.util-prs (table)
  • modules.util-sac (table)
  • modules.util-sta (table)
  • modules.util-sto (table)
  • modules.util-str (table)
  • modules.util-tab (table)
  • modules.util-tpl (table)
  • modules.util-zip (table)

mplib

  • mplib.char_depth (function)
  • mplib.char_height (function)
  • mplib.char_width (function)
  • mplib.execute (function)
  • mplib.fields (function)
  • mplib.finish (function)
  • mplib.get_boolean (function)
  • mplib.get_number (function)
  • mplib.get_numeric (function)
  • mplib.get_path (function)
  • mplib.get_string (function)
  • mplib.new (function)
  • mplib.pen_info (function)
  • mplib.solve_path (function)
  • mplib.statistics (function)
  • mplib.version (function)

node

  • node.check_discretionaries (function)
  • node.check_discretionary (function)
  • node.copy (function)
  • node.copy_list (function)
  • node.count (function)
  • node.current_attr (function)
  • node.dimensions (function)
  • node.direct (table)
  • node.effective_glue (function)
  • node.end_of_math (function)
  • node.family_font (function)
  • node.fields (function)
  • node.find_attribute (function)
  • node.first_glyph (function)
  • node.fix_node_lists (function)
  • node.flatten_discretionaries (function)
  • node.flush_list (function)
  • node.flush_node (function)
  • node.flush_properties_table (function)
  • node.free (function)
  • node.get_attribute (function)
  • node.get_properties_table (function)
  • node.getboth (function)
  • node.getchar (function)
  • node.getdisc (function)
  • node.getfield (function)
  • node.getfont (function)
  • node.getglue (function)
  • node.getid (function)
  • node.getleader (function)
  • node.getlist (function)
  • node.getnext (function)
  • node.getprev (function)
  • node.getproperty (function)
  • node.getsubtype (function)
  • node.getwhd (function)
  • node.has_attribute (function)
  • node.has_field (function)
  • node.has_glyph (function)
  • node.hpack (function)
  • node.hyphenating (function)
  • node.id (function)
  • node.insert_after (function)
  • node.insert_before (function)
  • node.is_char (function)
  • node.is_glyph (function)
  • node.is_node (function)
  • node.is_zero_glue (function)
  • node.kerning (function)
  • node.last_node (function)
  • node.length (function)
  • node.ligaturing (function)
  • node.make_extensible (function)
  • node.mlist_to_hlist (function)
  • node.new (function)
  • node.next (function)
  • node.prepend_prevdepth (function)
  • node.prev (function)
  • node.protect_glyph (function)
  • node.protect_glyphs (function)
  • node.protrusion_skippable (function)
  • node.rangedimensions (function)
  • node.remove (function)
  • node.set_attribute (function)
  • node.set_properties_mode (function)
  • node.setfield (function)
  • node.setglue (function)
  • node.setproperty (function)
  • node.slide (function)
  • node.subtype (function)
  • node.subtypes (function)
  • node.tail (function)
  • node.tostring (function)
  • node.traverse (function)
  • node.traverse_char (function)
  • node.traverse_glyph (function)
  • node.traverse_id (function)
  • node.traverse_list (function)
  • node.type (function)
  • node.types (function)
  • node.unprotect_glyph (function)
  • node.unprotect_glyphs (function)
  • node.unset_attribute (function)
  • node.usedlist (function)
  • node.uses_font (function)
  • node.values (function)
  • node.vpack (function)
  • node.whatsits (function)
  • node.write (function)

nodes

  • nodes.dirvalues (table)
  • nodes.disccodes (table)
  • nodes.glyphcodes (table)
  • nodes.handlers (table)
  • nodes.injections (table)
  • nodes.nodecodes (table)
  • nodes.nuts (table)
  • nodes.properties (table)
  • nodes.simple_font_handler (function)
  • nodes.tonode (function)
  • nodes.tonut (function)

pdf

  • pdf.fontname (function)
  • pdf.fontobjnum (function)
  • pdf.fontsize (function)
  • pdf.getcatalog (function)
  • pdf.getcompresslevel (function)
  • pdf.getcreationdate (function)
  • pdf.getdecimaldigits (function)
  • pdf.getdestmargin (function)
  • pdf.getfontname (function)
  • pdf.getfontobjnum (function)
  • pdf.getfontsize (function)
  • pdf.getgentounicode (function)
  • pdf.gethpos (function)
  • pdf.getignoreunknownimages (function)
  • pdf.getimageresolution (function)
  • pdf.getinclusionerrorlevel (function)
  • pdf.getinfo (function)
  • pdf.getlastannot (function)
  • pdf.getlastlink (function)
  • pdf.getlastobj (function)
  • pdf.getlinkmargin (function)
  • pdf.getmajorversion (function)
  • pdf.getmatrix (function)
  • pdf.getmaxobjnum (function)
  • pdf.getminorversion (function)
  • pdf.getnames (function)
  • pdf.getnofobjects (function)
  • pdf.getobjcompresslevel (function)
  • pdf.getobjtype (function)
  • pdf.getomitcharset (function)
  • pdf.getomitcidset (function)
  • pdf.getorigin (function)
  • pdf.getpageattributes (function)
  • pdf.getpageref (function)
  • pdf.getpageresources (function)
  • pdf.getpagesattributes (function)
  • pdf.getpkresolution (function)
  • pdf.getpos (function)
  • pdf.getrecompress (function)
  • pdf.getretval (function)
  • pdf.getsuppressoptionalinfo (function)
  • pdf.getthreadmargin (function)
  • pdf.gettrailer (function)
  • pdf.gettrailerid (function)
  • pdf.getvpos (function)
  • pdf.getxformattributes (function)
  • pdf.getxformmargin (function)
  • pdf.getxformname (function)
  • pdf.getxformresources (function)
  • pdf.hasmatrix (function)
  • pdf.immediateobj (function)
  • pdf.includechar (function)
  • pdf.includefont (function)
  • pdf.includeimage (function)
  • pdf.mapfile (function)
  • pdf.mapline (function)
  • pdf.maxobjnum (function)
  • pdf.newcolorstack (function)
  • pdf.obj (function)
  • pdf.objtype (function)
  • pdf.pageref (function)
  • pdf.print (function)
  • pdf.refobj (function)
  • pdf.registerannot (function)
  • pdf.reserveobj (function)
  • pdf.setcatalog (function)
  • pdf.setcompresslevel (function)
  • pdf.setdecimaldigits (function)
  • pdf.setdestmargin (function)
  • pdf.setfontattributes (function)
  • pdf.setforcefile (function)
  • pdf.setgentounicode (function)
  • pdf.setignoreunknownimages (function)
  • pdf.setimageresolution (function)
  • pdf.setinclusionerrorlevel (function)
  • pdf.setinfo (function)
  • pdf.setlinkmargin (function)
  • pdf.setmajorversion (function)
  • pdf.setminorversion (function)
  • pdf.setnames (function)
  • pdf.setobjcompresslevel (function)
  • pdf.setomitcharset (function)
  • pdf.setomitcidset (function)
  • pdf.setorigin (function)
  • pdf.setpageattributes (function)
  • pdf.setpageresources (function)
  • pdf.setpagesattributes (function)
  • pdf.setpkresolution (function)
  • pdf.setrecompress (function)
  • pdf.setsuppressoptionalinfo (function)
  • pdf.setthreadmargin (function)
  • pdf.settrailer (function)
  • pdf.settrailerid (function)
  • pdf.settypeonewidemode (function)
  • pdf.setxformattributes (function)
  • pdf.setxformmargin (function)
  • pdf.setxformresources (function)
  • pdf.xformname (function)

pdfe

  • pdfe.arraytotable (function)
  • pdfe.close (function)
  • pdfe.closestream (function)
  • pdfe.dictionarytotable (function)
  • pdfe.getarray (function)
  • pdfe.getboolean (function)
  • pdfe.getbox (function)
  • pdfe.getcatalog (function)
  • pdfe.getdictionary (function)
  • pdfe.getfromarray (function)
  • pdfe.getfromdictionary (function)
  • pdfe.getfromreference (function)
  • pdfe.getfromstream (function)
  • pdfe.getinfo (function)
  • pdfe.getinteger (function)
  • pdfe.getmemoryusage (function)
  • pdfe.getname (function)
  • pdfe.getnofobjects (function)
  • pdfe.getnofpages (function)
  • pdfe.getnumber (function)
  • pdfe.getpage (function)
  • pdfe.getpages (function)
  • pdfe.getsize (function)
  • pdfe.getstatus (function)
  • pdfe.getstream (function)
  • pdfe.getstring (function)
  • pdfe.gettrailer (function)
  • pdfe.getversion (function)
  • pdfe.new (function)
  • pdfe.open (function)
  • pdfe.openstream (function)
  • pdfe.pagestotable (function)
  • pdfe.readfromstream (function)
  • pdfe.readwholestream (function)
  • pdfe.type (function)
  • pdfe.unencrypt (function)

pdfscanner

  • pdfscanner.scan (function)

set

  • set.contains (function)
  • set.create (function)
  • set.tolist (function)
  • set.tonumber (function)
  • set.totable (function)

sha2

  • sha2.digest256 (function)
  • sha2.digest384 (function)
  • sha2.digest512 (function)

sio

  • sio.read2dot14 (function)
  • sio.readbytes (function)
  • sio.readbytetable (function)
  • sio.readcardinal1 (function)
  • sio.readcardinal1le (function)
  • sio.readcardinal2 (function)
  • sio.readcardinal2le (function)
  • sio.readcardinal3 (function)
  • sio.readcardinal3le (function)
  • sio.readcardinal4 (function)
  • sio.readcardinal4le (function)
  • sio.readcardinaltable (function)
  • sio.readfixed2 (function)
  • sio.readfixed4 (function)
  • sio.readinteger1 (function)
  • sio.readinteger1le (function)
  • sio.readinteger2 (function)
  • sio.readinteger2le (function)
  • sio.readinteger3 (function)
  • sio.readinteger3le (function)
  • sio.readinteger4 (function)
  • sio.readinteger4le (function)
  • sio.readintegertable (function)

socket

  • socket.BLOCKSIZE (number)
  • socket._DATAGRAMSIZE (number)
  • socket._DEBUG (boolean)
  • socket._SETSIZE (number)
  • socket._SOCKETINVALID (number)
  • socket._VERSION (string)
  • socket.__unload (function)
  • socket.bind (function)
  • socket.choose (function)
  • socket.connect (function)
  • socket.connect4 (function)
  • socket.connect6 (function)
  • socket.dns (table)
  • socket.ftp (table)
  • socket.gettime (function)
  • socket.headers (table)
  • socket.http (table)
  • socket.newtry (function)
  • socket.protect (function)
  • socket.select (function)
  • socket.sink (function)
  • socket.sinkt (table)
  • socket.skip (function)
  • socket.sleep (function)
  • socket.smtp (table)
  • socket.source (function)
  • socket.sourcet (table)
  • socket.tcp (function)
  • socket.tcp4 (function)
  • socket.tcp6 (function)
  • socket.tp (table)
  • socket.try (function)
  • socket.udp (function)
  • socket.udp4 (function)
  • socket.udp6 (function)
  • socket.url (table)

statistics

  • statistics.benchmarktimer (function)
  • statistics.currenttime (function)
  • statistics.elapsed (function)
  • statistics.elapsedindeed (function)
  • statistics.elapsedseconds (function)
  • statistics.elapsedtime (function)
  • statistics.enable (boolean)
  • statistics.formatruntime (function)
  • statistics.hastiming (function)
  • statistics.memused (function)
  • statistics.register (function)
  • statistics.resettiming (function)
  • statistics.runtime (function)
  • statistics.show (function)
  • statistics.starttiming (function)
  • statistics.stoptiming (function)
  • statistics.threshold (number)
  • statistics.timed (function)
  • statistics.tracefunction (function)

status

  • status.list (function)
  • status.resetmessages (function)
  • status.setexitcode (function)

tex

  • tex.attribute (table)
  • tex.badness (function)
  • tex.box (table)
  • tex.catcode (table)
  • tex.count (table)
  • tex.cprint (function)
  • tex.definefont (function)
  • tex.delcode (table)
  • tex.dimen (table)
  • tex.enableprimitives (function)
  • tex.error (function)
  • tex.extraprimitives (function)
  • tex.finish (function)
  • tex.fontidentifier (function)
  • tex.fontname (function)
  • tex.force_synctex_line (function)
  • tex.force_synctex_tag (function)
  • tex.forcehmode (function)
  • tex.get (function)
  • tex.get_synctex_line (function)
  • tex.get_synctex_mode (function)
  • tex.get_synctex_tag (function)
  • tex.getattribute (function)
  • tex.getbox (function)
  • tex.getboxresourcebox (function)
  • tex.getboxresourcedimensions (function)
  • tex.getcatcode (function)
  • tex.getcount (function)
  • tex.getdelcode (function)
  • tex.getdelcodes (function)
  • tex.getdimen (function)
  • tex.getfontoffamily (function)
  • tex.getglue (function)
  • tex.getlccode (function)
  • tex.getlist (function)
  • tex.getlocallevel (function)
  • tex.getmark (function)
  • tex.getmath (function)
  • tex.getmathcode (function)
  • tex.getmathcodes (function)
  • tex.getmodevalues (function)
  • tex.getmuglue (function)
  • tex.getmuskip (function)
  • tex.getnest (function)
  • tex.getpagestate (function)
  • tex.getsfcode (function)
  • tex.getskip (function)
  • tex.gettoks (function)
  • tex.getuccode (function)
  • tex.glue (table)
  • tex.hashtokens (function)
  • tex.init_rand (function)
  • tex.isattribute (function)
  • tex.isbox (function)
  • tex.iscount (function)
  • tex.isdimen (function)
  • tex.isglue (function)
  • tex.ismuglue (function)
  • tex.ismuskip (function)
  • tex.isskip (function)
  • tex.istoks (function)
  • tex.lccode (table)
  • tex.linebreak (function)
  • tex.lists (table)
  • tex.lua_math_random (function)
  • tex.lua_math_randomseed (function)
  • tex.mathcode (table)
  • tex.muglue (table)
  • tex.muskip (table)
  • tex.nest (table)
  • tex.normal_rand (function)
  • tex.number (function)
  • tex.primitives (function)
  • tex.print (function)
  • tex.quittoks (function)
  • tex.resetparagraph (function)
  • tex.romannumeral (function)
  • tex.round (function)
  • tex.run (function)
  • tex.runtoks (function)
  • tex.saveboxresource (function)
  • tex.scale (function)
  • tex.scantoks (function)
  • tex.set (function)
  • tex.set_synctex_line (function)
  • tex.set_synctex_mode (function)
  • tex.set_synctex_no_files (function)
  • tex.set_synctex_tag (function)
  • tex.setattribute (function)
  • tex.setbox (function)
  • tex.setcatcode (function)
  • tex.setcount (function)
  • tex.setdelcode (function)
  • tex.setdimen (function)
  • tex.setglue (function)
  • tex.setlccode (function)
  • tex.setlist (function)
  • tex.setmath (function)
  • tex.setmathcode (function)
  • tex.setmuglue (function)
  • tex.setmuskip (function)
  • tex.setnest (function)
  • tex.setsfcode (function)
  • tex.setskip (function)
  • tex.settoks (function)
  • tex.setuccode (function)
  • tex.sfcode (table)
  • tex.shipout (function)
  • tex.show_context (function)
  • tex.skip (table)
  • tex.sp (function)
  • tex.splitbox (function)
  • tex.sprint (function)
  • tex.toks (table)
  • tex.tprint (function)
  • tex.triggerbuildpage (function)
  • tex.uccode (table)
  • tex.uniform_rand (function)
  • tex.uniformdeviate (function)
  • tex.useboxresource (function)
  • tex.write (function)

texconfig

  • texconfig.kpse_init (boolean)

texio

  • texio.closeinput (function)
  • texio.reporter (function)
  • texio.setescape (function)
  • texio.write (function)
  • texio.write_nl (function)

token

  • token.biggest_char (function)
  • token.command_id (function)
  • token.commands (function)
  • token.create (function)
  • token.expand (function)
  • token.get_active (function)
  • token.get_cmdname (function)
  • token.get_command (function)
  • token.get_csname (function)
  • token.get_expandable (function)
  • token.get_id (function)
  • token.get_index (function)
  • token.get_macro (function)
  • token.get_meaning (function)
  • token.get_mode (function)
  • token.get_next (function)
  • token.get_protected (function)
  • token.get_tok (function)
  • token.is_defined (function)
  • token.is_token (function)
  • token.new (function)
  • token.put_next (function)
  • token.scan_argument (function)
  • token.scan_code (function)
  • token.scan_csname (function)
  • token.scan_dimen (function)
  • token.scan_float (function)
  • token.scan_glue (function)
  • token.scan_int (function)
  • token.scan_keyword (function)
  • token.scan_keyword_cs (function)
  • token.scan_list (function)
  • token.scan_real (function)
  • token.scan_string (function)
  • token.scan_token (function)
  • token.scan_toks (function)
  • token.scan_word (function)
  • token.set_char (function)
  • token.set_lua (function)
  • token.set_macro (function)
  • token.type (function)

trackers

  • trackers.disable (function)
  • trackers.enable (function)
  • trackers.name (string)
  • trackers.newline (function)
  • trackers.register (function)

unicode

  • unicode.ascii (table)
  • unicode.grapheme (table)
  • unicode.latin1 (table)
  • unicode.utf8 (table)

url

  • url.addscheme (function)
  • url.barepath (function)
  • url.construct (function)
  • url.decode (function)
  • url.encode (function)
  • url.escape (function)
  • url.filename (function)
  • url.hashed (function)
  • url.hasscheme (function)
  • url.query (function)
  • url.split (function)
  • url.toquery (function)
  • url.unescape (function)
  • url.unescapeget (function)

utf

  • utf.byte (function)
  • utf.char (function)
  • utf.characters (function)
  • utf.chrlen (function)
  • utf.count (function)
  • utf.filetype (function)
  • utf.is_valid (function)
  • utf.len (function)
  • utf.length (function)
  • utf.lower (function)
  • utf.magic (function)
  • utf.remapper (function)
  • utf.replacer (function)
  • utf.split (function)
  • utf.splitlines (function)
  • utf.sub (function)
  • utf.subtituter (function)
  • utf.tocodes (function)
  • utf.toeight (function)
  • utf.toentities (function)
  • utf.totable (function)
  • utf.toutf32string (function)
  • utf.upper (function)
  • utf.ustring (function)
  • utf.utf16_to_utf8_be (function)
  • utf.utf16_to_utf8_be_t (function)
  • utf.utf16_to_utf8_le (function)
  • utf.utf16_to_utf8_le_t (function)
  • utf.utf16_to_utf8_t (function)
  • utf.utf32_to_utf8_be (function)
  • utf.utf32_to_utf8_be_t (function)
  • utf.utf32_to_utf8_le (function)
  • utf.utf32_to_utf8_le_t (function)
  • utf.utf32_to_utf8_t (function)
  • utf.utf8_to_utf16 (function)
  • utf.utf8_to_utf16_be (function)
  • utf.utf8_to_utf16_le (function)
  • utf.utf8_to_utf8_t (function)
  • utf.values (function)
  • utf.xstring (function)

utilities

  • utilities.debugger (table)
  • utilities.files (table)
  • utilities.json (table)
  • utilities.lua (table)
  • utilities.parsers (table)
  • utilities.stacker (table)
  • utilities.storage (table)
  • utilities.streams (table)
  • utilities.strings (table)
  • utilities.tables (table)
  • utilities.templates (table)
  • utilities.zipfiles (table)

vf

  • vf.char (function)
  • vf.down (function)
  • vf.fontid (function)
  • vf.image (function)
  • vf.node (function)
  • vf.nop (function)
  • vf.pdf (function)
  • vf.pop (function)
  • vf.push (function)
  • vf.right (function)
  • vf.rule (function)
  • vf.special (function)

xzip

  • xzip.adler32 (function)
  • xzip.compress (function)
  • xzip.compressobj (function)
  • xzip.crc32 (function)
  • xzip.decompress (function)
  • xzip.decompressobj (function)
  • xzip.version (function)

zip

  • zip._COPYRIGHT (string)
  • zip._DESCRIPTION (string)
  • zip._VERSION (string)
  • zip.close (function)
  • zip.open (function)
  • zip.openfile (function)
  • zip.type (function)

zlib

  • zlib.adler32 (function)
  • zlib.compress (function)
  • zlib.compressobj (function)
  • zlib.crc32 (function)
  • zlib.decompress (function)
  • zlib.decompressobj (function)
  • zlib.version (function)
local function printf(s, ...) print(string.format(s, ...)) end

local function sort_keys(t)
    local keys = {}
    for k in pairs(t) do table.insert(keys, k) end
    table.sort(keys)
    return keys
end

local function print_lib_members(lib_name, lib)
    local member_names = sort_keys(lib)
    for _, member in ipairs(member_names) do
        local member_type = type(lib[member])
        if member_type == 'table' then
            printf('- *`%s.%s` (%s)*', lib_name, member, member_type)
        elseif member_type == 'function' then
            printf('- __`%s.%s` (%s)__', lib_name, member, member_type)
        else
            printf('- `%s.%s` (%s)', lib_name, member, member_type)
        end
    end
end

local lua_std = {
    _G = true,
    boolean = true,
    coroutine = true,
    debug = true,
    io = true,
    math = true,
    number = true,
    os = true,
    package = true,
    string = true,
    table = true,
    utf8 = true
}

return function()
    local env = _ENV
    local lib_names = sort_keys(env)
    for _, lib_name in ipairs(lib_names) do
        if not lua_std[lib_name] then

            local lib = env[lib_name]
            if type(lib) == 'table' then
                printf('\n### %s\n', lib_name)
                print_lib_members(lib_name, env[lib_name])
            end
        end
    end
end

About

Type definitions / Stubs for the Lua API / interface of LuaTeX and related Lua modules.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 64.6%
  • TeX 33.6%
  • HTML 1.6%
  • Other 0.2%