$ls /usr/local/texlive/texmf-local/fonts/truetype/ -hl
total 61M
-rw-r--r-- 1 root root 11M Dec 16 19:55 simfang.ttf
lrwxrwxrwx 1 root root 11 Dec 16 19:57 SIMFANG.TTF -> simfang.ttf
-rw-r--r-- 1 root root 9.4M Dec 16 19:55 simhei.ttf
-rw-r--r-- 1 root root 12M Dec 16 19:55 simkai.ttf
lrwxrwxrwx 1 root root 10 Dec 16 19:57 SIMKAI.TTF -> simkai.ttf
-rw-r--r-- 1 root root 8.8M Dec 16 19:55 simli.ttf
-rw-r--r-- 1 root root 15M Dec 16 19:55 simsun.ttc
-rw-r--r-- 1 root root 6.4M Dec 16 19:55 simyou.ttf
\documentclass[UTF8, hyperref,fontset=windows]{ctexart}
修改文件头 /usr/lib64/R/library/rmarkdown/rmd/latex/default.tex
\documentclass[...,$endfor$,hyperref,UTF8, fontset=windows]{ctexart}
%\documentclass[...,$endfor$]{$documentclass$}
修改模版文件 article.tplx
%\documentclass{article}
\documentclass[UTF8,fontset=windows]{ctexart}
调用函数, 注意 用xelatex, pdflatex失败
import nbformat
from nbconvert.exporters import (HTMLExporter, PDFExporter)
from nbformat.v4 import new_markdown_cell
exporter = PDFExporter(latex_count=2, latex_command = [u"xelatex", u"{filename}"])
exporter.default_template_path = '/home/keke.zhaokk/.jupyter/nbconvert/templates/latex'
nb_json = nbformat.read("/home/yan.xi/public/test1.ipynb", as_version=4)
(body, resources) = exporter.from_notebook_node(nb_json)
系统文件路径
$#sudo vim /opt/anaconda3/lib/python3.4/site-packages/nbconvert/exporters/pdf.py
$# .../nbconvert/templates/latex/article.tplx
对于windows,或者texlive早期版本,只修改模版就好。
sudo fc-list
sudo texhash
sudo mktexlsr