【问题标题】:How to control the font size of quoted text in Markdown如何控制 Markdown 中引用文本的字体大小
【发布时间】:2021-03-30 22:08:07
【问题描述】:

Markdown 上引用文本的字体与其余(未引用)文本相比通常太大。这是一个例子:

使用 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 谢谢。似乎它确实发生了。

标签: r markdown


【解决方案1】:

这似乎是 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 的作用,但我没有这方面的经验。在上传到 GitHub 之前,我使用 RStudio 中的knit 函数来编译 html 文件。我不知道我可以把你写的 CSS 文件保存在哪里。
  • 与您的 RMarkdown 文件位于同一文件夹中。当您在标题中提供像 custom.css 这样的相对路径时,R 会在那里查看。
  • 你也可以插入css代码块:```{css}....```
【解决方案2】:

作为外部 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)

【讨论】:

    猜你喜欢
    • 2012-05-05
    • 1970-01-01
    • 2019-05-13
    • 2015-12-02
    • 1970-01-01
    • 2016-05-24
    • 1970-01-01
    • 2015-05-05
    • 1970-01-01
    相关资源
    最近更新 更多