Skip to content

Commit

Permalink
add examples with separate bibliographies (Quarto & Rmd)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakillo committed Sep 17, 2023
1 parent 32f8e6f commit 47715b3
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 0 deletions.
Binary file not shown.
58 changes: 58 additions & 0 deletions Rmd_Quarto/separate_bibliographies/grateful-Quarto-separatebib.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: "Using 'grateful' with Quarto: separate software bibliography"
format: pdf
filters:
- multibib # install from https://github.com/pandoc-ext/multibib
bibliography:
main: main-refs.bib
software: grateful-refs.bib
validate-yaml: false # to overcome this issue https://github.com/pandoc-ext/multibib/issues/1
citeproc: false
---

Here we cite a paper [@smith_software_2016].


Load packages

```{r}
#| message: false
library(dplyr)
library(ggplot2)
library(visreg)
```

Run some analysis

```{r}
iris |>
group_by(Species) |>
summarise(mean(Petal.Length))
ggplot(iris) +
geom_jitter(aes(Species, Petal.Length, colour = Species))
model <- lm(Petal.Length ~ Species, data = iris)
visreg(model)
```


Now we cite R packages:

```{r}
#| echo: false
grateful::cite_packages(output = "paragraph", pkgs = "Session", out.dir = ".")
```



# References

::: {#refs-main}
:::

# Software

::: {#refs-software}
:::

Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: "Using 'grateful' with Rmarkdown: separate software bibliography"
output:
pdf_document:
pandoc_args: ['--lua-filter=multibib.lua']
bibliography:
main: main-refs.bib
software: grateful-refs.bib
citeproc: false
---

```{r echo=FALSE}
# Download pandoc filter if not available
# https://github.com/pandoc-ext/multibib
if (!file.exists("multibib.lua")) {
download.file(url = "https://raw.githubusercontent.com/pandoc-ext/multibib/main/_extensions/multibib/multibib.lua",
destfile = "multibib.lua",
mode = "wb")
}
```


Here we cite a paper [@smith_software_2016].

Load packages

```{r message=FALSE}
library(dplyr)
library(ggplot2)
library(visreg)
```

Run some analysis

```{r}
iris |>
group_by(Species) |>
summarise(mean(Petal.Length))
ggplot(iris) +
geom_jitter(aes(Species, Petal.Length, colour = Species))
model <- lm(Petal.Length ~ Species, data = iris)
visreg(model)
```

Now we cite R packages:

```{r echo=FALSE}
grateful::cite_packages(output = "paragraph", pkgs = "Session", out.dir = ".")
```


# References

::: {#refs-main}
:::

# Software

::: {#refs-software}
:::

Binary file not shown.
16 changes: 16 additions & 0 deletions Rmd_Quarto/separate_bibliographies/main-refs.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

@article{smith_software_2016,
title = {Software citation principles},
volume = {2},
issn = {2376-5992},
url = {https://peerj.com/articles/cs-86},
doi = {10.7717/peerj-cs.86},
abstract = {Software is a critical part of modern research and yet there is little support across the scholarly ecosystem for its acknowledgement and citation. Inspired by the activities of the FORCE11 working group focused on data citation, this document summarizes the recommendations of the FORCE11 Software Citation Working Group and its activities between June 2015 and April 2016. Based on a review of existing community practices, the goal of the working group was to produce a consolidated set of citation principles that may encourage broad adoption of a consistent policy for software citation across disciplines and venues. Our work is presented here as a set of software citation principles, a discussion of the motivations for developing the principles, reviews of existing community practice, and a discussion of the requirements these principles would place upon different stakeholders. Working examples and possible technical solutions for how these principles can be implemented will be discussed in a separate paper.},
language = {en},
urldate = {2023-05-02},
journal = {PeerJ Computer Science},
author = {Smith, Arfon M. and Katz, Daniel S. and Niemeyer, Kyle E. and {FORCE11 Software Citation Working Group}},
month = sep,
year = {2016},
pages = {e86},
}

0 comments on commit 47715b3

Please sign in to comment.