After the questionhttps://tex.stackexchange.com/questions/550268/typewriter-font-for-korean-language/550277#550277
has been solved I'm running in the next problem, I want to have the words like Chapter
from the \chapter
command automatically translated.
MWE:
\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}
But this gives the error:
! 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}
so uncommenting the line:
%\newfontfamily\hangulfont{Noto Sans CJK SC}
but this leads to:
! 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}
xeCJK
andpolyglossia
is not really recommended (or at least it wasn't in 2011, see the answers to tex.stackexchange.com/questions/36878/…) because they both try to do the same thing (allow writing in different scripts) and by doing so they interfere which eachother.xeCJK
is that it does not translate theChapter
text. So would you recommend to remove thexeCJK / \newfont... and \setCJK
? and replace with just\setmainfont
and\setmonofont
xeCJK
, define the chapter name manually (\renewcommand{\chaptername}
etc.) and don't usepolyglossia
, or don't usexeCJK
and usepolyglossia
instead. From these two optionspolyglossia
is a bit more feature-complete, besides the names for chapters, figures, tables etc. there are also hyphenation rules and other formatting conventions implemented thatxeCJK
doesn't have.