fontspec/cannot-use-pdftex: compile withXeLaTeXorLuaLaTeX, or replacefontspecand its commands forpdfLaTeX.Unicode character ... not set up for use with LaTeX: compile withXeLaTeXorLuaLaTeXand a font containing the glyph, or use a LaTeX command onpdfLaTeX.- LuaTeX-only errors (
luacode,luatexja-core): compile withLuaLaTeX(XeLaTeXcannot run LuaTeX packages or\directlua).
fontspec error: cannot-use-pdftex
main.log
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
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
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:
- LuaTeX-ja packages (
luatexja,luatexja-*) and the six classesltjsarticle,ltjsbook,ltjsreport,ltjarticle,ltjbook,ltjreportselect LuaLaTeX. - XeLaTeX indicators (
fontspec,polyglossia,ctex,xeCJK,\setmainfont, and related font commands) select XeLaTeX. luatextraor\directluaselects LuaLaTeX.- Otherwise, it runs PDFLaTeX.
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.
