← 返回命令列表

Linux command

xelatex 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Compile a LaTeX document to PDF

xelatex [document.tex]

Compile with shell escape enabled

xelatex -shell-escape [document.tex]

Compile to a specified output directory

xelatex -output-directory=[build/] [document.tex]

Run in non-stop mode, skipping errors

xelatex -interaction=nonstopmode [document.tex]

Compile with a custom job name

xelatex -jobname=[output] [document.tex]

Compile with SyncTeX for editor integration

xelatex -synctex=1 [document.tex]

Generate XDV output instead of PDF

xelatex -no-pdf [document.tex]

说明

xelatex compiles LaTeX documents using the XeTeX engine, producing PDF output. It provides native Unicode (UTF-8) support and can use any system-installed OpenType or TrueType fonts directly via the fontspec package. Unlike pdfLaTeX, xelatex handles non-Latin scripts and complex typography without special encoding packages. Documents can include characters from any writing system directly. Internally, xelatex first produces an XDV (XeTeX DeVice-independent) file, then converts it to PDF using xdvipdfmx. Multiple compilation passes may be needed for cross-references, bibliographies, and indices. Build systems like latexmk automate this process.

参数

-output-directory _DIR_
Write output files to the specified directory.
-jobname _NAME_
Set the output file base name.
-interaction _MODE_
Set interaction mode: batchmode, nonstopmode, scrollmode, errorstopmode.
-shell-escape
Enable \\write18 shell command execution.
-no-shell-escape
Disable shell command execution (default).
-synctex _N_
Generate SyncTeX data for editor synchronization.
-halt-on-error
Stop processing at the first error.
-file-line-error
Show file name and line number in error messages.
-no-pdf
Generate XDV (XeTeX DeVice-independent) output rather than PDF.
-output-driver _CMD_
Use CMD as the XDV-to-PDF driver instead of the default xdvipdfmx.
-8bit
Make all characters printable by default.
--help
Display help information.
--version
Display version information.

FAQ

What is the xelatex command used for?

xelatex compiles LaTeX documents using the XeTeX engine, producing PDF output. It provides native Unicode (UTF-8) support and can use any system-installed OpenType or TrueType fonts directly via the fontspec package. Unlike pdfLaTeX, xelatex handles non-Latin scripts and complex typography without special encoding packages. Documents can include characters from any writing system directly. Internally, xelatex first produces an XDV (XeTeX DeVice-independent) file, then converts it to PDF using xdvipdfmx. Multiple compilation passes may be needed for cross-references, bibliographies, and indices. Build systems like latexmk automate this process.

How do I run a basic xelatex example?

Run `xelatex [document.tex]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -output-directory _DIR_ do in xelatex?

Write output files to the specified directory.