Skip to main content
Compiler and engine errors happen when your document uses a package, primitive, or character that your current TeX engine does not support. Match your error to the engine it needs:

fontspec error: cannot-use-pdftex

main.log
Cause: fontspec loads OpenType and TrueType system fonts, which pdfLaTeX cannot read. Loading polyglossia under pdfLaTeX stops with the same error because polyglossia loads fontspec internally. Fix: Compile with XeLaTeX (xelatex main.tex) or LuaLaTeX (lualatex main.tex). Nothing in the .tex file needs to change. If a journal requires pdfLaTeX, remove \usepackage{fontspec} and all fontspec commands such as \setmainfont{...}, and if the document loads polyglossia, replace it and its language commands with babel as well, because polyglossia loads fontspec. Then load a pdfLaTeX font setup such as \usepackage[T1]{fontenc} with \usepackage{lmodern} or \usepackage{newtxtext}.

Failing example under pdfLaTeX

fontspec-pdftex.tex

Fixed version with XeLaTeX

fontspec-xelatex.tex
Test this example live in your browser. Open a ready-to-compile LaTeX project with TeX Live 2026 preinstalled and zero local setup.Open starter article

Unicode character not set up for use with LaTeX

main.log
Cause: pdfLaTeX maps only a subset of UTF-8 characters (mostly Latin scripts and common punctuation). For characters outside that table — such as Greek letters, math symbols like ≤, non-Latin scripts, or emoji — pdfLaTeX reports the error and the character is missing from the output; whether a PDF is still written depends on the mode. Fix: Switch to XeLaTeX or LuaLaTeX and load a font with fontspec that actually contains the glyph (if the chosen font lacks the glyph, compilation can finish with a Missing character warning and drop the symbol). For ≤, \usepackage{fontspec} with \setmainfont{DejaVu Serif} renders the glyph cleanly under both XeLaTeX and LuaLaTeX; emoji require an engine-compatible emoji font rather than a text font. If you must stay on pdfLaTeX, replace ≤ with $\leq$ (or load the appropriate language package for non-Latin text). For Chinese ctex documents that fail under pdfLaTeX with Font unisong30 at 632 not found, see Fix “Font unisong not found” in Chinese LaTeX (ctex).

LuaTeX-only package errors

main.log
main.log
Cause: The document loads a LuaTeX-only package (luacode, luatexja, luatextra), uses one of the Japanese LuaTeX-ja classes (ltjsarticle, ltjsbook, ltjsreport, ltjarticle, ltjbook, ltjreport), or calls the \directlua engine primitive while compiling with pdfLaTeX or XeLaTeX. Fix: Compile with LuaLaTeX (lualatex main.tex or latexmk -lualatex main.tex). Switching to XeLaTeX does not resolve LuaTeX-only errors.

Which engine to choose

In LaTeX Cloud Studio

Each project’s LaTeX Engine setting under Settings -> General defaults to Auto (Recommended). Under Auto, LaTeX Cloud Studio checks indicator groups across your main file and project .tex, .sty, and .cls sources in a fixed order, and the first group that matches wins:
  1. LuaTeX-ja packages (luatexja, luatexja-*) and the six classes ltjsarticle, ltjsbook, ltjsreport, ltjarticle, ltjbook, ltjreport select LuaLaTeX.
  2. XeLaTeX indicators (fontspec, polyglossia, ctex, xeCJK, \setmainfont, and related font commands) select XeLaTeX.
  3. luatextra or \directlua selects LuaLaTeX.
  4. Otherwise, it runs PDFLaTeX.
On compilation paths with a shared timeout, Auto can retry after a failed XeLaTeX or LuaLaTeX run, or after pdfLaTeX reports an engine requirement or unsupported Unicode, when at least 20 seconds remain. When unsupported Unicode is the reason for a fallback, LaTeX Cloud Studio accepts a successful fallback result only if its missing-character warnings name no characters beyond those pdfLaTeX already rejected. If you choose PDFLaTeX, XeLaTeX, or LuaLaTeX explicitly, LaTeX Cloud Studio keeps that choice. Standard compiles do not support packages that require external programs such as Inkscape (svg) or latexminted (minted), regardless of engine. Ready to test your document with XeLaTeX or LuaLaTeX in the browser? Start from the Basic Article template in LaTeX Cloud Studio and switch LaTeX Engine under Settings.