> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/zh-tw/geng-duo-zhu-ti/44-tex-engine-command-line-options-for-pdftex-xetex-and-luatex.md).

# pdfTeX、XeTeX 與 LuaTeX 的 TeX 引擎命令列選項

## pdfTeX 版本 1.40.19

若要查看 pdfTeX 命令列選項的摘要，請執行以下命令

```
pdftex --help
```

以查看此清單：

```
用法：pdftex [OPTION]... [TEXNAME[.tex]] [COMMANDS]
   或：pdftex [OPTION]... \FIRST-LINE
   或：pdftex [OPTION]... &FMT ARGS
  在 TEXNAME 上執行 pdfTeX，通常會建立 TEXNAME.pdf。
  在讀取 TEXNAME 之後，任何剩餘的 COMMANDS 都會被當作 pdfTeX 輸入處理。
  如果 TEXNAME 的第一行是 %&FMT，且 FMT 是現有的 .fmt 檔案，
  就使用它。否則使用 `NAME.fmt'，其中 NAME 是程式呼叫名稱，
  最常見的是 `pdftex'。

  或者，如果第一個非選項引數以反斜線開頭，
  將所有非選項引數解釋為 pdfTeX 輸入的一行。

  或者，如果第一個非選項引數以 & 開頭，則
  下一個字詞會被視為要讀入的 FMT，並覆蓋其他所有設定。任何
  其餘引數會如上所述處理。

  如果未指定任何引數或選項，則提示輸入。

-draftmode              開啟草稿模式（不產生輸出 PDF）
-enc                    啟用 encTeX 擴充功能，例如 \mubyte
-etex                   啟用 e-TeX 擴充功能
[-no]-file-line-error   停用/啟用 file:line:error 風格訊息
-fmt=FMTNAME            使用 FMTNAME，而非程式名稱或 %& 行
-halt-on-error          在第一個錯誤時停止處理
-ini                    作為 pdfinitex，用於轉存格式；這會隱含
                          當程式名稱是 `pdfinitex' 時為 true
-interaction=STRING     設定互動模式（STRING=batchmode/nonstopmode/
                          scrollmode/errorstopmode）
-ipc                    將 DVI 輸出傳送到 socket，以及一般的
                          輸出檔案
-ipc-start              如同 -ipc，並且也在另一端啟動伺服器
-jobname=STRING         將工作名稱設定為 STRING
-kpathsea-debug=NUMBER  根據 NUMBER 的位元設定路徑搜尋除錯旗標
                          的位元
[-no]-mktex=FMT         停用/啟用 mktexFMT 生成（FMT=tex/tfm/pk）
-mltex                  啟用 MLTeX 擴充功能，例如 \charsubdef
-output-comment=STRING  使用 STRING 作為 DVI 檔案註解，而不是日期
                          （對 PDF 無效）
-output-directory=DIR   使用現有的 DIR 作為寫入檔案的目錄
-output-format=FORMAT   使用 FORMAT 作為工作輸出；FORMAT 為 `dvi' 或 `pdf'
[-no]-parse-first-line  停用/啟用解析輸入檔第一行
-progname=STRING        將程式（以及 fmt）名稱設定為 STRING
-recorder               啟用檔名記錄器
[-no]-shell-escape      停用/啟用 \write18{SHELL COMMAND}
-shell-restricted       啟用受限制的 \write18
-src-specials           將 source specials 插入 DVI 檔案
-src-specials=WHERE     在 DVI 檔案的某些位置插入 source specials。
                          WHERE 是以逗號分隔的值
                          清單：cr display hbox math par parend vbox
-synctex=NUMBER         根據 NUMBER 的位元為預覽器產生 SyncTeX 資料
                          （詳情請參閱 `man synctex'）
-translate-file=TCXNAME 使用 TCX 檔案 TCXNAME
-8bit                   預設使所有字元皆可列印
-help                   顯示此說明並結束
-version                輸出版本資訊並結束

pdfTeX 首頁：<http://pdftex.org>

將錯誤報告寄到 pdftex@tug.org。
```

## LuaTeX 版本 1.08.0

若要查看 LuaTeX 命令列選項的摘要，請執行以下命令

```
luatex --help
```

以查看此清單：

