You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CTeX能够正常使用中文,需要在其他模板如 Journal of Statistical Software中使用中文,改如何做?
---
author:
- name: FirstName LastName
affiliation: University/Company
address: >
First line
Second line
email: name@company.com
url: http://rstudio.com
- name: Second Author
affiliation: Affiliation
title:
formatted: "A Capitalized Title: Something about a Package \\pkg{foo}"
# If you use tex in the formatted title, also supply version without
plain: "A Capitalized Title: Something about a Package foo"
# For running headers, if needed
short: "\\pkg{foo}: A Capitalized Title"
abstract: >
The abstract of the article.
keywords:
# at least one keyword must be supplied
formatted: [keywords, not capitalized, "\\proglang{Java}"]
plain: [keywords, not capitalized, Java]
preamble: >
\usepackage{amsmath}
output: rticles::jss_article
documentclass: ctexart
---
# 中文 Introduction
提示:
! Undefined control sequence.
\GenericError ...
#4 \errhelp \@err@ ...
l.42 \section{中文 Introduction}
pandoc: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
Execution halted
Activity
yihui commentedon Feb 9, 2016
目前来说我估计不大可能,首先
documentclass: ctexart对JSS模板来说毫无用处,因为模板中的文档类已经被写死了:https://github.com/rstudio/rticles/blob/master/inst/rmarkdown/templates/jss_article/resources/template.tex 其次,中文文档十之八九需要通过xelatex编译,JSS模板默认是pdflatex编译。第一个问题也许可以通过在导言区插入
\usepackage{ctexcap}解决,至于第二个问题,因为jss_article()不接受参数,所以无法设置LaTeX引擎,你只能自定义函数和模板了。github-actions commentedon Nov 2, 2020
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.