Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to translate title of `abstract` in a pandoc's markdown (e.g., Rmd) document?

In the YAML header of a pandoc's markdown file, it's possible to write an abstract. I wonder if there is a way to change the word "abstract" in the rendered document to something else like either word "summary" or equivalent in another language.

If not, what alternatives could be suggested? I'm using R Markdown.

p.s. My question is related to this comment.

like image 839
GegznaV Avatar asked Dec 23 '17 17:12

GegznaV


1 Answers

Yes. But not automatically. You would have to redefine the abstract environment to start with a different header, or at least redefine the \abstractname variable as article.cls has this:

\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}

So you can do something like the following minimal example:

---
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.

which does what you desire:

enter image description here

like image 104
Dirk Eddelbuettel Avatar answered Sep 18 '22 01:09

Dirk Eddelbuettel