Skip to content

Commit

Permalink
Fix reference section paragraph breaks (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvuorre committed Nov 8, 2024
1 parent 8f90c41 commit 5c4a592
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _extensions/preprint/typst-template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
// Allow custom title for bibliography section
set bibliography(title: bibliography-title, style: bibliography-style)

// Bibliography paragraph spacing
show bibliography: set par(spacing: spacing, leading: leading) if sys.version >= version(0, 12, 0)
show bibliography: set block(spacing: leading) if sys.version < version(0, 12, 0)

// Format author strings here, so can use in author note
let author_strings = ()
if authors != none {
Expand Down
26 changes: 26 additions & 0 deletions tests/bibliography.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@misc{r20240,
title = {R: {{A Language}} and {{Environment}} for {{Statistical Computing}}. {{Version}} 4.4.0},
author = {{R Core Team}},
year = {2024},
address = {Vienna, Austria},
howpublished = {R Foundation for Statistical Computing},
keywords = {nosource}
}

@misc{r20241,
title = {R: {{A Language}} and {{Environment}} for {{Statistical Computing}}. {{Version}} 4.4.1},
author = {{R Core Team}},
year = {2024},
address = {Vienna, Austria},
howpublished = {R Foundation for Statistical Computing},
keywords = {nosource}
}

@misc{r20242,
title = {R: {{A Language}} and {{Environment}} for {{Statistical Computing}}. {{Version}} 4.4.2},
author = {{R Core Team}},
year = {2024},
address = {Vienna, Austria},
howpublished = {R Foundation for Statistical Computing},
keywords = {nosource}
}
29 changes: 29 additions & 0 deletions tests/paragraph-breaks.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: "Appendices"
author:
- name: Matti Vuorre
email: [email protected]
orcid: 0000-0001-5052-066X
url: https://www.tilburguniversity.edu/staff/m-j-vuorre
corresponding: true
affiliation:
- ref: 1
affiliations:
- id: 1
name: Tilburg University
department: Department of Social Psychology
format:
preprint-typst: default
bibliography: bibliography.bib
suppress-bibliography: true
---

```{r}
quarto::quarto_version()
```

This is a regular text paragraph. This is a regular text paragraph. This is a regular text paragraph. This is a regular text paragraph. This is a regular text paragraph.

This is a regular text paragraph. This is a regular text paragraph. This is a regular text paragraph. This is a regular text paragraph. This is a regular text paragraph.

Different versions of R will show up in the references: [@r20240], [@r20241], [@r20242].

0 comments on commit 5c4a592

Please sign in to comment.