Expand description
The retex TeX engine: a clean-room implementation of LuaTeX’s typesetting machine.
The Engine holds all state of a TeX run. Its methods are spread
over modules following the parts of TeX: The Program:
Modules§
- align
- Alignments:
\halignand\valign(TeX: The Program §768–§812). - backend
- Backend variables and feedback (
\pdfvariable,\pdffeedback,\dvivariable,\dvifeedback). - build
- Building boxes and lists (TeX: The Program §1055–§1135, with e-TeX’s and LuaTeX’s changes).
- clock
- The job’s start time:
\time,\day,\month,\year, the log banner and the PDF creation date. - cmd
- Command codes and their ranges.
- codes
- Character codes: IniTeX defaults and LuaTeX’s packed math and delimiter codes.
- cond
- Conditional processing (TeX: The Program §487–§510, plus the e-TeX and LuaTeX conditionals).
- diag
- Structured diagnostics for retex’s default output mode.
- dirs
- Directions: the direction parameters (
\pagedir,\bodydir,\pardir,\textdir,\mathdir,\linedirand their numeric…directionforms), the directions of boxes, and the direction nodes (\begindir/\enddir) that text-direction changes leave in horizontal lists (LuaTeX manual §3.3). - display
- Displaying boxes, glue, equivalents and the semantic nest (TeX: The
Program §173–§198, §218–§219, §252; e-TeX
show_save_groups). - dvi
- The DVI writer (TeX: The Program §583–§602, §617–§642), as LuaTeX
uses it when
\outputmode=0. - eqtb
- The table of equivalents (TeX’s
eqtb) and its storage. - error
- Error reporting and recovery (TeX: The Program §71–§98, §311–§320).
- expand
- Expansion (TeX: The Program §366–§401, with e-TeX and LuaTeX
additions):
expand, macro calls,\csname,\noexpand,\input. - expansion
- Font expansion (hz):
\adjustspacing,\expandglyphsinfont,\efcodeand theexpansion_factorof glyph and kern nodes. - files
- Files:
\input, the log file,\openin/\read,\scantokenspseudo-files and the record of files read and written that the pass driver uses (TeX: The Program §511–§538, §480–§486; e-TeX). - fonts
- Fonts as TeX sees them: metrics, parameters (
\fontdimen), identifiers and font-related assignments (TeX: The Program §539–§582, §1252–§1261). - format
- Format files: dumping the engine state after an IniTeX run (
\dump) and loading it at the start of a normal run. - glue
- Glue specifications.
- hash
- The control-sequence table (TeX’s
hash). - hmode
- Characters and spaces in horizontal mode (TeX: The Program §1034–§1044, LuaTeX style).
- hyph
- Language data:
\patterns,\hyphenation,\hjcodeand the per-language hyphen characters (LuaTeX manual §5.4–§5.8), stored per\languagewithretex-hyph. - image
- Image resources:
\saveimageresource,\useimageresource,\lastsavedimageresourceindexand\lastsavedimageresourcepages. - init
- Engine construction, IniTeX initialization and the job driver.
- input
- The input stack and the tokenizer (TeX: The Program §300–§365).
- linebreak
- Breaking paragraphs into lines (TeX: The Program §813–§890, with
e-TeX’s
\lastlinefitand penalty arrays, and LuaTeX’s changes). - macroprof
- A macro profiler for performance work: with
RETEX_MACRO_PROFILE=<file>in the environment, every macro call is counted per control sequence, and every 64th call samples the macros being expanded on the input stack (inclusive counts). The report, written at the end of the run, groups both by package prefix (\pgfmath…,\__fp_…,\@…) to show which TeX-coded libraries the time goes to;<file>.tsvlists every macro (calls, inclusive samples, name). - maincontrol
- The chief executive (TeX: The Program §1029–§1054) and the semantic nest (§211–§219).
- math
- Building math lists (TeX: The Program §1136–§1206, with e-TeX’s
\middleand LuaTeX’s extensions). - mathdisplay
- Displaying noads (TeX: The Program §690–§698) in LuaTeX’s format.
- mathparams
- LuaTeX’s math parameters (
\Umath…) and how font assignments set them. - meaning
- Printing control sequences, token lists and meanings (TeX: The Program §262–§299).
- misc
- Smaller commands: extensions (
\write,\openout,\special), LuaTeX’snormalcommands, hyphenation data, directions, random numbers, Lua calls and backend hooks. - mlist
- Converting math lists to horizontal lists (TeX: The Program
§699–§767, with e-TeX’s
\middle) the way LuaTeX does it for traditional (TFM) fonts. - native
- Native implementations of macros from TeX-coded libraries (
pgfmath,l3fp, …). - nodeproc
- LuaTeX’s node processing before packaging and line breaking: the hyphenation, ligaturing and kerning passes (LuaTeX manual §5.5–§5.6).
- nodes
- Node memory: an arena of typesetting nodes addressed by
NodeRef. - pack
- Packaging:
hpackandvpackage(TeX: The Program §644–§679). - page
- Breaking vertical lists into pages:
\vsplit, the page builder, the output routine and\shipout(TeX: The Program §967–§1028 and §638, with e-TeX’s mark classes and saved discards). - pagenote
- Explanations for underfull pages, for the default output mode.
- pdfext
\pdfextension(LuaTeX manual §3.2.2): PDF literals, matrices, colour stacks, objects, annotations, links, destinations, outlines and document-level dictionaries.- prefixed
- Assignments (
prefixed_command, TeX: The Program §1211–§1280, with e-TeX and LuaTeX additions). - primitives
- Lookup tables over LuaTeX’s primitives (
crate::primitives_gen). - primitives_
gen - LuaTeX’s primitive table: names, command codes, modifiers and groups.
- Low-level output: terminal, log file, strings and
\writestreams. - protrusion
- Character protrusion (margin kerning):
\protrudechars,\lpcode,\rpcode, margin kern nodes,\leftmarginkernand\rightmarginkern. - save
- Grouping and the save stack (TeX: The Program §268–§284, with the e-TeX tracing extensions).
- scan
- Scanning numbers, dimensions, glue, keywords and token lists (TeX: The Program §402–§486, e-TeX §1490ff, LuaTeX extensions).
- shipout
- Shipping pages out (TeX: The Program §592–§640, LuaTeX’s PDF backend positions).
- showbox
- Displaying node lists in LuaTeX’s formats (TeX: The Program §173–§198, §218–§219, §986).
- snapshot
- Resuming a run from a snapshot of the process.
- synctex
- SyncTeX output (
\synctex,-synctex): the<job>.synctex.gzfile with which editors and viewers map source lines to positions in the PDF and back. - the
\the,\unexpanded,\detokenize, conversion commands (\number,\string,\meaning, …) and the\showfamily (TeX: The Program §464–§472, §1293–§1298, e-TeX and LuaTeX additions).- timing
- Phase timing for performance work: with
RETEX_TIMINGset in the environment,markprints the time elapsed since the first mark to stderr, andAccumulators report their totals at [report]. - token
- Tokens and token lists.
- typeset
- Typesetting: shared state, hooks and small helpers.
- utf8x
- UTF-8 encoding for TeX characters.
Structs§
- Engine
- The global state of a TeX run.
Enums§
- List
Filter - Result of a node-list filter callback.
Traits§
- LuaHost
- Callbacks from the engine into an embedded Lua interpreter.
Type Aliases§
- Engine
Hook - A one-shot callback into the host, run with the engine borrowed.
- Prompt
Hook - Shows diagnostics before the terminal is read (see
Engine::prompt_hook).