「‍」 Lingenic

Command Reference

Version 2.0

Naming Conventions

Lingenic Compose distinguishes two command types:

File Types

ExtensionPurposeMIME Type
.composeSource document (full language)text/vnd.lingenic.compose
.composedProcessed output (static content, links preserved)text/vnd.lingenic.composed
.compose-styleStyle librarytext/vnd.lingenic.compose-styles
.compose-templateTemplate librarytext/vnd.lingenic.compose-templates

Magic Line

The first line of .compose and .composed files must be:

.* 「‍」 Lingenic Compose 1.1

The version number (here 1.1) identifies which specification the document targets. Tools use this to determine feature availability and compatibility. Omitting the version implies the latest stable release.

Processing pipeline: .compose → process → .composed → render → PDF / HTML / terminal.

.composed files have static content (variables, conditionals, includes resolved) but active navigation (URLs, internal references, cross-references preserved). Like PDF: content is fixed, links still work.

Units

Default

ShortVerboseUnitScale
(none)Centipoints7200 per inch (Compose internal unit)

Bare numbers without a unit suffix are centipoints — the original Compose fine-positioning unit, 100× finer than standard 72 DPI, allowing detail at holographic levels.

Typographic

ShortVerboseUnitScale
mpmillipointsMillipoints72000 per inch (1/1000 point)
ptpointsPoints72 per inch (standard DTP)
pcpicasPicas6 per inch (12 points)
cccicerosCiceros~5.63 per inch (European)

Metric

ShortVerboseUnitScale
mmmillimetersMillimeters25.4 per inch
cmcentimetersCentimeters2.54 per inch
mmetersMetersLarge format output

Imperial

ShortVerboseUnitScale
ininchesInches1 inch

Relative

ShortVerboseUnitScale
lnlinesLinesCurrent line spacing

Values can be absolute or relative (+ or - prefix).

Examples:

.indent 7200    1 inch (7200 centipoints)
.indent 1in    1 inch
.indent 72pt    1 inch (72 standard points)
.indent 100    100 centipoints (fine positioning)

Text Alignment

Command
.align-both
.align-center
.align-inside
.align-left
.align-outside
.align-right

Content Blocks

Command
.begin-artwork / .end-artwork
.begin-footnote / .end-footnote
.begin-keep / .end-keep
.begin-literal / .end-literal
.begin-picture / .end-picture
.title (single-line title)

Breaks

Command
.break
.break-block
.break-column
.break-format
.break-need
.break-page
.break-skip
.break-word

Change Bars

Command
.change-bars-addition
.change-bars-deletion
.change-bars-modification
.change-bars-off
.change-bars-on

Conditionals

Command
.if
.then
.else
.elseif
.endif

Delimiters

Command
.change-symbol-delimiter
.change-title-delimiter

Fill Mode

Command
.fill-default
.fill-off
.fill-on

Fonts

Command
.font
.font-name name
.font-size size

Footnotes

Command
.footnote-reference
.footnotes-held
.footnotes-paged
.footnotes-running
.footnotes-unreferenced
.insert-footnotes

Headers and Footers

Multics had multiple redundant forms. Lingenic simplifies: .begin-header / .end-header (multi-line) and position commands (single-line).

.header-left current_file
.header-right "Page " page_number
.footer-center current_date

Arguments are expressions: identifiers with underscores are variables, quoted strings are literals, space-separated values concatenate.

Multi-Line (Regions)

Command
.begin-header / .end-header
.begin-footer / .end-footer
.begin-column-header / .end-column-header
.begin-column-footer / .end-column-footer
.begin-title / .end-title

Single-Line

Command
.header-left / .header-center / .header-right
.footer-left / .footer-center / .footer-right
.header-footnote
.column-header-left / -center / -right
.column-footer-left / -center / -right

Position commands accept optional all, even, or odd page selector.

Horizontal Tabs

Command
.horizontal-tabs-define
.horizontal-tabs-off
.horizontal-tabs-on

Hyphenation

Command
.hyphenate-default
.hyphenate-off
.hyphenate-on
.hyphenate-word

Indentation

