在pandoc的markdown文件的YAML标题中,可以编写一个摘要。我想知道是否有办法将渲染文档中的“抽象”一词改为其他语言的“摘要”或同等词。
如果没有,可以提出哪些替代方案?我正在使用R Markdown。
附:我的问题与this comment有关。
如果您的主要兴趣在于文档的本地化,则可以在文档中添加lang
元值。例如,设置lang: lt
将在生成的PDF中给出“Santrauka”而不是“Abstract”。
是。但不是自动的。你必须重新定义abstract
环境以从不同的头开始,或者至少重新定义\abstractname
变量,因为article.cls
具有:
\newenvironment{abstract}{%
\titlepage
\null\vfil
\@beginparpenalty\@lowpenalty
\begin{center}%
\bfseries \abstractname %%%% This what you need to redefine
\@endparpenalty\@M
\end{center}}%
{\par\vfil\null\endtitlepage}
所以你可以做类似以下最小例子的事情:
---
title: "Test Document"
author: "Some User"
output: pdf_document
abstract: >
One or two sentences describing it all.
header-includes:
\renewcommand{\abstractname}{My Very Own Summary}
---
## R Markdown
This is an R Markdown document.
做你想做的事: