Markdown
Markdown 将 Markdown 添加为文档内容:# 标题会成为章节(按层级嵌套),并包含段落、列表、表格、代码块、引用、--- 分隔线和 {#id} 图片。标题和数学公式可以带有 id:## Results {#results}、\[ E = mc^2 \] {#eq-energy}。
<KScript.Document title="From Markdown" to="'notes.pdf'">
<Markdown path="chapters/introduction.md" />
<Markdown>
## Summary
- Every chapter is a Markdown file.
- The script puts them together.
</Markdown>
</KScript.Document>import KScript.Document
Document(title: 'From Markdown', to: 'notes.pdf') {
Markdown(path: 'chapters/introduction.md')
Markdown "
## Summary
- Every chapter is a Markdown file.
- The script puts them together.
"
}在 Markdown 文件中,$x$ 和 $$ ... $$ 同样是数学表达式。在脚本内的文本中,请使用 \( \) 和 \[ \],因为那里 $ 是变量。