Command
.indent
.indent-both
.indent-left
.indent-right
.indent-controls

File Insertion

Command
.insert-file
.insert-graphic
.insert-template
.insert-index

Labels and Control Flow

Command
.label
.go-to
.return
.begin-repeat / .end-repeat
.begin-while / .end-while
.begin-foreach / .end-foreach

Line Spacing

Command
.linespace

Page Definition

Command
.page-define
.page-define-columns
.page-define-length
.page-define-width
.page-margin-left

Variables and Counters

Command
.set-variable
.set-counter
.set-counter-mode

Variables contain underscores: my_var, _count, total_

Counter Display Modes

ModeOutputExample
numericArabic numerals1, 2, 3, 4...
romanLowercase romani, ii, iii, iv...
RomanUppercase romanI, II, III, IV...
alphaLowercase lettersa, b, c...z, aa, ab...
AlphaUppercase lettersA, B, C...Z, AA, AB...

Spacing

Command
.space
.space-with-block-break
.space-with-format-break
.space-to-page-depth
.space-ensure-total

Fine Spacing

CommandDescriptionWidth
.space-thinThin space3/18 em
.space-mediumMedium space4/18 em
.space-thickThick space5/18 em
.space-negative-thinNegative thin space−3/18 em
.space-emEm space1 em
.space-double-emDouble em space2 em

Tables

Pipe-delimited syntax:

.begin-table 2in 1in 3in
Item   | Qty | Price
---
Widget |   5 | $10
Gadget |   3 | $15
---
Total  |     | $25
.end-table

Vertical Alignment

Command
.vertical-align-top
.vertical-align-center
.vertical-align-bottom
.vertical-align-justified

Titles and Captions

Single-line commands. Long text wraps when rendered.

.title Chapter One: Introduction
.caption Figure 1: System Architecture
Command
.title
.caption

Character Translation

Character substitution using pattern syntax.

.translate from {a} to {b}           .* global mode — all subsequent text
.translate my_text from {a} to {b}   .* translate variable
.translate-off                       .* turn off global mode
Command
.translate [var] from {x} to {y}
.translate-off

Underscoring

Command
.underscore-on
.underscore-off

Undenting

Command
.undent
.undent-both
.undent-hanging
.undent-left
.undent-nobreak
.undent-right

Vertical Margins

Command
.vertical-margin-all
.vertical-margin-bottom
.vertical-margin-footer
.vertical-margin-header
.vertical-margin-top

Widow Control

Command
.widow
.widow-footnote
.widow-text

I/O Commands

Command
.read
.type
.wait
.write-formatted
.write-text
.begin-read / .end-read
.begin-type / .end-type

Device and Miscellaneous

Command
.device-control
.invoke-tool
.request
.defer-until
.equation-count
.error
.execute
.galley-mode
.test

Index Entries

Command
.hit
.hit-file

Rules

Command
.horizontal-rule
.vertical-rule

Text Wrap

Use position=left wrap or position=right wrap attributes on graphics/pictures.

Lingenic Extensions

New commands not present in Multics Compose:

Lists

CommandDescription
.begin-list [numbered|bulleted|definition]Begin list
.end-listEnd list
.list-itemList item
.list-term termDefinition term
.list-definitionDefinition text
.list-style styleSet marker style

Floats

CommandDescription
.begin-figure [label] [position]Begin figure
.end-figureEnd figure
.begin-table-float [label] [position]Begin floating table
.end-table-floatEnd floating table
.caption textFigure/table caption
.caption-position above|belowCaption placement
.clear left|right|bothClear floats

Cross-References

CommandDescription
.label nameCreate reference target
.refer(name)Reference by number
.refer(name, page)Reference with page
.counter name [start]Define counter
.counter-style name styleSet counter format

Notes

CommandDescription
.begin-endnoteBegin endnote
.end-endnoteEnd endnote
.endnotes-chapterCollect per chapter
.endnotes-documentCollect at document end
.insert-endnotesOutput endnotes
.begin-sidenoteBegin sidenote
.end-sidenoteEnd sidenote
.sidenote-position left|right|outside|insideMargin placement

Bibliography

