2

I am using RMarkdown in RStudio to reference multiple sources out of my .bib file with csl (see below).

My .Rmd doc:

---
title: "mytitle"
author: "nunberg"
date: '01\.01\.2019'
output:
  pdf_document: default
  html_document: default
bibliography: refs.bib
csl: vancouver.csl
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# A Header
Here I want to cite [@georgii2015stochastik]
End of the report

Example from my .bib file:

@book{georgii2015stochastik,
  title={Stochastik: Einf{\"u}hrung in die Wahrscheinlichkeitstheorie und Statistik},
  author={Georgii, Hans-Otto},
  year={2015},
  publisher={de Gruyter}
}

With this, I get inline citations of the following format:

(3)

However, I want to add page number information inline since I am reference the same source multiple times. Therefore, I need something like this:

(3, p. 45)

I did not find any csl style with inline page numbers. Therefore: Is there any such style? I would prefer a numeric style as shown above but I also would like to know about any other style like

(Georgii 2015, p. 45)

  • Welcome to TeX.se. Can you complete your .Rmd document to show how you are citing the example entry? – Alan Munn Apr 7 at 18:18
  • Unfortunately I think this is really a CSL question rather than a TeX question. To answer the second part, however, using e.g. the apa.csl style, supports both prefix and suffix on the citation: [see @georgii2015stochastik, p. 45] will yield '(see Georgii, 2015, p. 45)' in the output. – Alan Munn Apr 7 at 18:31
  • Thanks, this works for me. I was not quite sure if this is the right stack exchange site. But since it says "TeX - LaTeX is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems, people who love to create well-structured and beautifully typeset documents." I thought it is OK to ask the question here. Do you think there is a better place to ask CSL questions on SE? – nunberg Apr 7 at 18:52
  • I really don't know, and googling mainly turns up pandoc questions here, which we're usually happy to answer if they involve the TeX side of things. The same is true for RMarkdown questions. I'll turn my comment into an answer anyway, though. Maybe someone else will have more information to add. – Alan Munn Apr 7 at 19:00
  • 1
    @Mico :) Yeah, the APA is evil in that respect by sentence casing everything. I've updated the answer. – Alan Munn Apr 7 at 19:28
3

Markdown certainly supports pre- and post-citation material. I suspect that this is more common in author/year type citation schemes, so perhaps the numeric schemes don't implement it. For example if I change your style to apa.csl then the following example works fine.

As Mico notes in the comments, to prevent styles from changing the capitalization on German nouns, you should enclose any non-initial noun in braces in the .bib file. The APA style is notorious for turning all titles into sentence case, which wreaks havoc on German.

@book{georgii2015stochastik,
  title={Stochastik: Einf{\"u}hrung in die {Wahrscheinlichkeitstheorie} und {Statistik}},
  author={Georgii, Hans-Otto},
  year={2015},
  publisher={de Gruyter}
}

---
title: "mytitle"
author: "nunberg"
date: '01\.01\.2019'
output:
  pdf_document: default
  html_document: default
bibliography: refs.bib
csl: vancouver.csl
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# A Header
Here I want to cite [see @georgii2015stochastik, p.45]

End of the report

output of code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.