如何在Markdown中控制引用文本的字体大小

13
Markdown中引用文本的字体大小通常与其他(未引用的)文本形成对比,过大。这是一个例子: enter image description here 使用RStudio生成。
#####Intution:

> **[Identification of an MA model is often best done with the ACF rather
> than the PACF]((https://onlinecourses.science.psu.edu/stat510/node/62))**.
> 
> For an MA model, the theoretical PACF does not shut off, but instead
> tapers toward 0 in some manner.  A clearer pattern for an MA model is
> in the ACF.  The ACF will have non-zero autocorrelations only at lags
> involved in the model.
> 
> A moving average term in a time series model is a past error (multiplied by a coefficient).

The $q^{\text{th}}$-order moving average model, denoted by MA(q) is

你可能需要对底层的CSS进行一些操作(也许你可以在你的Markdown文件中使用适当的CSS指令来覆盖这个<div>元素的定义)。我不是专家,所以希望有人能够提供帮助。 - Ben Bolker
@Ben Bolker 谢谢。看起来确实发生了这种情况。 - Antoni Parellada
2个回答

16

这似乎是RMarkdown默认用于HTML输出的CSS的一部分,在其中引用块具有:

blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 17.5px;
    border-left: 5px solid #eee;
}

你可以通过创建自定义的CSS文件(例如custom.css)来覆盖这个。

blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 14px;
    border-left: 5px solid #eee;
}

然后将其添加到您的RMarkdown文档的标题中:

---
title: "Untitled"
author: "Me"
output: 
  html_document:
    css: custom.css
---

我了解CSS的作用,但是我没有任何使用它的经验。我在RStudio中使用knit函数来编译HTML文件,然后上传到GitHub上。对于你编写的CSS文件,我完全不知道该放在哪里。 - Antoni Parellada
2
就在与您的RMarkdown文件相同的文件夹中。当您在头部给出一个相对路径,比如custom.css,R会在那里查找。 - Marius
你也可以插入 css 代码块:```{css}....``` - Marek

7
作为替代外部CSS文件的方法,您可以使用CSS代码块:
---
title: "Example"
date: "`r Sys.time()`"
output: html_document
---

```{css style settings, echo = FALSE}
blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 14px;
    border-left: 5px solid #eee;
}
```

Now quotes will be as you wish

> example quote (blah blah blah)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接