Citations use @key inline. Style determines format (author-date, footnote, endnote, etc.).

.set-citation-style author-date
According to @smith2020, the results were significant.
See also @jones2019:42-50 for discussion.

.bibliography
SyntaxDescription
@keyInline citation
@key:42Citation with page
@key:42-50Citation with page range
CommandDescription
.begin-source keyBegin source definition
.end-sourceEnd source definition
.import-bibliography "file"Import BibTeX/CSL/RIS
.set-citation-style styleauthor-date, footnote, endnote, numeric
.bibliographyOutput bibliography

Named Blocks

Reusable content chunks. Styles handle formatting, variables handle values, named blocks handle reusable content.

CommandDescription
.begin-define nameBegin named block
.end-defineEnd named block
.insert nameInsert named block
.begin-define signature
Best regards,
John Smith
.end-define

.insert signature

Styles

CommandDescription
.begin-define-style nameBegin style definition
.end-defineEnd style definition
.begin-style nameApply style
.end-styleEnd styled content
.default-style elementSet element default
.include-styles "file"Load style library
.when-hoverInteractive hover state (screen)
.when-clickInteractive click action (screen)
.end-whenEnd interaction block

Modes

Conditional content and styles based on processing mode. Built-in: print, screen. User-defined modes supported.

.mode draft
  TODO: fix this section
.end-mode

.mode print
  See printed appendix for details.
.end-mode

Multiple modes active at once: compose doc.compose --mode print,final

CommandDescription
.mode nameBegin mode-specific block
.end-modeEnd mode block

Pattern Matching

Used with .begin-read / .end-read (see I/O Commands).

PatternDescription
{word}Match literal word
{defined_variable}Variable in pattern (substitutes)
{captured_text...}Capture prefix
{...captured_text...}Capture infix
{...captured_text}Capture suffix
{...discard...}Match and discard
{a|b}Alternation
\\Literal backslash
\{ \}Literal braces
\snake_caseLiteral snake_case (not variable)

Inline Functions

Functions use .verb() syntax — the parentheses distinguish them from commands.

FunctionDescription
.calculate(expr)Math evaluation
.evaluate(expr)Symbolic math (CAS)
.compute(expr)Financial/statistical
.fetch(name)Environment variable
.execute(cmd)Shell command
.invoke-tool(tool, args)External tool/plugin
.request(api, params)API/service call
.format(value, pattern)Format value
.randomize(a, b, c)Random selection

Expression Domains

CommandDescription
.require domainRequire domain
.configure domain backendConfigure backend

Core Math Domain

The .calculate() function evaluates arithmetic expressions. Unicode operators supported.

CategoryOperations
Arithmetic+ × ÷ mod
Comparison< > = (returns 0 or 1)
Functions sin cos tan log ln exp abs min max ⌊⌋ ⌈⌉
Constantsπ e

Mathematics

Math is pure Unicode, rendered in monospace. Code moved to monospace decades ago; math just did. See Mathematics for the full reference.

CommandDescription
.begin-mathBegin math block
.end-mathEnd math block

Everything else is Unicode:

.begin-math
       ⎧ 𝑥    if 𝑥 > 0
𝑓(𝑥) = ⎨ 0    if 𝑥 = 0
       ⎩ −𝑥   if 𝑥 < 0
.end-math

.begin-math
    𝑎 + 𝑏
   ⎯⎯⎯⎯⎯⎯⎯
    𝑐 + 𝑑
.end-math

.begin-math
⎡ 1  0  0 ⎤
⎢ 0  1  0 ⎥
⎣ 0  0  1 ⎦
.end-math

Unicode provides: math italic (𝑎𝑏𝑐𝑥𝑦𝑧), Greek (αβγθπω), operators (+ − × ÷ = ≠ ≤ ≥), roots (√∛∜), summation (∑∏), integrals (⌠⎮⌡), sub/superscripts (₀₁₂²³ⁿ), brackets (⎡⎢⎣ ⎧⎨⎩), fraction bar (⎯), vinculum (⎽).

The source is monospace-aligned and readable — exactly as it should be. For antique calligraphic rendering, embed LaTeX.

