TransWikia.com

How can Latexmk compile file that contains Chinese Characters in path in Windows 10?

TeX - LaTeX Asked by Jeff Tian on July 30, 2021

I can use the following command in Windows without problem:

latexmk -lualatex -shell-escape "xxx.tex"

But if the filename contains Chinese character then it fails:

latexmk -lualatex -shell-escape "中文.tex"

I tried to change the default code page to 65001, it doesn’t help. The only difference is that it now displays all the Chinese characters as blocks instead of some strange characters.

How to make it work?

The output is like the following(Notice the strange characters ����):

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:texlive2019binwin32runscript.tlu:907: command failed with exit code 12:
perl.exe c:texlive2019texmf-distscriptslatexmklatexmk.pl -lualatex -shell-escape -enable-write18 -synctex=1 -interaction=nonstopmode -outdir=c:/Users/Jeff/thesis2.0 -f ����NodeJs�ĵ��̴���ϵͳ�����ʵ��

One Answer

Correct support for luatex for utf8 file names where added to texlive 2020 in may 2020. Before this it didn't work.

With a current texlive 2020 I can run file with chinese file names with lualatex without problems:

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).

But latexmk fails:

C:UsersXXXXDocumentstests>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).

Answered by Ulrike Fischer on July 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP