![韩语中的多语现象和逐字逐句问题](https://linux22.com/image/416331/%E9%9F%A9%E8%AF%AD%E4%B8%AD%E7%9A%84%E5%A4%9A%E8%AF%AD%E7%8E%B0%E8%B1%A1%E5%92%8C%E9%80%90%E5%AD%97%E9%80%90%E5%8F%A5%E9%97%AE%E9%A2%98.png)
问题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}