Windows macOS Linux / FreeBSD

All examples assume XeLaTeX as the engine. XeLaTeX reads UTF-8 source natively and loads system fonts directly — no encoding gymnastics, no font installation rituals beyond what your OS already has. LuaLaTeX also works; differences are noted where they matter.

piecewhat it iswhy
TeX Livethe TeX distributioncontains XeLaTeX, all standard packages
TeXstudioeditor / IDEThai-aware, integrated compile, good defaults
Gitversion controltrack changes, share templates, recover mistakes

Windows installation

1 TeX Live WIN

Download the Windows installer:

mirror.ctan.org/systems/texlive/tlnet/install-tl-windows.exe
Windows may flag this as unsafe. Right-click → Properties → Unblock, or confirm when prompted. It is safe.
Medium scheme includes all Thai-related packages. If you later need something missing, tlmgr install <package> from a terminal.

2 TeXstudio WIN

Download from the official release:

texstudio-4.9.2-win-qt6-signed.exe (github.com/texstudio-org)

Or check texstudio.org/#download for the current release.

The Qt6 signed build is the right one for current Windows. Avoid older Qt5 builds unless you have a specific reason.

3 Git WIN

Git-2.53.0.2-64-bit.exe (github.com/git-for-windows)

Or current release at git-scm.com/download/win

Verify Windows install

Open a new command prompt or Git Bash and run:

xelatex --version
git --version

Both should print version strings. If xelatex is not found, TeX Live may not be on your PATH — see troubleshoot/path.


macOS installation

1 TeX Live MAC

MacTeX is the standard distribution for macOS — it is TeX Live packaged for the Mac. Download from:

tug.org/texlive/quickinstall.html

Or direct: tug.org/mactex/ for the full MacTeX .pkg installer.

MacTeX installs to /usr/local/texlive/. No prefix change needed on Mac — the default location is fine.

2 TeXstudio MAC

texstudio.org/#download

3 Git MAC


Linux & FreeBSD installation

1 TeX Live LIN

Prefer the upstream installer over your distro's package manager — distro TeX Live packages are often years behind and missing Thai-specific components.

tug.org/texlive/quickinstall.html
wget https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
tar xf install-tl-unx.tar.gz
cd install-tl-*/
sudo perl install-tl --scheme=medium
FreeBSD: pkg install tex-xetex texlive-full works for most cases, or use the upstream installer for full control.

2 TeXstudio LIN

3 Git LIN

sudo apt install git        # Debian/Ubuntu
sudo dnf install git        # Fedora/RHEL
sudo pkg install git        # FreeBSD

After install — all platforms

A Install THSarabunNew

The standard Thai font for XeLaTeX work. Must be installed system-wide so XeLaTeX can find it by name. Platform-specific steps are in fonts/.

B Optionally: TeX Gyre Pagella for English

If your document mixes Thai and English body text, TeX Gyre Pagella pairs well with THSarabunNew — similar x-height and weight, Palatino-family, included in TeX Live Medium. No download needed; just reference it by name in fontspec. Pairing notes and examples are in fonts/pairing.

C Test with a minimal document

% test.tex
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{thai}
\setmainfont{TH Sarabun New}
\begin{document}
สวัสดี XeLaTeX
\end{document}

Compile with xelatex test.tex. If you see Thai text in the PDF, your install is working.

If you see tofu squares (□□□) instead of Thai characters, the font is not being found. See troubleshoot/tofu.