4

The following minimal example does not show all the five characters in Chinese. How can I fix that?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{CJK}
\begin{document}
\begin{CJK*}{UTF8}{bsmi}你有问题吗?\end{CJK*}      
\end{document}

The output of file -i is text/x-tex; charset=utf-8 which looks reasonable to me. My file is compiled via pdftex:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./sample.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty)
(/usr/share/texmf/tex/latex/CJK/CJK.sty
(/usr/share/texmf/tex/latex/CJK/mule/MULEenc.sty)
(/usr/share/texmf/tex/latex/CJK/CJK.enc))
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)
(./sample.aux) (/usr/share/texmf/tex/latex/CJK/UTF8/UTF8.bdg)
(/usr/share/texmf/tex/latex/CJK/UTF8/UTF8.enc)
(/usr/share/texmf/tex/latex/CJK/UTF8/UTF8.chr)
(/usr/share/texmf/tex/latex/CJK/UTF8/c70bsmi.fd)
(/usr/share/texmf/tex/latex/CJK/UTF8/c70bsmi.fdx) [1{/var/lib/texmf/fonts/map/p
dftex/updmap/pdftex.map}] (./sample.aux) )
(see the transcript file for additional information)</usr/share/texmf/fonts/typ
e1/arphic/bsmiu/bsmiu4f.pfb></usr/share/texmf/fonts/type1/arphic/bsmiu/bsmiu67.
pfb></usr/share/texmf/fonts/type1/arphic/bsmiu/bsmiuff.pfb></usr/share/texlive/
texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on sample.pdf (1 page, 14847 bytes).
Transcript written on sample.log.

I am looking for any means to display Chinese text in Latex file.

3
  • 1
    Are you able and willing to employ XeLaTeX or LuaLaTeX?
    – Mico
    Jan 31, 2021 at 20:56
  • @Mico I am able and willing to use it. I didn't see any difference. However, by randomly trying I figured that changing from bsmi to gbsn apparently makes a difference. Do you hany suggestion what that could be?
    – shuhalo
    Jan 31, 2021 at 21:01
  • 1
    Why not shift from \usepackage{CJK} to \usepackage{ctex} and compile with xelatex?
    – C. Davide
    Feb 1, 2021 at 2:20

3 Answers 3

2

If you're free to use LuaLaTeX or XeLaTeX, you can use any OpenType that may be installed on your system. E.g., the Noto Serif/Sans CJK TC (tranditional Chinese) or SC (simplified Chinese) fonts, which provide an above average amount of glyphs and can be downloaded free of charge. No need anymoreto switch into and out of CJK or CJK* environments.

enter image description here

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Noto Serif CJK TC}
\setsansfont{Noto Sans CJK TC}

\begin{document}
Hello. 你有问题吗?

\sffamily
Hello. 你有问题吗?
\end{document}
6

Changing bsmi (which is for traditional Chinese characters) to something like gbsn or gkai (which is for simpified Chinese characters) should solve your problem.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{CJK}
\begin{document}
\begin{CJK*}{UTF8}{gbsn}你有问题吗?\end{CJK*}

\begin{CJK*}{UTF8}{gkai}你有问题吗?\end{CJK*}

\begin{CJK*}{UTF8}{bsmi}你有問題嗎?\end{CJK*}
    
\begin{CJK*}{UTF8}{bkai}你有問題嗎?\end{CJK*} 
\end{document}

enter image description here

2

My understanding is that most Chinese TeX documents now use ctex. The babel package suffices to include short Chinese phrases in a document, and is also capable of displaying traditional Chinese, simplified Chinese, and Japanese Kanji in the same document. This MWE works with LuaLaTeX and lets you use different English and Chinese fonts.

\documentclass{article}
\usepackage{fontspec}
\usepackage[UTF8,fontset=none]{ctex}

\defaultfontfeatures{ Scale=MatchUppercase, Ligatures=TeX }
\setCJKmainfont{Noto Serif CJK sc}[Renderer=HarfBuzz]
\setCJKsansfont{Noto Sans CJK sc}[Renderer=HarfBuzz]

\begin{document}
Serif: 你有问题吗?

\textsf{Sans Serif: 你有问题吗?}
\end{document}

Latin Modern/Noto CJK sc sample

You must log in to answer this question.

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