Repository navigation
LaTeX Support en
中文 · English
Lineae is not a full LaTeX interpreter. It recognises a clearly defined syntax subset, turns recognised parts into editable nodes, and keeps everything else verbatim as source blocks.
.tex source
|
v
Keep preamble, document boundary, opaque source blocks
|
v
Recognise supported block and inline syntax
|
v
ProseMirror document tree (editable)
Export runs the pipeline in reverse: supported nodes are re-serialised to LaTeX, opaque blocks are written back verbatim.
This page describes the web JS typesetting pipeline subset. The desktop native LuaLaTeX workspace is typeset and rendered by the real TeX engine, so construct coverage follows the engine; unsupported parts are likewise kept as source.
Document structure
- Preamble content such as
\documentclassand\usepackageis kept verbatim -
\title,\author,\maketitle -
\section,\subsection,\subsubsection, including starred forms, short titles, and trailing labels; nochapter/part -
\label,\ref,\eqref,\autoref,\pageref,\cite, table of contents (static keys; compiled page numbers are not provided) -
\footnote(simple, single-line argument without nested braces only) - Paragraphs, line breaks, comments (comments inside an edited supported block may not survive)
Text formatting
-
\textbf,\textit(fully supported);\emph,\textsl,\texttt,\textsc,\fbox,\underline,\sout,uline/uuline/uwave(partially mapped) - A subset of font, size (
zihao/setlengthkept via source mapping), and colour commands -
\textsuperscript,\textsubscript
Lists and blocks
-
itemize,enumerate,description(basic nesting; arbitraryenumitemconfigurations are not supported) - Block quotes and code blocks (
lstlistingonly without options or with a singlelanguageoption;verbatim/minted/\verbcontent is protected but kept as source) -
abstract,center,quote \hrule
Tables
- Basic
tabularstructure, selected column specifiers,\multicolumn/\multirow -
booktabs\toprule,\midrule,\bottomrule -
tblr(tabularray),tabularx,longtable, and table floats: the original source is kept and cell edits patch source ranges only (PR #26 model) - Adapter limits:
tblr\SetCellsupports column spans only (row spans stay Raw);tabularx\multicolumnparses, while multirow and other unadapted cases stay Raw
Math
- Inline
$...$,\(...\)(common single-line forms; complex or multi-line input may stay Raw) - Display
\[...\],$$...$$,equation(incl. starred) and selected alignment environments:align,alignat,flalign,gather,multline,eqnarray;cases,aligned,matrix,arrayand other inner environments are stored as whole math strings -
\tag,\notag,\nonumberand labels are partially restored (no TeX counter semantics) - Common commands, matrices, scripts, fractions, roots, integrals, and big operators are presented by MathLive; whether a given command renders/edits is a MathLive-layer capability
Figures
-
\includegraphicsinsidefigure -
\caption,\label, and a subset of alignment and placement options - Width accepts only numeric multiples of
linewidth/textwidthorcm/mm/pt;height, cropping, or rotation options are not accepted - On import, multi-image and
subfigure/minipagelayouts are not flattened (kept Raw); the editor panel can crop, resize, or combine supported single images into subfigures (see Features)
Theorem-like
-
theorem,lemma,proposition,corollary,definition,remark,proof
Constructs outside the subset (custom environments, complex package commands, exotic tables, etc.) become opaque source blocks where possible:
- Shown as source in the visual mode, never mistaken for plain text.
- Fully editable in Source view.
- Written back verbatim on export.
This is the "make limitations explicit" principle in practice: showing source is preferred over lossy guessing.
| Scenario | Behaviour |
|---|---|
| Open, make no changes, export | Original source is preserved |
| Edit a supported block | That block is re-serialised; whitespace, comments, and command spelling may change |
| Edit only prose paragraphs | Preamble and opaque blocks are unaffected |
| Replace everything in Source view | The editable projection is rebuilt; rich-text history resets |
There is no universally lossless round trip. If you depend on exact source spelling (e.g. a camera-ready journal submission), verify with version control or an external diff after editing.
Even when the syntax is recognised correctly, the web editing view is not the compiled result:
- Line breaking and page breaking are approximations, calibrated against real XeLaTeX output but not guaranteed to match.
- Font metrics and kerning approximate the selected engine profile (XeLaTeX / LuaLaTeX / pdfLaTeX).
- Math sizing, script placement, and spacing are approximations.
- Expansion results of complex packages cannot be reproduced in the browser.
The desktop native LuaLaTeX workspace, rendered by real TeX, is the reference for typesetting fidelity; these gaps remain core TODOs for the web. See "Fidelity boundary" in Architecture.
If a construct is misrecognised, treated as plain text, or changes meaning after export, attach a minimal reproducible .tex file:
https://github.com/AminiamEva/Lineae/issues
A minimal example is far more useful than a whole paper, and easier to turn into a regression test.