在blogdown中使用Rmd文件无法通过BibTeX引用文献求助
I’ve run into this exact issue before—let’s walk through the most likely fixes step by step:
1. Verify the BibTeX Entry ID Matches Your Citation
First, open your si.bib file and check the entry’s ID. Google Scholar generates default IDs like casella2002statistical (based on author, year, and title) instead of si. If your bib entry looks like this:
@book{casella2002statistical, title={Statistical Inference}, author={Casella, G. and Berger, R.L.}, year={2002}, publisher={Duxbury Press} }
Then you need to either:
- Rename the ID to
si(changecasella2002statisticaltosiin the bib file), or - Update your Rmd citation to use the correct ID:
@casella2002statistical
2. Ensure Your Rmd Uses Pandoc-Compatible Output Settings
Some Hugo themes bypass Pandoc’s citation processing. Explicitly set your output format to blogdown::html_page in the YAML to force Pandoc to handle references, and remove the manual # Reference header (Pandoc will auto-generate the references list):
--- title: cite something author: '' date: '2018-05-17' slug: cite-something categories: [] tags: [] bibliography: si.bib link-citations: true output: blogdown::html_page: toc: false ---
Optional: Add a csl field (e.g., csl: apa.csl) if you want to use a specific citation style—just download the CSL file and place it in the same directory as your Rmd.
3. Confirm the Bib File Path is Correct
Double-check that si.bib is in the same /content/post directory as your Rmd. If the path is off, Pandoc can’t find the bib file and will display @si as plain text. You can test an absolute path temporarily to rule this out:
bibliography: /content/post/si.bib
4. Rebuild the Entire Site
Partial Rmd renders sometimes don’t pick up citation changes. Run this in your R console to regenerate the full site:
blogdown::build_site()
After making these adjustments, your citation should render properly, and a formatted references section will appear at the bottom of your post.
内容的提问来源于stack exchange,提问作者Han Chen

