我的 Quarto 参考

一份 Quarto 扩展语法和样式的清单

Markdown 不常用语法备查、Callout Blocks、文章布局、注释和引用,以及汉字标准格式的引入
quarto
发布日期

2023-01-06

Markdown 语法备查

持续的有序列表 (@)

(@) A list whose numbering

continues after

(@) an interruption
  1. A list whose numbering

continues after

  1. an interruption

术语定义

anarchism
: a political theory advocating the abolition of hierarchical government and the organization of society on a voluntary, cooperative basis without recourse to force or compulsion
anarchism
a political theory advocating the abolition of hierarchical government and the organization of society on a voluntary, cooperative basis without recourse to force or compulsion.

断行

添加<br>或添加几个空格。

Anger is a bitter lock.<br>But you can turn it.

Anger is a bitter lock.
But you can turn it.

任务列表

- [x] 整理房间
- [ ] 洗衣服
  • 整理房间
  • 洗衣服

Callout Blocks

支持.callout-

  • note
  • warning
  • important
  • tip
  • caution

可添加collapse="true"以折叠。

例子:

:::{.callout-note collapse="true"}
## Quarto v1.2 Required

Support for videos is a feature of Quarto v1.2. If you want to use this feature please download and install [Quarto v1.2](https://quarto.org/docs/download/) before proceeding.
:::

Support for videos is a feature of Quarto v1.2. If you want to use this feature please download and install Quarto v1.2 before proceeding.

文章布局

参见:https://quarto.org/docs/authoring/article-layout.html

此处引几个例子:

边栏 .column-margin

::: {.column-margin}
We know from *the first fundamental theorem of calculus* that for $x$ in $[a, b]$:

$$\frac{d}{dx}\left( \int_{a}^{x} f(u)\,du\right)=f(x).$$
:::

We know from the first fundamental theorem of calculus that for \(x\) in \([a, b]\):

\[\frac{d}{dx}\left( \int_{a}^{x} f(u)\,du\right)=f(x).\]

超出边距

对于 .column 进行多种搭配:

  1. 首先选择要超出的位置,如超过page, body或者screen

  2. 选择是否被一小段边距包裹inset或者outset(对于screen还可以使用边框inset-shaded,但不能再加入方向)

  3. 最后选择方向,加入leftright

例如:

```{r}
#| column: screen-left
#| layout-nrow: 1

plot(cars)
plot(iris)
plot(pressure)
```

screen例子:

```{r}
#| column: screen

library(leaflet)
leaflet() %>%
  addTiles() %>%  # Add default OpenStreetMap map tiles
  addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")
```

注释和引用

  • 在需要插入的地方加入[^#],其中#自行设定,如1abc。注意添加注释的内容[^#]: type here
Here's a simple footnote,[^c] and here's a longer one.[^bignote]

[^c]: This is the first footnote.

[^bignote]: Here's one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    `{ my code }`

    Add as many paragraphs as you like.

Here’s a simple footnote,1 and here’s a longer one.2

  • 也可以不用加#^[type here],像这样3

  • 也可使用旁注:[type here]{.aside}

我是旁注。

开启边栏显示所有注释、引用

在metadata部分使用:

---
reference-location: margin
citation-location: margin
---

标准 Pandoc Markdown 引用

在metadata部分记得引入参考文献目录文件:

---
bibliography: test-references.bib
---
Blah Blah [see @gomes_household_2021; also @liu_household_2020]

其他有关脚注和引用:https://quarto.org/docs/authoring/footnotes-and-citations.html

汉字标准格式

本站点引入了“汉字标准格式”排版框架。

简体中文实例

「汉字标准格式」是一套支援各种印刷效果的Sass + JavaScript排版框架,包含相邻文字装饰线跳脱hànzìbiāoyīnㄏㄢˋㄗˋㄅㄧㄠㄧㄣ着重号、标点符号修正、中文四大印刷体、汉字-西文mixed间隙、「标点『挤压』与『悬挂』」、章节边界调整……

繁體中文实例

「漢字標準格式」是一套支援各種印刷效果的Sass + JavaScript排版框架,包含相鄰文字裝飾線跳脫hànzìbiāoyīnㄏㄢˋㄗˋㄅㄧㄠㄧㄣ着重號、標點符號修正、中文四大印刷體、漢字-西文mixed間隙、「標點『擠壓』與『懸掛』」、章節邊界調整……

한국어 예제

CSS - 나무위키:

HTML 등의 마크업 언어로 작성된 문서가 실제로 웹사이트에 표현되는 방법을 정해주는 스타일 시트 언어.

CSS의 C가 Cascading4의 약자인데, 이는 상위 요소의 스타일 속성을 자손 요소들에게 상속시켜주는 모습이 DOM 트리구조에서 마치 폭포수처럼 내려가는 모습을 닮았기 때문이다. 다만 예외로 마진, 패딩, 보더 등의 박스모델 관련 속성은 상속되지 않는다. 물론 inherit 값을 줘서 강제로 상속시킬 순 있다.

参考

Gomes, Francisco, Michael Haliassos, 和 Tarun Ramadorai. 2021. 《Household Finance》. Journal of Economic Literature 59 (3): 919–1000. https://doi.org/10.1257/jel.20201461.
Liu, Zhifeng, Xueyi Zhong, Tingting Zhang, 和 Wenquan Li. 2020. 《Household debt and happiness: evidence from the China Household Finance Survey》. Applied Economics Letters 27 (3): 199–205. https://doi.org/10.1080/13504851.2019.1610706.