Comments (2)
@michaelaklin thanks for the report.
I've tested it out and can confirm an issue with the StackOverflow suggestion. However, bibtex
does not have a custom print style for citations. Instead, bibtex
interprets the bibliography file and places it into the bibentry
class, which is part of the utils
package.
Thus, I think you can fix the issue by switching from:
`r capture.output(refs["BusemeyerTober2022"])`
to
`r format(refs["BusemeyerTober2022"], style = "text")`
Note, we're using the utils:::format.bibentry(entry, style = "text")
to correctly set the output display.
For completeness, please feel free to see the reprex
.
Debug RMD file
---
title: "Debug Commas"
author: "JJB"
output: html_document
---
```{r}
library("bibtex")
my_ref <- "@article{BusemeyerTober2022,
author = {Marius R. Busemeyer and Tobias Tober},
journal = {Comparative Political Studies},
pages = {00104140221139381},
title = {Dealing with Technological Change: Social Policy Preferences and Institutional Context},
year = {2022}}"
# Need to check by writing first
tmp1 <- tempfile(fileext = ".bib")
writeLines(my_ref, tmp1)
# And reading from the temp file
out <- read.bib(tmp1)
```
```{r}
out["BusemeyerTober2022"]
```
## Capture Output
`r capture.output(out["BusemeyerTober2022"])`
## Format Output
`r format(out["BusemeyerTober2022"], style = "text")`
Please let me know if this works and I'll close out the ticket.
from bibtex.
Wonderful, this works like a charm. Thanks a lot!
from bibtex.
Related Issues (20)
- caught segfault read.bib() - macOS 10.14.6 HOT 6
- merge changes from Brian Ripley HOT 1
- ASCII turned into non-ASCII HOT 3
- Orphaned on CRAN HOT 16
- rchk issues HOT 2
- Difficulty loading bibtex in R Studio
- Parse single entry from string HOT 4
- GSOC 2021 R project HOT 2
- DONT WRITE BACK TO YOUR BIBTEX-FILE: custom fields are imported with column-names that includes the values in the fields...!! HOT 5
- write.bib chooses the wrong citation, and doesn't warn that there was an option HOT 3
- Development environment of contributors? HOT 1
- Unable to recover after encountering two consecutive TOKEN_LBRACE "{"
- `write.bib` does not write UTF-8 characters properly HOT 1
- Proposal: Improving the package HOT 6
- oldrel testthat snapshot differences
- Issue with "\\}$" HOT 2
- Replace as.personList(authors) with do.call(c, authors)
- Importing bibtex to Zotero classifies citation as "Book" HOT 2
- Direct import into EndNote is not possible HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bibtex.