TeX - LaTeX Asked by wenxi li on March 31, 2021
I use overleaf to edit my CV, but I find a character "珅" in Chinese cannot be shown in the compiled PDF. I also try XeCJK, but it doesn’t work too.
Here is my code:
documentclass[a4paper]{article}
usepackage[UTF8]{ctex}
begin{document}
珅
end{document}
The default fontset (fandol
) loaded by ctex
and xeCJK
may not have glyphs for many archaic Chinese characters. If you're compiling this on Overleaf, you can use the fontset=ubuntu
option to load Noto Serif CJK SC:
usepackage[UTF8,fontset=ubuntu]{ctex}
Or if you prefer to load the font explicitly:
usepackage{ctex}
setCJKmainfont{Noto Serif CJK SC} % or some other font that has the glyph
Answered by imnothere on March 31, 2021
I’m going to expand on imnothere’s fine answer with a few best practices.
documentclass[a4paper]{article}
tracinglostchars=2
usepackage[UTF8, fontset=none]{ctex}
defaultfontfeatures{ Scale=MatchUppercase,
Ligatures=TeX,
Renderer=HarfBuzz }
%% Noto CJK fonts available at
%% https://www.google.com/get/noto/help/cjk/
setmainfont{Latin Modern Roman}[Scale=1.0]
setCJKmainfont{Noto Serif CJK SC}
setCJKsansfont{Noto Sans CJK SC}
setCJKmonofont{Noto Sans Mono CJK SC}
begin{document}
珅
end{document}
tracinglostchars=2
so that TeX will give you a warning when your font is missing a character. Without this command, the warning will be silently buried in the middle of your .log
file.Renderer=HarfBuzz
, or you will get an out-of-memory error. XeTeX uses HarfBuzz by default and works fine. XeLaTeX should give you a benign warning if it sees Renderer=
.Scale=
option if you are mixing different fonts.fontset=none
.Answered by Davislor on March 31, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP