在xaringan中,我想在标题幻灯片中添加一个背景。我按照一惠氏指令成功地做到了这一点。
这是可行的,除非I松开默认字体(Yanone )。
YAML:
---
title: "My title"
subtitle: "My subtitle"
author: "Me Myself"
date: "01/01/2012"
output:
xaringan::moon_reader:
css: my-theme.css
lib_dir: libs
nature:
ratio: '16:9'
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
---其中my-theme.css如下:
.title-slide {
background-image: url(Figures/MyBackground.jpg);
background-size: cover;
}发布于 2018-08-11 14:49:18
我不建议您将default-fonts.css添加到my-theme.css中。如果您想要默认字体,可以使用
output:
xaringan::moon_reader:
css: [default, default-fonts, my-theme.css]参阅更多信息,在第7.5款的R标记书。
发布于 2018-08-10 19:56:35
我想我已经搞清楚了。我已经将字体调用添加到自定义css中。所以现在我的my-theme.css看起来是:
.title-slide {
background-image: url(Figures/Suncor_2018_Background.jpg);
background-size: cover;
}
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700);
body { font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; }
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.remark-code, .remark-inline-code { font-family: 'Source Code Pro', 'Lucida Console', Monaco, monospace; }我在...\library\xaringan\rmarkdown\templates\xaringan\resources default-fonts.css找到了这个
https://stackoverflow.com/questions/51793049
复制相似问题