```
用法：luatex --lua=FILE [OPTION]... [TEXNAME[.tex]] [COMMANDS]
   或：luatex --lua=FILE [OPTION]... \FIRST-LINE
   或：luatex --lua=FILE [OPTION]... &FMT ARGS
  在 TEXNAME 上執行 LuaTeX，通常會建立 TEXNAME.pdf。
  其餘任何 COMMANDS 會在讀入 TEXNAME 之後，作為 luatex 輸入來處理。

  或者，如果第一個非選項引數以反斜線開頭，
  luatex 會將所有非選項引數解讀為一行輸入。

  或者，如果第一個非選項引數以 & 開頭，則
  下一個字詞會被視為要讀入的 FMT，並覆蓋其他所有設定。任何
  其餘引數會如上所述處理。

  如果未指定任何引數或選項，則提示輸入。

  以下是可用的一般選項：

   --credits                     顯示致謝並結束
   --debug-format                啟用格式除錯
   --draftmode                   開啟草稿模式（不產生輸出 PDF）
   --[no-]file-line-error        停用/啟用 file:line:error 風格的訊息
   --[no-]file-line-error-style  --[no-]file-line-error 的別名
   --fmt=FORMAT                  載入格式檔 FORMAT
   --halt-on-error               在第一個錯誤處停止處理
   --help                        顯示說明並結束
   --ini                         成為 iniluatex，用於傾印格式
   --interaction=STRING          設定互動模式（STRING=batchmode/nonstopmode/scrollmode/errorstopmode）
   --jobname=STRING              將工作名稱設為 STRING
   --kpathsea-debug=NUMBER       根據 NUMBER 的位元設定路徑搜尋除錯旗標
   --lua=FILE                    載入並執行 Lua 初始化腳本
   --[no-]mktex=FMT              停用/啟用 mktexFMT 生成（FMT=tex/tfm）
   --nosocket                    停用 Lua socket 函式庫
   --output-comment=STRING       DVI 檔案註解使用 STRING 取代日期（對 PDF 無效）
   --output-directory=DIR        使用現有的 DIR 作為寫入檔案的目錄
   --output-format=FORMAT        將作業輸出使用 FORMAT；FORMAT 為 'dvi' 或 'pdf'
   --progname=STRING             將程式名稱設為 STRING
   --recorder                    啟用檔名記錄器
   --safer                       停用容易被利用的 Lua 指令
   --[no-]shell-escape           停用/啟用系統指令
   --shell-restricted            將系統指令限制為 texmf.cnf 中指定的指令清單
   --synctex=NUMBER              啟用 synctex（請參閱 man synctex）
   --utc                         將初始時間設為 UTC
   --version                     顯示版本並結束

可透過特殊切換參數取得替代行為模式

  --luaonly                      執行一個 Lua 檔案，然後結束
  --luaconly                     將 Lua 檔案做位元組編譯，然後結束
  --luahashchars                 目前 Lua 解譯器用於字串雜湊的位元

更多關於啟動程序的資訊，請參閱參考手冊。

錯誤回報請寄到 dev-luatex@ntg.nl。
```

## XeTeX 版本 0.99999

若要查看 XeTeX 命令列選項的摘要，請執行以下命令

```
xetex --help
```

以查看此清單：

```
用法：xetex [OPTION]... [TEXNAME[.tex]] [COMMANDS]
   或：xetex [OPTION]... \FIRST-LINE
   或：xetex [OPTION]... &FMT ARGS
  在 TEXNAME 上執行 XeTeX，通常會建立 TEXNAME.pdf。
  在讀取 TEXNAME 之後，任何剩餘的 COMMANDS 都會被當作 XeTeX 輸入處理。
  如果 TEXNAME 的第一行是 %&FMT，且 FMT 是現有的 .fmt 檔案，
  就使用它。否則使用 `NAME.fmt'，其中 NAME 是程式呼叫名稱，
  最常見的是 `xetex'。

  或者，如果第一個非選項引數以反斜線開頭，
  將所有非選項引數解釋為 XeTeX 輸入的一行。

  或者，如果第一個非選項引數以 & 開頭，則
  下一個字詞會被視為要讀入的 FMT，並覆蓋其他所有設定。任何
  其餘引數會如上所述處理。

  如果未指定任何引數或選項，則提示輸入。

-etex                   啟用 e-TeX 擴充功能
[-no]-file-line-error   停用/啟用 file:line:error 風格訊息
-fmt=FMTNAME            使用 FMTNAME，而非程式名稱或 %& 行
-halt-on-error          在第一個錯誤時停止處理
-ini                    作為 xeinitex，用於轉存格式；這會隱含
                          當程式名稱是 `xeinitex' 時為 true
-interaction=STRING     設定互動模式（STRING=batchmode/nonstopmode/
                          scrollmode/errorstopmode）
-jobname=STRING         將工作名稱設定為 STRING
-kpathsea-debug=NUMBER  根據 NUMBER 的位元設定路徑搜尋除錯旗標
                          的位元
[-no]-mktex=FMT         停用/啟用 mktexFMT 生成（FMT=tex/tfm）
-mltex                  啟用 MLTeX 擴充功能，例如 \charsubdef
-output-comment=STRING  使用 STRING 作為 XDV 檔案註解，而不是日期
-output-directory=DIR   使用現有的 DIR 作為寫入檔案的目錄
-output-driver=CMD      使用 CMD 作為 XDV 到 PDF 的驅動程式，而不是 xdvipdfmx
-no-pdf                 產生 XDV（延伸 DVI）輸出，而非 PDF
[-no]-parse-first-line  停用/啟用解析輸入檔第一行
-papersize=STRING       將 PDF 媒體尺寸設定為 STRING
-progname=STRING        將程式（以及 fmt）名稱設定為 STRING
-recorder               啟用檔名記錄器
[-no]-shell-escape      停用/啟用 \write18{SHELL COMMAND}
-shell-restricted       啟用受限制的 \write18
-src-specials           將 source specials 插入 XDV 檔案
-src-specials=WHERE     在 DVI 檔案的某些位置插入 source specials。
                          XDV 檔案。WHERE 是以逗號分隔的值
                          清單：cr display hbox math par parend vbox
-synctex=NUMBER         根據 NUMBER 的位元為預覽器產生 SyncTeX 資料
                          （詳情請參閱 `man synctex'）
-translate-file=TCXNAME （忽略）
-8bit                   預設使所有字元皆可列印，不使用 ^^X 序列
-help                   顯示此說明並結束
-version                輸出版本資訊並結束

將錯誤報告寄到 xetex@tug.org。
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/zh-tw/geng-duo-zhu-ti/44-tex-engine-command-line-options-for-pdftex-xetex-and-luatex.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
