Title: | Toolbox to Handle BibTeX Files |
---|---|
Description: | Imports, cleans, and exports BibTeX references exported by references management softwares (e.g. Mendeley, Zotero). |
Authors: | Nicolas Casajus [aut, cre, cph] |
Maintainer: | Nicolas Casajus <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.0.1 |
Built: | 2024-11-17 05:41:01 UTC |
Source: | https://github.com/FRBCesab/rbibtools |
Imports .bib
files and cleans BibTeX references using the function
bib2df::bib2df()
.
read_bib( path = ".", tags = c("bibtexkey", "category", "author", "title", "year", "volume", "booktitle", "editor", "journal", "pages", "institution", "publisher", "doi", "url", "abstract", "keywords", "annote"), categories = NULL, pattern = NULL )
read_bib( path = ".", tags = c("bibtexkey", "category", "author", "title", "year", "volume", "booktitle", "editor", "journal", "pages", "institution", "publisher", "doi", "url", "abstract", "keywords", "annote"), categories = NULL, pattern = NULL )
path |
a character of length 1. The name of the folder containing
|
tags |
a vector of characters. BibTeX fields to extract
(e.g. |
categories |
(optional) a vector of characters. Publications categories
to import (e.g. |
pattern |
(optional) a vector of characters. This argument is used to
select |
Valid tags
values:
category
: type of publication
bibtexkey
: unique identifier of the publication
annote
: user annotations
author
: authors names
booktitle
: title of the book
chapter
: chapter number (for book chapter)
crossref
: Crossref identifier
edition
: edition number
editor
: editors names
institution
: institution name (for thesis and report)
journal
: journal name (for scientific article)
month
: month of the date of publication
number
: issue number
pages
: pages range or pages number or article number
publisher
: publisher name (i.e. Elsevier, etc.)
series
: series name
title
: title of the publication
volume
: volume number
year
: year of the date of publication
doi
: DOI (without https://doi.org/)
abstract
: abstract of the publications
keywords
: authors keywords
url
: URL of the only publication
isbn
: ISSN identifier of the book/journal
pmid
: PMID identifier
Valid categories
values:
article
: scientific paper
book
: book
incollection
: book chapter
inproceedings
: proceeding article
phdthesis
: PhD thesis
techreport
: technical report
A data.frame
with references fields in columns and references in
rows.
path_to_bibs <- system.file("extdata", package = "rbibtools") refs <- read_bib(path = path_to_bibs)
path_to_bibs <- system.file("extdata", package = "rbibtools") refs <- read_bib(path = path_to_bibs)
Converts common LaTeX/BiBTeX escaped characters into UTF-8 encoding. For
instance, {'{e}}
will be translated in é
.
replace_tex_tags(x)
replace_tex_tags(x)
x |
a vector of characters in which common LaTeX/BiBTeX escaped characters must be converted. |
A vector of characters.
replace_tex_tags("H{\\'{e}}t{\\'{e}}rog{\\'{e}}n{\\'{e}}it{\\'{e}}") replace_tex_tags(c("Mon c{\\oe}ur", "El Ni{\\~{n}}o"))
replace_tex_tags("H{\\'{e}}t{\\'{e}}rog{\\'{e}}n{\\'{e}}it{\\'{e}}") replace_tex_tags(c("Mon c{\\oe}ur", "El Ni{\\~{n}}o"))
Create a bib file from a data.frame
write_bib(data, file = "", append = FALSE)
write_bib(data, file = "", append = FALSE)
data |
a |
file |
a |
append |
a |
No returned value.
## Import .bib file(s) ---- path_to_bibs <- system.file("extdata", package = "rbibtools") refs <- rbibtools::read_bib(path = path_to_bibs) ## Export data.frame to .bib files ---- filename <- tempfile() rbibtools::write_bib(refs, filename)
## Import .bib file(s) ---- path_to_bibs <- system.file("extdata", package = "rbibtools") refs <- rbibtools::read_bib(path = path_to_bibs) ## Export data.frame to .bib files ---- filename <- tempfile() rbibtools::write_bib(refs, filename)