juljo
juljo

Reputation: 674

Delete abstract from rticles::elsevier_article

I'd like to knit an article to a PDF document without an abstract. If I just leave out the abstract part in the YAML header, the Abstract headline is still produced in the document. Is there a way to drop this without changing the underlying function or document class?

I've tried such approaches as abstract: false or none which seem to work for some of the other YAML header arguments.

A reproducible YAML header which is a slightly modified version of the rticles package example:

---
title: Short Paper
author:
  - name: Alice Anonymous
    email: [email protected]
    affiliation: Some Institute of Technology
    footnote: 1
  - name: Bob Security
    email: [email protected]
    affiliation: Another University
  - name: Cat Memes
    email: [email protected]
    affiliation: Another University
    footnote: 2
  - name: Derek Zoolander
    email: [email protected]
    affiliation: Some Institute of Technology
    footnote: 2
address:
  - code: Some Institute of Technology
    address: Department, Street, City, State, Zip
  - code: Another University
    address: Department, Street, City, State, Zip
footnote:
  - code: 1
    text: "Corresponding Author"
  - code: 2
    text: "Equal contribution"

journal: "An awesome journal"
date: "`r Sys.Date()`"
bibliography: mybibfile.bib
#linenumbers: true
#numbersections: true
csl: elsevier-harvard.csl
output: rticles::elsevier_article
---

So the resulting document looks like this (the Abstract headline is what I'd like to get rid of):

Screenshot of PDF document

The intermediate LaTex file generated by Pandoc has the following code in it:

\documentclass[]{elsarticle} %review=doublespace preprint=single 5p=2 column
%%% Begin My package additions %%%%%%%%%%%%%%%%%%%
\usepackage[hyphens]{url}

  \journal{An awesome journal} % Sets Journal name

\usepackage{lineno} % add
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

\usepackage{graphicx}
\usepackage{booktabs} % book-quality tables
%%%%%%%%%%%%%%%% end my additions to header

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[utf8]{inputenc}
\else % if luatex or xelatex
  \usepackage{fontspec}
  \ifxetex
    \usepackage{xltxtra,xunicode}
  \fi
  \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
  \newcommand{\euro}{€}
\fi
% use microtype if available
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
\bibliographystyle{elsarticle-harv}
\ifxetex
  \usepackage[setpagesize=false, % page size defined by xetex
              unicode=false, % unicode breaks when used with xetex
              xetex]{hyperref}
\else
  \usepackage[unicode=true]{hyperref}
\fi
\hypersetup{breaklinks=true,
            bookmarks=true,
            pdfauthor={},
            pdftitle={Short Paper},
            colorlinks=false,
            urlcolor=blue,
            linkcolor=magenta,
            pdfborder={0 0 0}}
\urlstyle{same}  % don't use monospace font for urls

\setcounter{secnumdepth}{0}
% Pandoc toggle for numbering sections (defaults to be off)
\setcounter{secnumdepth}{0}

% Pandoc citation processing

% Pandoc header



\begin{document}
\begin{frontmatter}

  \title{Short Paper}
    \author[Some Institute of Technology]{Alice Anonymous\corref{1}}
   \ead{[email protected]} 
    \author[Another University]{Bob Security}
   \ead{[email protected]} 
    \author[Another University]{Cat Memes\corref{2}}
   \ead{[email protected]} 
    \author[Some Institute of Technology]{Derek Zoolander\corref{2}}
   \ead{[email protected]} 
      \address[Some Institute of Technology]{Department, Street, City, State, Zip}
    \address[Another University]{Department, Street, City, State, Zip}
      \cortext[1]{Corresponding Author}
    \cortext[2]{Equal contribution}
  
  \begin{abstract}
  
  \end{abstract}
  
 \end{frontmatter}

\end{document}

Upvotes: 4

Views: 1813

Answers (1)

Add

\renewenvironment{abstract}{}{}

to your header-includes. This will nullify the abstract environment.

Upvotes: 6

Related Questions