texthai.info
เท็กไทย
Thai language typesetting with XeLaTeX — simple guides, real workflows, working templates

Setting up TeX for Thai is straightforward once you know the pieces. This site collects what works, stripped of fluff. No registration, no tracking, no JavaScript. Pages load fast on metered connections.

Peer-maintained. If something is wrong or missing, the source is open.

All examples assume XeLaTeX. LuaLaTeX works too; differences are noted where they matter.

Getting started

install/
ติดตั้ง
XeLaTeX and LuaLaTeX on your system. Start here.
macOS Windows Linux FreeBSD
workflow/
ขั้นตอนการทำงาน
Editor setup, compile loop, output checking. What a clean Thai TeX session looks like.
VS Code vi CLI
A
fonts/
แบบอักษร
THSarabunNew, Norasi, Garuda and others. Where to get them, how to name them, how to verify they load.
THSarabunNew Norasi

Core packages

λ
polyglossia/
หลายภาษา
Setting Thai as main or secondary language. Language switching in mixed documents. Common traps.
ƒ
fontspec/
กำหนดแบบอักษร
Loading system fonts by name. Script and Language options for Thai. Bold and italic substitution.
linebreak/
ตัดบรรทัด
Thai has no spaces between words. How TeX handles breaking, and how to help it. Justification options.
libthai ICU

Resources

templates/
แม่แบบ
Ready-to-compile .tex files. Article, report, beamer presentation, bilingual letter. Copy and modify.
babel/
บาเบล
Babel vs polyglossia for Thai. When to use which. pdfLaTeX limitations with Thai script.
?
troubleshoot/
แก้ปัญหา
Missing font errors, broken line breaking, tofu squares, encoding issues. Indexed by error message.
isaan/
อีสาน
Lao script in a Thai document. Regional register considerations. Font coverage for northeastern Thai.
◆ ◇ ◆

Quick reference

taskpackageenginenote
\setmainfont{THSarabunNew}fontspecXeLaTeX / LuaLaTeXmost common starting point
\setmainlanguage{thai}polyglossiaXeLaTeXenables Thai hyphenation patterns
\usepackage[thai]{babel}babelpdfLaTeXlimited; prefer XeLaTeX for Thai
Script=ThaifontspecXeLaTeX / LuaLaTeXactivates OpenType Thai features
Language=ThaifontspecXeLaTeX / LuaLaTeXadds language-specific glyph variants
\XeTeXlinebreaklocale "th"XeLaTeXenables Thai word-boundary breaking
\XeTeXlinebreakskip = 0ptXeLaTeXpair with above; controls break glue