FormaTeX

\engines{formatex}

أربعة محركات. واجهة API واحدة.

pdfLaTeX و XeLaTeX و LuaLaTeX و latexmk — لكل محرك نقاط قوة مميزة. اختر الأداة المناسبة لكل مستند. بدّل بمعامل واحد.

\engine{pdflatex}

01

pdfLaTeX

The Workhorse

Fast, reliable, and universally compatible.

pdfLaTeX is the default engine for a reason: it has the widest package support in the TeX ecosystem, the fastest compilation times, and decades of battle-testing across millions of academic papers. If your document doesn't require custom system fonts or RTL text, pdfLaTeX is almost always the right choice.

Typical speed

80–200ms

Fastest

Passes

1 (2–3 with references)

Font support

Type1, OTF via pdffonts — no system fonts

\begin{example}

latex
\documentclass{article}
\usepackage{amsmath}
\usepackage{geometry}

\begin{document}

\section{Euler's Identity}
One of the most beautiful results in mathematics:
\[ e^{i\pi} + 1 = 0 \]

\section{Series Expansion}
\[
  \sum_{n=0}^{\infty} \frac{x^n}{n!} = e^x
\]

\end{document}

Use cases

  • Academic papers

    IEEE, ACM, Springer templates all target pdfLaTeX. Most conference submission systems expect it.

  • Math-heavy documents

    amsmath, amssymb, amsthm — full support. Complex equations, theorem environments, proofs.

  • Technical reports

    Standard CTAN packages, stable rendering, predictable output across TeX Live versions.

  • Presentations

    Beamer class works best with pdfLaTeX. Fastest rebuild cycle during development.

Popular packages

amsmath / amssymbTikZ + pgfplotsgeometryhyperrefbiblatexlistings / mintedalgorithm2ebeamer

Skip if...

  • You need a custom system font (OTF/TTF installed on your machine)
  • Your document contains Arabic, Hebrew, or other RTL scripts
  • You need native Unicode input without encoding workarounds

\usepackage{formatex-api}

json
{
  "latex": "\\documentclass{article}...",
  "engine": "pdflatex"
}

\engine{xelatex}

02

XeLaTeX

The Typographer

Native Unicode. System fonts. OpenType.

XeLaTeX was built from the ground up to embrace modern typography. It reads UTF-8 input directly, loads any font installed on the system via fontspec, and exposes the full feature set of OpenType: ligatures, small caps, stylistic alternates, and more. The go-to engine for multilingual documents and design-forward typesetting.

Typical speed

150–350ms

Fast

Passes

1 (2 with bibliography)

Font support

Any OpenType or TrueType system font via fontspec

\begin{example}

latex
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}

\setmainfont{Noto Serif}[
  Ligatures = TeX,
  Numbers   = OldStyle
]
\setmainlanguage{english}
\setotherlanguage{arabic}

\begin{document}

English paragraph with old-style numerals: 1234.

\begin{Arabic}
هذا نص باللغة العربية مع ترقيم صحيح.
\end{Arabic}

\end{document}

Use cases

  • Multilingual documents

    polyglossia handles 80+ languages. Mix Arabic and English in one document with proper RTL/LTR switching.

  • Brand typography

    Use any OTF/TTF font via fontspec. Corporate fonts, editorial typefaces, custom branding.

  • Linguistic papers

    IPA characters, Unicode phonetic symbols, custom scripts — all handled natively from source.

  • Design-forward PDFs

    Full OpenType feature access: ligatures, discretionary hyphens, stylistic sets, kerning pairs.

Popular packages

fontspecpolyglossiaunicode-mathbidi (RTL)xeCJKmicrotypehyperrefbiblatex

Skip if...

  • You only use standard TeX fonts — pdfLaTeX is faster
  • Maximum compilation speed is critical
  • You need Lua scripting (use LuaLaTeX instead)

\usepackage{formatex-api}

json
{
  "latex": "\\documentclass{article}...",
  "engine": "xelatex"
}

\engine{lualatex}

03

LuaLaTeX

The Programmer

Lua scripting inside your document.

LuaLaTeX embeds a full Lua 5.3 interpreter directly inside the typesetting engine. You can write Lua code that manipulates TeX internals, generates content programmatically, loops over data structures, and builds dynamic tables at compile time — all within a single .tex file. It also shares XeLaTeX's font capabilities via fontspec.

Typical speed

200–500ms

Moderate

Passes

1–3 typical

Font support

Same as XeLaTeX — full OpenType via fontspec

\begin{example}

latex
\documentclass{article}
\usepackage{luacode}
\usepackage{booktabs}

\begin{document}

\begin{luacode*}
  local items = {
    { "January",  "\$12,400" },
    { "February", "\$15,830" },
    { "March",    "\$9,220"  },
  }
  tex.print("\\begin{tabular}{lr}")
  tex.print("\\toprule Month & Revenue \\\\ \\midrule")
  for _, row in ipairs(items) do
    tex.print(row[1] .. " & " .. row[2] .. " \\\\")
  end
  tex.print("\\bottomrule \\end{tabular}")
\end{luacode*}

\end{document}

Use cases

  • Data-driven documents

    Loop over arrays, build tables from data, compute values — all in Lua at compile time. No external scripts.

  • Programmatic content

    Generate repetitive structures (e.g. 50-row tables, parametric figures) without copy-paste LaTeX.

  • Advanced typography

    Access low-level TeX internals via Lua. Custom kerning, glyph manipulation, hyphenation overrides.

  • Dynamic reports

    Embed business logic in the document itself. Conditionals, calculations, formatted output.

