tctcab 我原本也是想不要拷贝 Windows 下的字体,可是发现 Linux 下的替代字体竟然差别还比较明显(仔细看的话),当然了这发生在我的 bookdown 论文模板里 ,这个环境对字体格式要求比较高,不敢擅自做主替换字体。https://github.com/XiangyunHuang/Thesis-Template-Bookdown/tree/master/fonts
dapengde 别人的 LaTeX 模板维护起来很麻烦,我是不会 LaTeX 编程的,这个字体设置文件看起来懂了,其实似懂非懂, ctex-fontset-pkuthss.def ,早些时候我基于 bookdown 的论文模板,其 LaTeX 模板是学院代代相传的 CCT 中文处理系统, CTeX 除了从师兄师姐那拷贝,别无它法,你可以想象模板得有多老,现在他们还是十年如一届地继续用老模板,我是第一个推倒重来制作 LaTeX 模板,但是包裹了 bookdown,我不会 LaTeX 编程,所以 Thesis-Template-Bookdown 项目的 LaTeX 文件组织起来没有 LaTeX 项目那样标准。此外,我的经历告诉我,对于像论文、书籍模板这种复杂的应用,不建议同时维护那么多格式,我觉得 gitbook 和 pdf 两种格式够用,但是内容应该足够丰富以应对各式各样的图、表排版要求,往往这个才是阻碍推广的地方,因为比较难学,通常的 demo 不会覆盖到这里,初学者拿到模板是希望填公式和图表,而不是去学如何填公式和图表,不然他们又该回去用 Word 或者 LaTeX 了。
扯了这么多,回到问题,我试了 北京大学学位论文 除了几个警告没什么问题。
首先更新 tlmgr 和安装 pkuthss 宏包
tlmgr update --self
tlmgr install pkuthss
附环境信息
xfun::session_info(packages = c("bookdown","rmarkdown"))
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200), RStudio 1.1.456
Locale:
LC_COLLATE=Chinese (Simplified)_China.936
LC_CTYPE=Chinese (Simplified)_China.936
LC_MONETARY=Chinese (Simplified)_China.936
LC_NUMERIC=C
LC_TIME=Chinese (Simplified)_China.936
Package version:
base64enc_0.1.3 bookdown_0.7.18 digest_0.6.16 evaluate_0.11
glue_1.3.0 graphics_3.5.1 grDevices_3.5.1 highr_0.7
htmldeps_0.1.1 htmltools_0.3.6 jsonlite_1.5 knitr_1.20
magrittr_1.5 markdown_0.8 methods_3.5.1 mime_0.5
Rcpp_0.12.18 rmarkdown_1.10.12 stats_3.5.1 stringi_1.2.4
stringr_1.3.1 tinytex_0.8 tools_3.5.1 utils_3.5.1
xfun_0.3.8 yaml_2.2.0
Pandoc version: 2.2.3.2
附警告信息
==> rmarkdown::render_site(encoding = 'UTF-8')
|....... | 11%
inline R code fragments
|.............. | 22%
label: set-options (with options)
List of 2
$ echo : logi FALSE
$ cache: logi FALSE
|...................... | 33%
inline R code fragments
|............................. | 44%
label: co2 (with options)
List of 4
$ echo : logi FALSE
$ out.width: chr "80%"
$ fig.cap : chr "�� R ���Ի���ͼ����"
$ fig.align: chr "center"
|.................................... | 56%
ordinary text without R code
|........................................... | 67%
label: tabair
|................................................... | 78%
ordinary text without R code
|.......................................................... | 89%
label: unnamed-chunk-1 (with options)
List of 1
$ eval: logi FALSE
|.................................................................| 100%
ordinary text without R code
processing file: pku.Rmd
output file: pku.knit.md
"D:/Program Files (x86)/Pandoc/pandoc" +RTS -K512m -RTS pku.utf8.md --to docx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output pku.docx --highlight-style tango --filter pandoc-citeproc
|....... | 11%
inline R code fragments
|.............. | 22%
label: set-options (with options)
List of 2
$ echo : logi FALSE
$ cache: logi FALSE
|...................... | 33%
inline R code fragments
|............................. | 44%
label: co2 (with options)
List of 4
$ echo : logi FALSE
$ out.width: chr "80%"
$ fig.cap : chr "�� R ���Ի���ͼ����"
$ fig.align: chr "center"
|.................................... | 56%
ordinary text without R code
|........................................... | 67%
label: tabair
|................................................... | 78%
ordinary text without R code
|.......................................................... | 89%
label: unnamed-chunk-1 (with options)
List of 1
$ eval: logi FALSE
|.................................................................| 100%
ordinary text without R code
Output created: _book/pku.docx
processing file: pku.Rmd
output file: pku.knit.md
"D:/Program Files (x86)/Pandoc/pandoc" +RTS -K512m -RTS pku.utf8.md --to epub3 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output pku.epub --number-sections --filter pandoc-citeproc
|....... | 11%
inline R code fragments
|.............. | 22%
label: set-options (with options)
List of 2
$ echo : logi FALSE
$ cache: logi FALSE
|...................... | 33%
inline R code fragments
|............................. | 44%
label: co2 (with options)
List of 4
$ echo : logi FALSE
$ out.width: chr "80%"
$ fig.cap : chr "�� R ���Ի���ͼ����"
$ fig.align: chr "center"
|.................................... | 56%
ordinary text without R code
|........................................... | 67%
label: tabair
|................................................... | 78%
ordinary text without R code
|.......................................................... | 89%
label: unnamed-chunk-1 (with options)
List of 1
$ eval: logi FALSE
|.................................................................| 100%
ordinary text without R code
Output created: _book/pku.epub
processing file: pku.Rmd
output file: pku.knit.md
"D:/Program Files (x86)/Pandoc/pandoc" +RTS -K512m -RTS pku.utf8.md --to html4 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output pku.html --email-obfuscation none --wrap preserve --standalone --section-divs --table-of-contents --toc-depth 3 --template "D:\site-library\bookdown\templates\gitbook.html" --highlight-style pygments --number-sections --css "style\gitbook.css" --include-in-header "C:\Users\xy-huang\AppData\Local\Temp\Rtmpqq6C5l\rmarkdown-str20e86aac3cc9.html" --mathjax --filter pandoc-citeproc
|....... | 11%
inline R code fragments
|.............. | 22%
label: set-options (with options)
List of 2
$ echo : logi FALSE
$ cache: logi FALSE
|...................... | 33%
inline R code fragments
|............................. | 44%
label: co2 (with options)
List of 4
$ echo : logi FALSE
$ out.width: chr "80%"
$ fig.cap : chr "�� R ���Ի���ͼ����"
$ fig.align: chr "center"
|.................................... | 56%
ordinary text without R code
|........................................... | 67%
label: tabair
|................................................... | 78%
ordinary text without R code
|.......................................................... | 89%
label: unnamed-chunk-1 (with options)
List of 1
$ eval: logi FALSE
|.................................................................| 100%
ordinary text without R code
"D:/Program Files (x86)/Pandoc/pandoc" +RTS -K512m -RTS pku.utf8.md --to html4 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output pku.html --email-obfuscation none --self-contained --wrap preserve --standalone --section-divs --template "D:\site-library\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --number-sections --variable "theme:bootstrap" --include-in-header "C:\Users\xy-huang\AppData\Local\Temp\Rtmpqq6C5l\rmarkdown-str20e83bd67914.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --filter pandoc-citeproc
Output created: _book/preface.html
processing file: pku.Rmd
output file: pku.knit.md
|....... | 11%
inline R code fragments
|.............. | 22%
label: set-options (with options)
List of 2
$ echo : logi FALSE
$ cache: logi FALSE
|...................... | 33%
inline R code fragments
|............................. | 44%
label: co2 (with options)
List of 4
$ echo : logi FALSE
$ out.width: chr "80%"
$ fig.cap : chr "�� R ���Ի���ͼ����"
$ fig.align: chr "center"
Output created: pku.html
processing file: pku.Rmd
|.................................... | 56%
ordinary text without R code
|........................................... | 67%
label: tabair
|................................................... | 78%
ordinary text without R code
|.......................................................... | 89%
label: unnamed-chunk-1 (with options)
List of 1
$ eval: logi FALSE
|.................................................................| 100%
ordinary text without R code
"D:/Program Files (x86)/Pandoc/pandoc" +RTS -K512m -RTS pku.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output pku.tex --table-of-contents --toc-depth 2 --template "tex\template_pku.tex" --number-sections --highlight-style tango --pdf-engine xelatex --natbib --top-level-division=chapter --variable tables=yes --standalone
output file: pku.knit.md
Output created: _book/pku.pdf
Warning messages:
1: In (knit_hooks$get("plot"))(file, reduce_plot_opts(options)) :
Chunk options fig.align, out.width, out.height, out.extra are not supported for Word output
2: In xfun::prose_index(content) : Code fences are not balanced
3: In xfun::prose_index(content) : Code fences are not balanced
附 LaTeX 信息
XeTeX 3.14159265-2.6-0.99999 (TeX Live 2018/W32TeX)
kpathsea version 6.3.0
Copyright 2018 SIL International, Jonathan Kew and Khaled Hosny.
There is NO warranty. Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 61.1; using 61.1
Compiled with zlib version 1.2.11; using 1.2.11
Compiled with FreeType2 version 2.9.1; using 2.9.1
Compiled with Graphite2 version 1.3.11; using 1.3.11
Compiled with HarfBuzz version 1.7.6; using 1.7.6
Compiled with libpng version 1.6.34; using 1.6.34
Compiled with poppler version 0.64.0
Compiled with fontconfig version 2.13.0; using 2.13.0