Windows의 \include 명령에서 cjk 경로를 어떻게 사용할 수 있습니까?

Windows의 \include 명령에서 cjk 경로를 어떻게 사용할 수 있습니까?

cjk 문자로 이름이 지정된 파일을 포함하려면 \input 또는 \include 명령을 사용하고 싶습니다.

\documentclass[UTF8]{ctexart}
\title{input with cjk path}
\begin{document}
\maketitle
\input{中文}
\end{document}

그리고 中文.tex는

hello, world

utf8 인코딩, gbk 인코딩을 시도했지만 xelatex에서 동일한 오류가 표시됩니다

LaTeX Error: File `涓枃.tex' not found.

운영 체제는 Windows이고 xelatex 명령을 사용합니다.

xelatex a.tex

코드 페이지를 변경해 보았지만 여전히 작동하지 않습니다.

chcp 65001
xelatex a.tex

그리고 a.log 쇼

This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/W32TeX)(preloaded format=xelatex 2017.6.21)  3 JUL 2017 20:55
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**./a.tex
(./a.tex
LaTeX2e <2017-04-15>
...
...
...
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <8> on input line 4.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <6> on input line 4.


LaTeX Warning: No \author given.


! LaTeX Error: File `中文.tex' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: tex)

Enter file name: X

)
(\end occurred when \ifx on line 5 was incomplete)
(\end occurred when \ifx on line 5 was incomplete) 
Here is how much of TeX's memory you used:
 19344 strings out of 493005
 406504 string characters out of 6131656
 441240 words of memory out of 5000000
 23197 multiletter control sequences out of 15000+600000
 6602 words of font info for 39 fonts, out of 8000000 for 9000
 1348 hyphenation exceptions out of 8191
 57i,6n,68p,10436b,270s stack positions out of 5000i,500n,10000p,200000b,80000s

No pages of output.

답변1

hello world 파일을 생성 中文.tex하고 기본 파일을 UTF-8로 저장하면 Windows 10(및 texlive 2017 cygwin tex)에서 작동합니다.

여기에 이미지 설명을 입력하세요

그런 다음 기본 파일을 gbk 인코딩으로 다시 저장하면 파일을 찾을 수 없다는 오류가 발생합니다. 제 경우에는 다음과 같습니다.

! LaTeX Error: File `����.tex' not found.

예제에서와 같이 잘못된 문자를 표시하는 대신 모든 문자가 U+fffd "대체 문자"로 대체되지만 utf-8 디코딩의 세부 사항은 사용 중인 xetex 버전에 따라 달라질 수 있습니다.

관련 정보