【发布时间】:2021-01-14 21:49:11
【问题描述】:
我有一个带有自定义template.tex 和自定义my-format.cls 的bookdown 项目。我可以在我的template.tex 中执行以下操作:
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$
\tableofcontents
\begin{body}
...
并获取摘要以采用我的自定义格式。这部分是因为摘要的内容只是一段文本,可以放在 YAML 前端。
但是,是否可以在目录之前添加执行摘要?
我知道我可以使用(在我的index.Rmd)
# Executive Summary {-}
a summary here
# Introduction
this is the first numbered section
但在这种情况下,即使“执行摘要”部分标题没有编号,它也会出现在 TOC 之后。是否可以修改template.tex 以便使用类似:
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$
$if(executive_summary)$
\begin{executivesummary}
% insert summary content here
\end{executivesummary}
$endif$
\tableofcontents
\begin{body}
...
我可以从未编号的执行摘要部分(即使它必须来自不同的.Rmd 文件)中剥离内容(包括数字/表格/等)并将其分配给一些(pandoc)变量,参考代替上面的% If I insert summary content here?我还需要从默认分配的(pandoc)$body$ 变量中删除相同的内容。
【问题讨论】:
-
您可能还需要使用 abstract-to-meta Lua 过滤器,请参阅 bookdown.org/yihui/rmarkdown-cookbook/lua-filters.html
标签: r-markdown pandoc bookdown