Popular packages

luacodefontspecluacolorluamplibluatexja (CJK)unicode-mathmicrotypepgfplots

Skip if...

  • You don't need Lua scripting — XeLaTeX gives the same font features with less overhead
  • You need the widest possible package compatibility (use pdfLaTeX)
  • Compilation speed is critical

\usepackage{formatex-api}

json
{
  "latex": "\\documentclass{article}...",
  "engine": "lualatex"
}

\engine{latexmk}

04

latexmk

The Orchestrator

Automatic multi-pass compilation. Every reference resolved.

latexmk is not a TeX engine — it's an intelligent build system that wraps pdfLaTeX and runs it as many times as necessary to fully resolve all forward references, citations, table of contents entries, and indices. When you specify latexmk, FormaTeX uses pdfLaTeX as the underlying driver and handles the pass logic automatically.

Typical speed

400ms–3s

Variable

Passes

Auto-detected (usually 2–4)

Font support

Same as pdfLaTeX (latexmk drives pdfLaTeX by default)

\begin{example}

latex
\documentclass{article}
\usepackage[backend=biber, style=ieee]{biblatex}
\usepackage{hyperref}
\addbibresource{references.bib}

\begin{document}

\section{Related Work}
Neural scaling laws were studied by \cite{kaplan2020scaling}.
The attention mechanism was introduced in \cite{vaswani2017attention}.

See \autoref{sec:method} for our approach.

\section{Method}\label{sec:method}
...

\printbibliography

\end{document}

Use cases

  • Academic papers with citations

    BibTeX and Biber bibliographies require at least two passes. latexmk handles this automatically.

  • Books and theses

    Table of contents, list of figures, indices, glossaries — all resolved across multiple passes.

  • Cross-referenced documents

    \ref, \pageref, \eqref, \autoref all need a second pass. latexmk detects and reruns as needed.

  • Documents with \label/\ref pairs

    Any document with internal references. latexmk checks the .aux file after each pass for completeness.

Popular packages

biblatex + bibernatbib + BibTeXmakeindexglossarieshyperref (with backrefs)cleverefacronymminitoc

Skip if...

  • Your document has no citations, bibliography, or cross-references — pdfLaTeX is 3–5× faster
  • You're doing exploratory drafts — use pdfLaTeX for fast iteration, switch to latexmk for final build
  • You need custom system fonts — latexmk drives pdfLaTeX by default

\usepackage{formatex-api}

json
{
  "latex": "\\documentclass{article}...",
  "engine": "latexmk"
}

\begin{tabular}

Quick comparison

All four engines available on every plan. No configuration required.

FeaturepdfLaTeXXeLaTeXLuaLaTeXlatexmk
Typical speed80–200ms150–350ms200–500ms400ms–3s
Compilation passes111Auto (2–4)
Unicode inputPartialYesYesInherited
System fonts (OTF/TTF)NoYesYesNo
Lua scriptingNoNoYesNo
Auto bibliographyNoNoNoYes
Package compatibilityhighesthighhighpdflatex

\DeclareMathOperator{choose}

Which engine?

Answer these questions in order. Stop when you have a match.

01

Does your document have citations or a bibliography?

Yes →Use latexmk
02

Do you need a custom system font or RTL/multilingual text?

Yes →Use XeLaTeX
03

Do you need Lua scripting or programmatic content?

Yes →Use LuaLaTeX
04

Standard document — math, tables, figures?

Yes →Use pdfLaTeX

\note

في التطبيق العملي

معظم أحمال الإنتاج تستخدم pdfLaTeX في 80% من المستندات. أضف XeLaTeX عند ظهور متطلبات الخطوط. احتفظ بـ latexmk للأوراق البحثية الكثيفة بالاستشهادات.

افتراضياً استخدم pdfLaTeX

إذا كنت تنشئ مستندات برمجية (فواتير، شهادات، تقارير) بدون خطوط مخصصة، يوفر pdfLaTeX أسرع وقت بدء تشغيل.

بدّل المحركات لكل طلب

معامل المحرك لكل ترجمة. يمكن لمفتاح API واحد تشغيل pdfLaTeX و XeLaTeX و latexmk لأنواع مستندات مختلفة في آنٍ واحد.

المستخدمون الأكاديميون: استخدموا latexmk

الأوراق البحثية ذات الاستشهادات تحتاج دائماً تقريباً إلى مرات تشغيل متعددة. latexmk يتولى هذا تلقائياً — لا حاجة لعدّ المرات يدوياً.

LuaLaTeX لمخرجات الذكاء الاصطناعي

إذا كان نموذج اللغة الكبير لديك يُنشئ LaTeX مع منطق Lua مضمّن، فإن LuaLaTeX يتعامل معه بنظافة. بيئة تشغيل Lua معزولة على جانبنا.

\begin{document}

أربعة محركات. مفتاح API واحد.

بدون تهيئة. بدون تثبيت TeX Live. بدّل المحركات بمعامل واحد.

ملاحظة سريعة

نتتبع الاستخدام المجهول — مشاهدات الصفحات واستخدام الميزات وأحداث الترجمة — لفهم ما يعمل وما لا يعمل. بدون إعلانات، بدون بيانات شخصية، بدون مشاركة مع أطراف ثالثة.