
我可以在 Windows 中使用以下命令,沒有問題:
latexmk -lualatex -shell-escape "xxx.tex"
但如果檔名包含中文則失敗:
latexmk -lualatex -shell-escape "中文.tex"
我嘗試將預設代碼頁更改為 65001,但沒有幫助。唯一的區別是它現在將所有漢字顯示為塊而不是一些奇怪的字符。
如何讓它發揮作用?
輸出如下(注意奇怪的字元����):
Latexmk: This is Latexmk, John Collins, 17 March 2019, version: 4.63b.
Latexmk: In reading rule 'lualatex' in 'c:/Users/Jeff/thesis2.0/����NodeJs�ĵ��̴���ϵͳ�����ʵ��.fdb_latexmk',
destination has different name than configured...
Rule 'lualatex': File changes, etc:
Changed files, or newly in use since previous run(s):
'chapter4/sku-lock-design.tex'
...
----------------------
C:\texlive\2019\bin\win32\runscript.tlu:907: command failed with exit code 12:
perl.exe c:\texlive\2019\texmf-dist\scripts\latexmk\latexmk.pl -lualatex -shell-escape -enable-write18 -synctex=1 -interaction=nonstopmode -outdir=c:/Users/Jeff/thesis2.0 -f ����NodeJs�ĵ��̴���ϵͳ�����ʵ��
答案1
2020 年 5 月新增至 texlive 2020 中的 luatex 對 utf8 檔案名稱的正確支援。
使用目前的 texlive 2020,我可以使用 lualatex 運行具有中文文件名的文件,沒有問題:
This is LuaHBTeX, Version 1.12.0 (TeX Live 2020/W32TeX) (format=lualatex 2020.9.14) 19 SEP 2020 21:18
restricted system commands enabled.
**中文.tex
(./中文.tex
...
Output written on 中文.pdf (1 page, 2891 bytes).
但latexmk
失敗了:
C:\Users\XXXX\Documents\tests>latexmk -lualatex 中文.tex
Rc files read:
NONE
Latexmk: This is Latexmk, John Collins, 13 September 2020, version: 4.70a.
Latexmk: Filename '5%.tex' contains character not allowed for TeX file.
Latexmk: Stopping because of bad filename(s).