问题https://tex.stackexchange.com/questions/550268/typewriter-font-for-korean-language/550277#550277
解决后,我正在运行下一个问题,我想让命令Chapter
中的单词\chapter
自动翻译。
梅威瑟:
\documentclass{book}
\tracinglostchars=2
\usepackage{polyglossia}
\setdefaultlanguage{korean}
\usepackage{xeCJK}
\setCJKmainfont{Noto Sans CJK SC}
\setCJKmonofont{Noto Sans CJK SC}
%\newfontfamily\hangulfont{Noto Sans CJK SC}
\begin{document}
\chapter{ 다음에 의해 생성됨}
\obeylines
00027 printf({"{}JUST A PRINT STATEMENT\(\backslash\)n"{}});
00027 printf({"{}Just a print statement\(\backslash\)n"{}});
00028 printf({"large 다음에 의해 생성됨 Doxygen 1.8.19\(\backslash\)n"{}});
\begin{verbatim}
00027 printf({"{}A PRINT STATEMENT TEXT"{}}); 00027 printf({"{}a print statement text"{}}); 00028 printf({" 다음에 의해 생성됨 1.8.19"{}}); \end{verbatim}
\end{document}
但这会出现错误:
! Package polyglossia Error: The current latin font does not contain the "Hang
ul" script!
(polyglossia) Please define \hangulfont with \newfontfamily comm
and.
See the polyglossia package documentation for explanation.
Type H <return> for immediate help.
...
l.11 \begin{document}
因此取消注释该行:
%\newfontfamily\hangulfont{Noto Sans CJK SC}
但这会导致:
! Package polyglossia Error: The current latin font NotoSansCJKSC(1) does not c
ontain the "Hangul" script!
(polyglossia) Please define \hangulfont with \newfontfamily comm
and.
See the polyglossia package documentation for explanation.
Type H <return> for immediate help.
...
l.18 \begin{verbatim}
答案1
除了定义
\newfontfamily\hangulfont{Noto Sans CJK SC}
似乎还需要定义:
\newfontfamily\hangulfonttt{Noto Sans CJK SC}