MendeleyExportToolR6 | R Documentation |
Rmarkdown documents use BibTeX files to include literature references. BibTeX files are ordinary text files conaining the literature reference records in a pre-defined format. BibTeX files can either be created manually, but for larger documents the manual creation and maintenance of BibTeX files becomes untractable. This can be remedied by using a reference manager such as Mendeley. Literature references can be exported automatically from Mendeley into BibTeX files. The exported BibTeX records go either to a given directory or to a specified file. The main purpose of this tool is to read the exported BibTeX file from Mendeley and collect them into a local BibTeX file.
MendeleyExportToolR6$new()
Object of R6Class
to bridge the exported BibTeX references
exported by Mendeley to be used in a RMarkdown document
new(ps_men_export_dir, ps_local_bib_dir)
Instantiation-Constructor method
add(ps_new_ref, pb_is_rstudio_available)
Add a new reference with the key ps_new_ref
set_mendeley_export_dir(ps_men_export_dir)
Setter for s_men_export_dir
get_mendeley_export_dir()
Getter for s_men_export_dir
set_local_bib_file(ps_local_bib_file)
Setter for s_local_bib_file
get_local_bib_file()
Getter for s_local_bib_file
set_this_rmd_file(ps_this_rmd_file)
Setter for s_this_rmd_file
get_this_rmd_file()
Getter for s_this_rmd_file
get_bib_from_mendeley_export(ps_new_ref)
Get BibTeX record based on citation key ps_new_ref
write_local_bib(pvec_bib_new_ref)
Adding pvec_bib_new_ref BibTeX record to the local bibliography file
convert_add_to_ref(ps_new_ref)
Convert the add() statement to the Rmarkdown reference
get_rmd_ref(ps_new_ref)
Get Rmarkdown reference from citation key ps_new_ref
s_men_export_dir
directory where mendeley exports its BibTeX records
s_local_bib_file
name of local BibTeX file
s_this_rmd_file
full path to current Rmarkdown source document
s_men_export_dir
directory where mendeley exports its BibTeX records
s_local_bib_file
name of local BibTeX file
s_this_rmd_file
full path to current Rmarkdown source document
new()
MendeleyExportToolR6$new( ps_men_export_dir = getOption("rmdhelp.mendeley.export.dir"), ps_local_bib_file = "bibliography.bib", ps_this_rmd_file = ifelse(rstudioapi::isAvailable(), rstudioapi::getActiveDocumentContext()$path, whereami::thisfile()) )
set_mendeley_export_dir()
MendeleyExportToolR6$set_mendeley_export_dir(ps_men_export_dir)
get_mendeley_export_dir()
MendeleyExportToolR6$get_mendeley_export_dir()
set_local_bib_file()
MendeleyExportToolR6$set_local_bib_file(ps_local_bib_file)
get_local_bib_file()
MendeleyExportToolR6$get_local_bib_file()
set_this_rmd_file()
MendeleyExportToolR6$set_this_rmd_file(ps_this_rmd_file)
get_this_rmd_file()
MendeleyExportToolR6$get_this_rmd_file()
add()
MendeleyExportToolR6$add( ps_new_ref, pb_is_rstudio_available = rstudioapi::isAvailable() )
clone()
The objects of this class are cloneable with this method.
MendeleyExportToolR6$clone(deep = FALSE)
deep
Whether to make a deep clone.
## Not run:
# instantiate a new MendeleyExportTool object
met <- rmdhelp::MendeleyExportToolR6$new()
# setting the current rmd-file
met$set_this_rmd_file(ps_this_rmd_file = ifelse(rstudioapi::isAvailable(),
rstudioapi::getActiveDocumentContext()$path,
whereami::thisfile()))
# check whether mendeley export dir exists
met$exists_mendeley_export_dir()
# add a new reference to the local BibTeX file
met$add("Phocas1998")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.