inv*_*tus 5 css pandoc rstudio knitr r-markdown
假设您想要使用计算机现代字体(如 Latex 中所示)用于最新版本 RStudio(版本 0.98.1091)中生成的 knitr 文档。
因此,您上网查找源代码,并在您根据 Package Vignettes 提供的样式表修改的 .css 样式表中使用它:
@font-face {
font-family: 'Computer Modern Concrete';
src: url('cmunorm.eot');
src: url('cmunorm.eot?#iefix') format('embedded-opentype'),
url('cmunorm.woff') format('woff'),
url('cmunorm.ttf') format('truetype'),
url('cmunorm.svg#cmunorm') format('svg');
font-weight: normal;
font-style: normal;
}
body {
background-color: #fff;
margin: auto;
max-width: 700px;
overflow: visible;
padding-left: 2em;
padding-right: 2em;
font-family: 'Computer Modern Concrete';
font-size: 15px;
line-height: 1.10;
}
Run Code Online (Sandbox Code Playgroud)
并在 YAML 中调用样式表:
---
title: "CSS for dummies"
author: "This idiot"
date: "December 2014"
output:
html_document:
theme: null
highlight: null
css: custom2.css
---
Run Code Online (Sandbox Code Playgroud)
.css 样式表在新字体调用之前加载良好,但现在出现错误:
pandoc: Could not find data file ./cmunorm.eot
Error: pandoc document conversion failed with error 97
Execution halted
Run Code Online (Sandbox Code Playgroud)
该文件显然在 github 中。你在网上搜索了几个小时却没有缓解。因此,你带着一个愚蠢的问题来到 StackOverflow,并做好遭受挫伤的准备。
有谁知道我哪里出错了?非常感谢。