Typography

CommandDescription
.tracking [value]Letter spacing
.kerning on|offPair kerning
.drop-cap [lines]Drop capital
.hanging-punctuation on|offHanging punctuation
.optical-alignment on|offOptical margins

Parallel Text

For bilingual editions, synoptic texts, code with commentary.

CommandDescription
.begin-parallel [columns]Begin parallel text (default: 2 columns)
.end-parallelEnd parallel text
.next-parallel-columnSwitch to next column (syncs automatically)
.parallel-column [n]Jump to specific column
.parallel-gutter [value]Space between columns
.begin-parallel 2
Nel mezzo del cammin di nostra vita
mi ritrovai per una selva oscura,
ché la diritta via era smarrita.
.next-parallel-column
Midway upon the journey of our life
I found myself within a forest dark,
For the straightforward pathway had been lost.
.end-parallel

Ruby Text

CommandDescription
.ruby base "annotation"Ruby annotation
.annotate(base, "reading")Inline ruby annotation
.ruby-position above|below|rightAnnotation position
.ruby-size [ratio]Annotation size

Accessibility

CommandDescription
.insert-graphic "path" alt="text"Image with alt text
.language codeSet language
.abbreviation SHORT "expansion"Define abbreviation

Built-in Variables

Any identifier containing an underscore is a variable. The underscore can appear anywhere: prefix (_count), infix (page_number), or suffix (total_).

Internationalization: The underscore syntax works universally across scripts. Languages without word boundaries (Chinese, Japanese, Thai) can use prefix or suffix: 计数_, _カウント. RTL scripts work naturally: _عداد. The ASCII underscore is unambiguous in any writing system.

Variable Typography

Typography distinguishes variable types:

TypeTypographyExample
StringRegular textauthor_name, document_title
NumericUnicode italic𝑥, 𝑦, 𝑟, 𝑛

Unicode italic for numeric variables avoids collision with domain functions (sin, cos, log, max) which use regular ASCII.

.if page_number > 1
.header-left current_file
.header-right "Page " page_number
.footer-center current_date
This is page page_number of page_count.

Page State

VariableDescription
page_numberCurrent page number
page_nextNext page number
page_countTotal pages processed
page_linesLines on current page
page_lengthPage length in lines
lines_remainingLines remaining on page
page_rectoWhether on front page (recto)

Margins & Spacing

VariableDescription
margin_topTop margin
margin_bottomBottom margin
indent_leftLeft indent
indent_rightRight indent
undent_leftLeft undent (outdent)
undent_rightRight undent
margin_headerHeader margin
margin_footerFooter margin
header_spaceSpace after header
line_spaceLine spacing
line_measureCurrent line measure (width)

Text State

VariableDescription
text_depthCurrent text depth
text_lineCurrent line in text
text_widthCurrent text width
mode_alignCurrent alignment mode
mode_fillFill mode (on/off)
mode_keepKeep mode (on/off)

Typography

VariableDescription
font_nameCurrent font name
point_sizeCurrent point size

Block Context

VariableDescription
block_indexCurrent block index
block_nameCurrent block name

Device

VariableDescription
device_classDevice class
device_nameDevice name

File & Input

VariableDescription
current_fileName of current file
caller_lineLine number in caller
input_lineCurrent input line
user_inputUser input value

Special

VariableDescription
output_addressCurrent output position
mode_equationEquation mode (on/off)
mode_artworkArtwork mode (on/off)
mode_translateTranslation mode
delimiter_symbolSymbol delimiter character
delimiter_titleTitle delimiter character

Template Arguments

VariableDescription
current_argumentCurrent argument
argument_countNumber of arguments
argument_1, argument_2, ...Arguments by position

Additional Variables

VariableDescription
current_dateCurrent date
current_timeCurrent time
source_fileCurrent source file path
source_lineCurrent line in source
chapter_numberCurrent chapter number
section_numberCurrent section number
figure_numberCurrent figure number
table_numberCurrent table number
equation_numberCurrent equation number
footnote_numberCurrent footnote number
endnote_numberCurrent endnote number
current_languageCurrent language code