Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Citations... #358

Open
chriscastille6 opened this issue Jan 21, 2019 · 14 comments

Comments

@chriscastille6
Copy link

@chriscastille6 chriscastille6 commented Jan 21, 2019

I have followed the guidance for inserting citations, but neither the citations or the references are printed.

I'm currently using RMarkdown to write entries into my blog and the most recent version of hugo (0.53) and the academic theme. Has anyone else had this problem or resolved it?

@yihui

This comment has been minimized.

Copy link
Member

@yihui yihui commented Jan 21, 2019

@chriscastille6

This comment has been minimized.

Copy link
Author

@chriscastille6 chriscastille6 commented Jan 21, 2019

Will this work?

My YAML header is:

`---
title: What can open science learn from how we fight pollution?
author: Chris
date: '2019-01-13'
slug: what-can-open-science-learn-from-how-we-fight-pollution
categories:

  • open science
    tags:
  • Open science
    image:
    caption: ''
    focal_point: ''
    bibliography: [/Users/chriscastille/Documents/GitHub/Website/references.bib]
    link-citations: TRUE
    bilbio-style: "apalike"
    ---`

Here is an excerpt from the post I'm trying to fix:

`Which helps to make a point: the government can take care of this mess. Of the many proposals that can be discussed, I'm particularly interested in incentives to institutions and researchers for making their work essentially "born open" [see @rouderWhatWhyHow2016].

library(papaja)
r_refs(file = "/Users/chriscastille/Documents/GitHub/Website/references.bib")

`

My bib file contains this reference:

}
@Article{rouderWhatWhyHow2016,
title = {The What, Why, and How of Born-Open Data},
volume = {48},
issn = {1554-3528},
doi = {10.3758/s13428-015-0630-z},
language = {en},
number = {3},
journal = {Behavior Research Methods},
author = {Jeffrey N. Rouder},
month = {sep},
year = {2016},
pages = {1062-1069},
file = {/Users/chriscastille/Zotero/storage/JRHT7B9U/rouder2015.pdf;/Users/chriscastille/Zotero/storage/SCNJSG6F/Rouder - 2016 - The what, why, and how of born-open data.pdf},
}

@yihui

This comment has been minimized.

Copy link
Member

@yihui yihui commented Jan 21, 2019

  1. Please read the Github issue template carefully when you file an issue to make sure your issue is correct formatted (in particular, please check out the four-backtick rule).

  2. Could you provide an example that I can just run instead of putting all the pieces together by myself? Thanks!

BTW, I don't which guidance you followed, but @apreshill has prepared one in 2017: https://blogdown-demo.rbind.io/2017/08/28/adding-citations-to-posts/

@yihui yihui added this to the v0.11 milestone Jan 21, 2019
@apreshill

This comment has been minimized.

Copy link
Member

@apreshill apreshill commented Jan 22, 2019

Hi @chriscastille6,

I'm guessing your issues relate to file paths, as you are using absolute paths and blogdown/Hugo expect project-oriented relative file paths (which is illustrated in the post @yihui linked to). Also, it looks like you are trying to use an additional package, papaja, which I don't know how that bibliography function works. I would recommend you try following the blog post and not using papaja. If you need further help, have you heard of community.rstudio.com? That site is more appropriate for help requests, and for initial help with debugging if indeed you run into a bug. You could ask for help in the R Markdown category and tag it with blogdown: https://community.rstudio.com/tags/c/R-Markdown/blogdown. They will also ask you to provide a reproducible example.

Alison

@apreshill

This comment has been minimized.

Copy link
Member

@apreshill apreshill commented Feb 8, 2019

Just to complete this circle, I believe this thread on community is the same issue posted here. I responded there:
https://community.rstudio.com/t/inserting-citations-and-blogdown/22556/2

@apreshill

This comment has been minimized.

Copy link
Member

@apreshill apreshill commented Feb 20, 2019

Update: this issue only happens with .Rmarkdown files...
https://community.rstudio.com/t/inserting-citations-and-blogdown/22556/4

Here is a sample post:

---
title: open science post Rmd
author: ''
date: '2019-02-20'
slug: open-science-post-rmd
categories: []
tags: []
image:
  caption: ''
  focal_point: ''
bibliography: [one.bib]
link-citations: TRUE
biblio-style: "apalike"
nocite: '@*'
---
some stuff here

This is the sample .Rmarkdown post rendered:
https://chriscastille.netlify.com/post/open-science-post/

This is the same .Rmd post rendered:
https://chriscastille.netlify.com/post/open-science-post-rmd/

Repo here:
https://github.com/apreshill/website-1

@yihui

This comment has been minimized.

Copy link
Member

@yihui yihui commented Feb 20, 2019

That is expected. .Rmarkdown is compiled to .markdown, which is processed by Hugo (BlackFriday), which doesn't support bibliography. .Rmd is processed by Pandoc, which does support bibliography.

https://bookdown.org/yihui/blogdown/output-format.html

@tcgriffith

This comment has been minimized.

Copy link
Collaborator

@tcgriffith tcgriffith commented Feb 21, 2019

That is expected. .Rmarkdown is compiled to .markdown, which is processed by Hugo (BlackFriday), which doesn't support bibliography. .Rmd is processed by Pandoc, which does support bibliography.

https://bookdown.org/yihui/blogdown/output-format.html

I feel that on that page, there's a need to make it more plain& clear to the users regarding the differences among rmd/rmarkdown/md

something like a table will do:

options Rmd Rmarkdown md
bibliography yes no no
run r code yes yes no
task list no yes yes
mathjax yes no yes
html widgets yes no no
@apreshill

This comment has been minimized.

Copy link
Member

@apreshill apreshill commented Feb 21, 2019

I would tend to agree- and I would add that you can also get a Hugo respected table of contents with Rmarkdown but not Rmd.

@tcgriffith

This comment has been minimized.

Copy link
Collaborator

@tcgriffith tcgriffith commented Feb 21, 2019

I remember that TOC is supported in pandoc(therefore Rmd), no?

@apreshill

This comment has been minimized.

Copy link
Member

@apreshill apreshill commented Feb 21, 2019

@tcgriffith

This comment has been minimized.

Copy link
Collaborator

@tcgriffith tcgriffith commented Feb 21, 2019

That hurts, I wish for a hero who could combine pandoc and Hugo together so that all hassles can be solved.
And world peace, I wish for that too.

@yihui

This comment has been minimized.

Copy link
Member

@yihui yihui commented Feb 21, 2019

We just need a JS hacker for the TOC issue. I don't think it is too complicated.

@chriscastille6

This comment has been minimized.

Copy link
Author

@chriscastille6 chriscastille6 commented Mar 10, 2019

Thanks for your help, folks! I think I have figured it out now!

@yihui yihui removed this from the v0.11 milestone Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.