yamlr-markdown

How to Prevent Abstract and Keywords in yaml from showng after knitting RMarkdown


I do not want "Abstract" and "Keyword" to display after knitting LNSC Rmarkdown template. The yaml template for LNSC is shown below:

To seen the template in RStudio go to: File > New File > R markdown > Click on From Template > Click Springer Lecture Notes in Computer Science

---
classoption: "runningheads"
title: "Contribution Title\\thanks{Supported by organization x.}"
shorttitle: "Short title"
# If the paper title is too long for the 
# running head, you can set an abbreviated 
# paper title here.
# shorttitle: "Abbreviated paper title"
authors: 
  - name: "First Author"
    inst: "1"
    orcid: "0000-1111-2222-3333"
  - name: "Second Author"
    inst: "2,3"
    orcid: "1111-2222-3333-4444"
  - name: "Third Author"
    inst: "3"
    orcid: "2222--3333-4444-5555"
# First names are abbreviated in the running head.
# If there are more than two authors, 'et al.' is used.
authorrunning: "F. Author et al." 
institutes: 
  - name: "Princeton University, Princeton NJ 08544, USA"
  - name: "Springer Heidelberg, Tiergartenstr. 17, 69121 Heidelberg, Germany"
    email: "lncs@springer.com"
    url: "http://www.springer.com/gp/computer-science/lncs"
  - name: "ABC Institute, Rupert-Karls-University Heidelberg, Heidelberg, Germany"
    email: "dummy@uni-heidelberg.de"
    
abstract: |
  The abstract should briefly summarize the contents of the paper in 150--250 words.
keywords: 
  - First keyword
  - Second keyword
  - Another keyword
bibliography: lncs-test.bib
# Use csl when using default citation_package for Pandoc citeproc
csl: https://www.zotero.org/styles/springer-lecture-notes-in-computer-science
# citations with arabic numbers is prefered when using natbib
natbiboptions: numbers

output: 
  rticles::lncs_article:
    citation_package: default # or natbib
    
---

Solution

  • That format uses the template found here:

    system.file("rmarkdown/templates/lncs/resources/template.tex", package="rticles")
    

    It doesn't appear to offer an option to suppress the abstract and keywords, so what you could do is edit that file and save it in a new location, then specify that new file as the template to use. Your edits should remove the lines

    \begin{abstract}
    $abstract$
    
    \keywords{$for(keywords)$$keywords$$sep$ \and $endfor$}
    
    \end{abstract}
    

    To specify that as your template, use

    output: 
      rticles::lncs_article:
        citation_package: default # or natbib
        template: <the filename for the new template>