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.
| task | package | engine | note |
|---|---|---|---|
| \setmainfont{THSarabunNew} | fontspec | XeLaTeX / LuaLaTeX | most common starting point |
| \setmainlanguage{thai} | polyglossia | XeLaTeX | enables Thai hyphenation patterns |
| \usepackage[thai]{babel} | babel | pdfLaTeX | limited; prefer XeLaTeX for Thai |
| Script=Thai | fontspec | XeLaTeX / LuaLaTeX | activates OpenType Thai features |
| Language=Thai | fontspec | XeLaTeX / LuaLaTeX | adds language-specific glyph variants |
| \XeTeXlinebreaklocale "th" | — | XeLaTeX | enables Thai word-boundary breaking |
| \XeTeXlinebreakskip = 0pt | — | XeLaTeX | pair with above; controls break glue |