Skip to content

Commit

Permalink
Update skeletong to show available bibliostyle
Browse files Browse the repository at this point in the history
fix #545
  • Loading branch information
cderv committed Oct 12, 2023
1 parent fcbcf83 commit 8dd188a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: rticles
Title: Article Formats for R Markdown
Version: 0.25.1
Version: 0.25.2
Authors@R: c(
person("JJ", "Allaire", , "jj@posit.co", role = "aut"),
person("Yihui", "Xie", , "xie@yihui.name", role = "aut",
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rticles (development version)

- `elsevier_article()` Rmd skeleton is now updated to show different available bibliostyle file (i.e `*.bst` for _natbib_) with `elsearticle` document class. `biblio-style: elsarticle-harv` is set by default to correctly work with the `authoryear` classoption already set (thanks, @pepijn-devries, #545).

# rticles 0.25

## BREAKING CHANGES
Expand Down
8 changes: 5 additions & 3 deletions inst/rmarkdown/templates/elsevier/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ keywords:
- keyword2
journal: "An awesome journal"
date: "`r Sys.Date()`"
classoption: preprint, 3p, authoryear
bibliography: mybibfile.bib
linenumbers: false
numbersections: true
bibliography: mybibfile.bib
biblio-style: elsarticle-harv # author year style for natbib - use 'elsarticle-num' or 'elsarticle-num-names' for numbered scheme
classoption: preprint, 3p, authoryear # remove authoryear is not using `elsarticle-harv`
# Use a CSL with `citation_package = "default"`
# csl: https://www.zotero.org/styles/elsevier-harvard
output:
Expand All @@ -68,7 +69,8 @@ For detailed instructions regarding the elsevier article class, see <https://w

Here are two sample references: @Feynman1963118 [@Dirac1953888].

By default, natbib will be used with the `authoryear` style, set in `classoption` variable in YAML.
By default, natbib will be used with the `authoryear` style, set in `classoption` variable in YAML and with `elsearticle-harv.bst` which is among provided style by `elsarticle` documentclass. Other available style are `elsarticle-num.bst` and `elsarticle-num-names.bst` — the first one can be used for the numbered scheme, second one for numbered with new options of natbib.sty.

You can sets extra options with `natbiboptions` variable in YAML header. Example
```yaml
natbiboptions: longnamesfirst,angle,semicolon
Expand Down

0 comments on commit 8dd188a

Please sign in to comment.