Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandoc citations without appending the references bibliography

Main Question: Is there a way to flag Pandoc to turn off appending the bibliography but still have it insert the correct inline citations?

I am writing a Markdown / Knitr document that has a main file (article.Rmd) and several "child" files that are included in the main file using Knitr's "child=" chunk option.

The child files are basically sections of the main article file, just separated for easier editing and management. Throughout these child section files, I use the citations in the Markdown text (e.g. "@author_title_1999") to cite various papers. The main file and each child file has a YAML header that provides the BibTex file location, e.g.:

---
bibliography: mybibfile.bib  
...

(Including this YAML entry more than once is not a problem; see the readme on metadata-blocks.)

When I compile the entire document using Knitr, a big Markdown document is created. I then use Pandoc with the --filter pandoc-citeproc option to manage the citations. Pandoc inserts nice citations and appends a list of the cited papers as references/bibliography. Cool.

As I write and edit the individual child sections, I use the same citation compiling which produces the correct inline citations, but unfortunately also appends the references at the end, even though it's just a section of the larger document. I would like to compile these small child sections with inline citations, but without the bibliography at the end.

like image 690
Kalin Avatar asked Oct 17 '14 19:10

Kalin


People also ask

Can you add bibliography without citation?

If you want to create a bibliography, without having a document that has in-text citations, you can do so directly from Mendeley Desktop.

How do you update a bibliography and citations?

On the Document Elements tab, under References, click Manage. In the Citations List, select the citation that you want to edit. , and then click Edit Source. Make the changes that you want, and then click OK.

How do I add references to my RMD?

The usual way to include citations in an R Markdown document is to put references in a plain text file with the extension . bib, in BibTex format. Then reference the path to this file in index. Rmd's YAML header with bibliography: example.

What is in a bibliography?

What is a bibliography? The term bibliography is the term used for a list of sources (e.g. books, articles, websites) used to write an assignment (e.g. an essay). It usually includes all the sources consulted even if they not directly cited (referred to) in the assignment.


1 Answers

I think this is possible with the suppress-bibliography metadata field first introduced in pandoc-citeproc 0.7 (released in May 2015). From the current pandoc-citeproc man page:

pandoc-citeproc will look for the following metadata fields in the input:
...
suppress-bibliography : If this has a true value, the bibliography will be left off. Otherwise a bibliography will be inserted into each Div element with id refs. If there is no such Div, one will be created at the end of the document.

(as a workaround, you can also quite easily create a custom CSL style that doesn't produce a bibliography, by deleting the cs:bibliography child element of the style. See http://docs.citationstyles.org/en/stable/specification.html#child-elements-of-cs-style.)

like image 179
Rintze Zelle Avatar answered Sep 30 '22 14:09

Rintze Zelle