Closed you-can-change closed 3 years ago
Hi @you-can-change.
I think you need to setup the Chinese environment and fonts(required only when generating PDF).
I'm sorry, I don't know how to do it, so the search keywords are:
Locale
```
# check installed locales
localectl list-locales | grep -i zh
# show now settings
localectl status
# set locale
localectl set-locale LANG=zh_CN.UTF-8
# or
export LANG="zh_CN.UTF-8"
```
Fonts
```
yum install google-noto-cjk-fonts
# or
yum groupinstall Fonts
# or ...
# check
fc-match serif:lang=zh
fc-match sans-serif:lang=zh
```
Thanks a lots,I follow your step, It work now :heart:.
# install the fonts
[root@centos7 test]# yum groupinstall Fonts
# check fonts
[root@centos7 test]# fc-match serif:lang=zh
DejaVuSerif.ttf: "DejaVu Serif" "Book"
[root@centos7 test]# fc-match sans-serif:lang=zh
DejaVuSans.ttf: "DejaVu Sans" "Book"
# set locale
[root@centos7 test]# localectl set-locale LANG=zh_CN.UTF-8
# show locale settings
[root@centos7 test]# localectl status
System Locale: LANG=zh_CN.UTF-8
VC Keymap: us
X11 Layout: us
# then build
[root@centos7 test]# mkdocs build
But not work well :sob:, The pdf doesn't have table of contents, and some content didn't show as expected.
It seems to be caused by not being able to handle Chinese normally, Shoud I close the issue?
[root@centos7 test]# fc-match serif:lang=zh DejaVuSerif.ttf: "DejaVu Serif" "Book" [root@centos7 test]# fc-match sans-serif:lang=zh DejaVuSans.ttf: "DejaVu Sans" "Book"
Deja Vu
is English font(not contains Chinese glyphs) - maybe error fallback.
Please try to install other Chinese font such as "Google Noto CJK".
(I can't read Chinese)
I'm sorry for wasting your time, it was my fault:sweat_smile::sweat_smile::sweat_smile:. When I translated the default index.md(Repro steps->3. Rewrite index.md with Chinese), I treated the sentences beginning with the # sign as comments and deleted them. So there is no table of contents.
I added the missing directory structure, now it's work very well.Thank you for your support again.:heart::heart::heart:
Question
Environment
Repro steps
1. Create a new project.
2. Using the plugin.
3. Rewrite index.md with Chinese
4. mkdocs build
5. Download and open the pdf