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}
xeCJKandpolyglossiais not really recommended (or at least it wasn't in 2011, see the answers to https://tex.stackexchange.com/questions/36878/xecjk-messes-with-punctuation) because they both try to do the same thing (allow writing in different scripts) and by doing so they interfere which eachother. – Marijn Jun 20 '20 at 13:22xeCJKis that it does not translate theChaptertext. So would you recommend to remove thexeCJK / \newfont... and \setCJK? and replace with just\setmainfontand\setmonofont– albert Jun 20 '20 at 13:27xeCJK, define the chapter name manually (\renewcommand{\chaptername}etc.) and don't usepolyglossia, or don't usexeCJKand usepolyglossiainstead. From these two optionspolyglossiais a bit more feature-complete, besides the names for chapters, figures, tables etc. there are also hyphenation rules and other formatting conventions implemented thatxeCJKdoesn't have. – Marijn Jun 20 '20 at 13:38