Skip to content

Commit

Permalink
Add CJK support for PDF in template.tex and metadata.yml (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangliu-tju authored Mar 31, 2022
1 parent 9614b9c commit 13e1565
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions defaults/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ geometry:
# A setting for the PDF. I don't know whether it is important.
lang: en-US

# Uncomment the following to enable a Chinese/Japanese/Korean (CJK) font.
# CJKmainfont: Noto Serif CJK SC

links-as-notes: true

tags: [pandoc, Books.jl, JuliaLang]
Expand Down
9 changes: 9 additions & 0 deletions defaults/template.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
$if(CJKmainfont)$
\PassOptionsToPackage{space}{xeCJK}
$endif$
%
\documentclass[
notoc % Suppress Tufte style table of contents.
]{tufte-book}
Expand Down Expand Up @@ -52,6 +56,11 @@
Ligatures=NoCommon
]

$if(CJKmainfont)$
\usepackage{xeCJK}
\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
$endif$

$if(graphics)$
\usepackage{graphicx}
\makeatletter
Expand Down

0 comments on commit 13e1565

Please sign in to comment.