-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add examples with separate bibliographies (Quarto & Rmd)
- Loading branch information
Showing
5 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
58 changes: 58 additions & 0 deletions
58
Rmd_Quarto/separate_bibliographies/grateful-Quarto-separatebib.qmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | ||
::: | ||
|
63 changes: 63 additions & 0 deletions
63
Rmd_Quarto/separate_bibliographies/grateful-Rmarkdown-separatebib.Rmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}, | ||
} |