It failed to convert markdown to pdf file by pondoc on my CentOS8 server.
I installed all missing components about texlive.

yum install texlive*

But pandoc could’t find Chinese characters to generate complete PDF file.

/path/pandoc /path/yang.md --pdf-engine=xelatex -o /path/yang.pdf

So I downloaded Chinese font file and install it.
You can find source file on some font website such as https://chinesefonts.org/.
Put the font file under path /usr/share/fonts.
You can create a new folder local under it, then copy your font file to the folder.
Finally, Update font list information, and you can find your font information by fc-list.

$ cp SourceHanSansCNLight.otf  /usr/share/fonts/local
$ fc-cache /usr/share/fonts/local
$ fc-list |grep SourceHan

Use new command line to generate PDF file:

/path/pandoc /path/yang.md --pdf-engine=xelatex -o /path/yang.pdf -V mainfont='Source Han Sans CN'

It works!

Categories: ShellTool

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments

Content Summary
: Input your strings, the tool can get a brief summary of the content for you.

X
0
Would love your thoughts, please comment.x
()
x