/
.pagemargin 函数沿着页面的页边距,在固定位置显示内容。
在 paged 文档中,每一页都会预留一个特殊区域用于放置页边距:

来源:Paged.js
在 plain 和 slides 文档中,设置在页边距上的内容可能会与页面内容发生重叠。
在 plain 文档中,由于不存在页面的概念,页边距内容每个文档只显示一次。
该函数接受一个可选的 position 参数和一个主体参数 content:
| 参数 | 说明 | 可接受值 |
|---|---|---|
position | 要定位的页面区域。 | topleftcorner、topleft、topcenter、topright、toprightcorner、righttop、rightmiddle、rightbottom、bottomrightcorner、bottomright、bottomcenter、bottomleft、bottomleftcorner、leftbottom、leftmiddle、lefttop、topoutsidecorner、topoutside、topinsidecorner、topinside、bottomoutsidecorner、bottomoutside、bottominsidecorner、bottominside |
content | 要显示的元素。 | 块级内容 |
.pagemargin {topright}
**这是**一段页边距内容。
在 paged 和 slides 文档中使用时,页边距内容仅从它被声明的那一页开始生效。这使得文档的不同部分可以采用不同的页边距设置。
.pagemargin {topcenter}
在所有页面上
## 第一页
## 第二页
.pagemargin {topleft}
从第二页起
## 第三页
再次覆盖页边距,会从此处开始改变它。
...
## 第三页
.pagemargin {topcenter}
从第三页起
除了 topright 或 bottomleft 这样的固定位置外,Quarkdown 还支持镜像位置,它们会根据页面是左侧(偶数)还是右侧(奇数)而自适应调整。
上表中以斜体标记的位置即为镜像位置,它们指向 outside(外侧)与 inside(内侧)区域:
.pagemargin {topoutside}
**这是**一段页边距内容。
大多数布局主题会将 bottomcenter 页边距与文档页脚关联,并为其应用不同的样式。例如,不同的块可能会以一行排列显示。页脚在 slides 文档中尤为常见。
.footer 函数是 .pagemargin {bottomcenter} 的简写形式。
.theme {beaver} layout:{beamer}
.footer
.docauthor
**.docname**
[GitHub](https://github.com/iamgio/quarkdown)
页边距可以承载页码。更多信息请参阅页码 。