Closed amarakon closed 2 years ago
Please provide a full reproducible example every time you file a Github issue to report a problem here. It's hard for us to help you without a reproducible example. I tried to create a new site and add the citation. It worked fine for me:
The source code is on GitHub. And my website is at https://amarakon.github.io/amarakon.com.
Try cloning my repository and changing one of my blog posts to include this code block:
```{r pie, fig.cap = "Operating system market share [@desktop-os-marketshare]", dev = 'svglite'}
slices <- c(74.83, 15.37, 4.93, 2.48, 2.38)
lbls <- c("Windows", "macOS", "Unknown", "Linux", "Chrome OS")
pct <- round(slices/sum(slices)*100)
lbls <- paste(lbls, pct) # add percents to labels
lbls <- paste(lbls,"%",sep="") # ad % to labels
pie(slices, labels = lbls, col = rainbow(length(lbls)))
Next time it will be much better if you could provide an example directly instead of providing instructions. The example could be a Git branch. With your instructions, I had to do a few extra things:
knitr::opts_chunk
instead of opts_chunk
).static/bibliography.bib
seems to have a syntax error somewhere. I had to delete all entries in it but keep one (for testing purpose).Anyway, I'm able to reproduce the problem now. Unfortunately, this is not easy to fix and it's unlikely to be fixed. You have three possible options:
link-citations: true
: https://github.com/amarakon/amarakon.com/blob/2dfb0f5fd94c5a598d34147b9d73493dc5a9792d/content/blog/2022-05-05-gentoo-linux-should-be-approved-by-the-free-software-foundation/index.Rmd#L11blogdown.method = 'markdown'
: https://github.com/amarakon/amarakon.com/blob/2dfb0f5fd94c5a598d34147b9d73493dc5a9792d/.Rprofile#L21The reason I set opts_chunk
instead of knitr::opts_chunk
is that I already set library (knitr)
in /usr/lib64/R/etc/Rprofile.site
. Should I change it to make it work for everybody?
Also, I fixed this issue by setting blogdown.method = 'html'
. Thanks.
I already set
library (knitr)
in/usr/lib64/R/etc/Rprofile.site
. Should I change it to make it work for everybody?
I strongly recommend that you do not touch Rrofile.site
, because it will be wiped out the next time you upgrade R, and it's not good for reproducibility (because other people don't have access to your system file). If you need to do anything during R startup, it is better to use .Rprofile
or ~/.Rprofile
instead.
Anyway, good to know you fixed the issue with the third option!
Thanks, I will switch to ~/.Rprofile and change opts_chunk
to knitr::opts_chunk
.
I have this code block:
The citation
[@desktop-os-marketshare]
works outside of figure captions. Here is what it looks like in a figure caption.Here is the output of
xfun::session_info("blogdown")
:Here is the output of
blogdown::check_site()
: