7

I want to have my text in Times New Roman, equations in Computer Modern, Chinese font in kaishu but as I want to bold the Chinese characters, it does not appear as expected. How do I solve this problem?

\documentclass[11pt, twoside=false]{scrbook}
\usepackage{CJKutf8}
\usepackage{times}
\usepackage{lastpage}
\usepackage{hhline}
\usepackage[math]{blindtext}
\usepackage{setspace}

\usetikzlibrary{math}

\begin{document}

\begin{CJK*}{UTF8}{gkai}
\setstretch{.6}

\begin{center}
    ***\textbf{说明}***
\end{center}

\end{CJK*}
\end{document}
1
  • I just had a similar problem mixing Japanese and Latin. Solution was compiling with XeLaTeX, and some adjustments wrt preamble. Just search for xelatex on this site. X. was made to handle Unicode with ease, as far as I understand.
    – MS-SPO
    May 14 at 14:51

3 Answers 3

9

I used newtxtext rather than times (obsolete). I'd also recommend against mixing Computer Modern math with Times text: just do

\usepackage{newtx}

The problem is that the Chinese font description file doesn't know b, but only bx. This is readily fixed by setting \bfdefault to bx.

\documentclass[11pt, twoside=false]{scrbook}
\usepackage{CJKutf8}
\usepackage{newtxtext}

\renewcommand{\bfdefault}{bx}

\begin{document}

\begin{center}
\begin{CJK*}{UTF8}{gkai}
\textbf{说明} 说明
\end{CJK*}
\end{center}

\end{document}

enter image description here

You might do the setting just inside CJK*:

\documentclass[11pt, twoside=false]{scrbook}
\usepackage{CJKutf8}
\usepackage{newtxtext}

\AddToHook{env/CJK*/begin}{\renewcommand{\bfdefault}{bx}}

\begin{document}

\begin{center}
\begin{CJK*}{UTF8}{gkai}
\textbf{说明} 说明
\end{CJK*}
\end{center}

\end{document}
7

If you only need individual Chinese characters in a document mostly in a Western language, and your publisher or prof isn’t forcing you to use 8-bit fonts in the twenty-first century, I recommend the Babel package in LuaLaTeX. This lets you use any font you can use in your word processor, type in either English or Chinese and have it just work:

\documentclass[11pt, twoside=false]{scrbook}
\tracinglostchars=3 % Make it an error when characters are missing!
\usepackage[english]{babel}
\usepackage{fontspec}

\babelprovide[import=zh-Hans, onchar=ids fonts]{chinese} % Or zh-Hant for Traditional.
\defaultfontfeatures{ Scale=MatchUppercase, Ligatures=TeX, Renderer=HarfBuzz }
\babelfont{rm}
          [Scale=1.0]{Times New Roman}
% From: https://www.google.com/get/noto/#serif-hans or https://www.ctan.org/pkg/notocjksc
\babelfont[chinese]{rm}
          {Noto Serif CJK SC}
% Set up \babelfont{sf} and \babelfont{tt} here, if needed.

\begin{document}
\begin{center}
    ***\textbf{Example 说明}***
\end{center}
\end{document}

Noto Serif CJK SC sample

You can use any font of your choice. One free Kai font, if I understood you correctly, is AR UKai, which comes in CN, TW and HK variants.

\documentclass[11pt, twoside=false]{scrbook}
\tracinglostchars=3 % Make it an error when characters are missing!
\usepackage[english]{babel}
\usepackage{fontspec}

\babelprovide[import=zh-Hant, onchar=ids fonts]{chinese} % Or zh-Hans for Simplified
\defaultfontfeatures{ Scale=MatchUppercase, Ligatures=TeX, Renderer=HarfBuzz }

\babelfont{rm}
          [Scale=1.0]{Times New Roman}
% From: https://github.com/SilentByte/fonts-arphic-ukai or https://packages.debian.org/stable/fonts/fonts-arphic-ukai
\babelfont[chinese]{rm}
          [BoldFont=*, BoldFeatures={FakeBold=1.2}, SlantedFont=*, SlantedFeatures={FakeSlant=0.15}]{ARPLUkaiTW}
% Set up \babelfont{sf} and \babelfont{tt} here, if needed.

\begin{document}
\begin{center}
    ***\textbf{Example 说明}***\\
    Example 说明
\end{center}
\end{document}

AR UKai TW sample

This is complicated by the fact that the font doesn’t come in bold (so I use FakeBold to fill in) and by working around a bug whose fix, as of May 2024, is waiting to be released on CTAN.

If you are writing a document primarily in Chinese, you might use the ctex or, I understand, luatexja packages.

4

Here is a way to do it. Kindly watch my comments in the code below. I refer to Adam Burke's solution. Please keep in mind:

  • to save your .tex file in UTF-8
  • compile it with XeLaTeX
  • use UTF-8 charaters, e.g. from the installed Windows Language Support (Chinese)

I can only show results for Japanese, as I haven't Chinese installed. However, as the package is made for Chinese, Japanese, Korean ... you should be able to continue.

result

% >>> Compile with XeLaTeX <<<<
% see https://tex.stackexchange.com/a/686808/245790 for similar solution

\documentclass{article}

\usepackage{xeCJK}
%\setCJKmainfont{Noto Sans CJK TC} % not available on my computer
\setCJKmainfont{Noto Sans JP Light} % alternative

\usepackage{times}


\begin{document}
 from OPs document: 说明 and \textbf{说明}, which obviously has some problems, e.g. from character codes \dots
 \vspace{1cm}
 
 using IMEPad/IME-Block from Windows Language support: using ``Categories/Unicode (BMP)'' together with your mouse:
 
 \begin{itemize}
  \item CJK Symbols and Punctuation: 【々〼〻〛and the same in bold: \textbf{【々〼〻〛}
  \item Hiragana: ひらがな and the same in bold: \textbf{ひらがな}
 \end{itemize}
 \bigskip
 
 I haven't installed Chinese language support, but this example from said link does work:
 \bigskip
 
 This tests the traditional Chinese character 錄.
 
 
\end{document}

imepad

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .