从文章中删除摘要::elsevier_article

jul*_*ljo 4 latex r r-markdown

我想将一篇文章编成一个没有摘要的 PDF 文档。如果我只是省略 YAML 标头中的抽象部分,则文档中仍会生成抽象标题。有没有办法在不更改底层函数或文档类的情况下删除它?

\n

我已经尝试过 或 等方法,abstract: false这些none方法似乎适用于其他一些 YAML 标头参数。

\n

一个可重现的 YAML 标头,它是包示例的稍微修改的版本rticles

\n
---\ntitle: Short Paper\nauthor:\n  - name: Alice Anonymous\n    email: alice@example.com\n    affiliation: Some Institute of Technology\n    footnote: 1\n  - name: Bob Security\n    email: bob@example.com\n    affiliation: Another University\n  - name: Cat Memes\n    email: cat@example.com\n    affiliation: Another University\n    footnote: 2\n  - name: Derek Zoolander\n    email: derek@example.com\n    affiliation: Some Institute of Technology\n    footnote: 2\naddress:\n  - code: Some Institute of Technology\n    address: Department, Street, City, State, Zip\n  - code: Another University\n    address: Department, Street, City, State, Zip\nfootnote:\n  - code: 1\n    text: "Corresponding Author"\n  - code: 2\n    text: "Equal contribution"\n\njournal: "An awesome journal"\ndate: "`r Sys.Date()`"\nbibliography: mybibfile.bib\n#linenumbers: true\n#numbersections: true\ncsl: elsevier-harvard.csl\noutput: rticles::elsevier_article\n---\n
Run Code Online (Sandbox Code Playgroud)\n

所以生成的文档看起来像这样(摘要标题是我想要删除的内容):

\n

PDF文档截图

\n

Pandoc生成的中间LaTex文件中有以下代码:

\n
\\documentclass[]{elsarticle} %review=doublespace preprint=single 5p=2 column\n%%% Begin My package additions %%%%%%%%%%%%%%%%%%%\n\\usepackage[hyphens]{url}\n\n  \\journal{An awesome journal} % Sets Journal name\n\n\\usepackage{lineno} % add\n\\providecommand{\\tightlist}{%\n  \\setlength{\\itemsep}{0pt}\\setlength{\\parskip}{0pt}}\n\n\\usepackage{graphicx}\n\\usepackage{booktabs} % book-quality tables\n%%%%%%%%%%%%%%%% end my additions to header\n\n\\usepackage[T1]{fontenc}\n\\usepackage{lmodern}\n\\usepackage{amssymb,amsmath}\n\\usepackage{ifxetex,ifluatex}\n\\usepackage{fixltx2e} % provides \\textsubscript\n% use upquote if available, for straight quotes in verbatim environments\n\\IfFileExists{upquote.sty}{\\usepackage{upquote}}{}\n\\ifnum 0\\ifxetex 1\\fi\\ifluatex 1\\fi=0 % if pdftex\n  \\usepackage[utf8]{inputenc}\n\\else % if luatex or xelatex\n  \\usepackage{fontspec}\n  \\ifxetex\n    \\usepackage{xltxtra,xunicode}\n  \\fi\n  \\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}\n  \\newcommand{\\euro}{\xe2\x82\xac}\n\\fi\n% use microtype if available\n\\IfFileExists{microtype.sty}{\\usepackage{microtype}}{}\n\\bibliographystyle{elsarticle-harv}\n\\ifxetex\n  \\usepackage[setpagesize=false, % page size defined by xetex\n              unicode=false, % unicode breaks when used with xetex\n              xetex]{hyperref}\n\\else\n  \\usepackage[unicode=true]{hyperref}\n\\fi\n\\hypersetup{breaklinks=true,\n            bookmarks=true,\n            pdfauthor={},\n            pdftitle={Short Paper},\n            colorlinks=false,\n            urlcolor=blue,\n            linkcolor=magenta,\n            pdfborder={0 0 0}}\n\\urlstyle{same}  % don\'t use monospace font for urls\n\n\\setcounter{secnumdepth}{0}\n% Pandoc toggle for numbering sections (defaults to be off)\n\\setcounter{secnumdepth}{0}\n\n% Pandoc citation processing\n\n% Pandoc header\n\n\n\n\\begin{document}\n\\begin{frontmatter}\n\n  \\title{Short Paper}\n    \\author[Some Institute of Technology]{Alice Anonymous\\corref{1}}\n   \\ead{alice@example.com} \n    \\author[Another University]{Bob Security}\n   \\ead{bob@example.com} \n    \\author[Another University]{Cat Memes\\corref{2}}\n   \\ead{cat@example.com} \n    \\author[Some Institute of Technology]{Derek Zoolander\\corref{2}}\n   \\ead{derek@example.com} \n      \\address[Some Institute of Technology]{Department, Street, City, State, Zip}\n    \\address[Another University]{Department, Street, City, State, Zip}\n      \\cortext[1]{Corresponding Author}\n    \\cortext[2]{Equal contribution}\n  \n  \\begin{abstract}\n  \n  \\end{abstract}\n  \n \\end{frontmatter}\n\n\\end{document}\n
Run Code Online (Sandbox Code Playgroud)\n

sam*_*ter 6

添加

\renewenvironment{abstract}{}{}
Run Code Online (Sandbox Code Playgroud)

到您的标头包含。这将使抽象环境无效。