duzyn / tufte-markdown

Use markdown to write your handouts or books in Tufte style.
https://duzyn.github.io/tufte-markdown/
MIT License
107 stars 13 forks source link

Any suggestion of Chinese font setting? #4

Closed renpj closed 4 years ago

renpj commented 4 years ago

Hi, do you have any suggestion about the font setting for chinese files? I found it is not very fancy when I writing a chinese document. Do I need to modify the template file to do this? Thanks for help! @duzyn

duzyn commented 4 years ago

I have added Chinese fonts support(for example Noto Sans CJK SC and Noto Serif CJK SC). In templates/tufte.html5 and tufte-markdown/build-sample.sh

templates/tufte.html5:

    body {
      font-family: "Noto Serif CJK SC", et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    }

    .sans { font-family: "Noto Sans CJK SC", "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
        letter-spacing: .03em; }

tufte-markdown/build-sample.sh:

# Build sample handout PDF
pp -pdf -import=./pp-macros/all.pp sample-handout.md | \
pandoc -o sample-handout.pdf -f markdown+raw_tex --pdf-engine=xelatex \
--template=./templates/tufte-handout.tex -V documentclass=tufte-handout \
--no-highlight -V CJKmainfont="Noto Serif CJK SC"