knitr::opts_chunk$set( collapse = TRUE, comment = "" ) # Load the table of tables p2file <- system.file("extdata/crosswalk_tables.csv", package = "cffr") table_master <- read.csv(p2file)
This article was reviewed and updated in 2024, along with the release of cffr v1.0.0.
Please cite this article using this BibTeX entry:
@article{hernangomez2022, title = {{BibTeX} and {CFF}, a potential crosswalk}, author = {Diego Hernangómez}, year = 2022, journal = {The {cffr} package}, volume = {Vignettes}, doi = {10.21105/joss.03900}, url = {https://docs.ropensci.org/cffr/articles/bibtex_cff.html} }
BibTeX is a well-known format for storing references created by Oren Patashnik and Leslie Lamport back in 1985. BibTeX can be reused by other software, such as LaTeX, to add references to scholarly works. An example structure of a BibTeX entry would be:
@book{einstein1921, title = {Relativity: The Special and the General Theory}, author = {Einstein, A.}, year = 1920, publisher = {Henry Holt and Company}, address = {London, United Kingdom}, isbn = 9781587340925 }
In this case, the entry (identified as einstein1921
) refers to a book. This
entry can then be used in a document to include references to it. In R
[@R_2021], we can replicate this structure using the bibentry()
and
toBibtex()
functions:
entry <- bibentry("book", key = "einstein1921", title = "Relativity: The Special and the General Theory", author = person("A.", "Einstein"), year = 1920, publisher = "Henry Holt and Company", address = "London, United Kingdom", isbn = 9781587340925, ) toBibtex(entry)
The final results of the entry as a text string would be coerced as[^1]:
[^1]: By default R Pandoc would generate the cite on the Chicago author-date format [@rmarkdowncookbook2020]
entry
Additionally, the cffr package [@hernangomez2021] incorporates the following capabilities that can be used to read and transform BibTeX format into different formats:
cff_read_bib()
reads *.bib files.cff_read_bib_text()
can read BibTeX entries that are already stored in
a variable.toBibtex.cff()
that converts from cff
objects to Bibtex
objects (see utils::toBibtex()
).string <- "@book{einstein1921, title = {Relativity: The Special and the General Theory}, author = {Einstein, A.}, year = 1920, publisher = {Henry Holt and Company}, address = {London, United Kingdom}, isbn = 9781587340925}" # To cff library(cffr) cff_format <- cff_read_bib_text(string) cff_format # To BibTeX with S3 method toBibtex(cff_format)
@patashnik1988 provides a comprehensive explanation of the BibTeX formats. Let's distinguish between Entries and Fields.
Each entry type defines a different type of work. The 14 entry types defined in BibTeX are:
Other implementations similar to BibTeX, such as BibLaTeX [@biblatexpack], expand the definitions of entries to include other types such as online resources, software, or datasets. In BibTeX, these entries should be reclassified as \@misc.
In R, the bibentry()
base function does not implement \@conference.
However, we can use \@inproceedings, instead given that the definition is
identical.
Similar to the Entries, @patashnik1988 also provides definitions for each of the possible standard BibTeX fields. While an entry must include certain required fields, it can also include additional fields that might be ignored in the raw implementation of BibTeX. Let's explore some of these fields:
"Second"
. The
ordinal should have the first letter capitalized; standard styles convert to
lowercase when necessary.jan
, feb
, mar
) as described in Appendix B.1.3
of the LaTeX book [@lamport86latex].42--111
or 7,41,73--97
or 43+
).1984
).As in the case of the Entries, other implementations such as BibLaTeX recognize additional fields.
In BibTeX, there exists a strict relationship between Entries and Fields. Depending on the type of entry, certain fields are required, while others are optional or even ignored.
The following table summarizes the relationship between Entries and Fields in BibTeX. Required fields are flagged as x, and optional fields are flagged as o. For more detailed information, refer to @patashnik1988.
df_table <- table_master[table_master$table == "entry_fields", -1] nms <- c( "**field**", "**\\@article**", "**\\@book**", "**\\@booklet**", "**\\@inbook**", "**\\@incollection**", "**\\@conference, \\@inproceedings**", "**\\@manual**", "**\\@mastersthesis, phdthesis**", "**\\@misc**", "**\\@proceedings**", "**\\@techreport**", "**\\@unpublished**" ) df_table[is.na(df_table)] <- "" row.names(df_table) <- NULL t1 <- df_table[, c(1:7)] nm1 <- nms[1:7] knitr::kable(t1, col.names = nm1, row.names = NA, align = c("l", rep("c", 6)), caption = "**BibTeX**, required fields by entry" )
t2 <- df_table[, c(1, 8:13)] nm2 <- nms[c(1, 8:13)] knitr::kable(t2, col.names = nm2, row.names = NA, align = c("l", rep("c", 6)), caption = "(cont) **BibTeX**, required fields by entry" )
It can be seen that only a subset of fields is necessary for any entry. For instance, title, year, and author are either required or optional in almost every entry, whereas crossref, annote, or key are never mandatory.
Citation File Format (CFF)
[@druskat_citation_2021] consists of plain text files containing both human- and
machine-readable citation information for software and datasets. Within
[CFF]{.underline}, there are two important keys: preferred-citation
and
references
, which play a crucial role in citing and referring to related
works:
preferred-citation
: Refers to another work that should be cited instead of
the software or dataset itself.references
: Includes reference(s) to other creative works related to the
software or dataset. Similar to a list of references in a scholarly paper,
these references may encompass papers describing the abstract concepts of
the software or algorithms implemented in the software version.These two keys are expected to be definition.reference objects
, as defined in
the Guide to Citation File Format schema version
1.2.0,
and they may contain the following keys:
library(cffr) # Fill with whites init <- paste0("[", cff_schema_definitions_refs(), "]{.underline}") l <- c(init, rep("", 4)) refkeys <- matrix(l, ncol = 5, byrow = TRUE) knitr::kable(refkeys, row.names = NA, caption = "Valid keys on [CFF]{underline} `definition-reference` objects" )
These keys are equivalent to the BibTeX fields, with the exception of the key [type]{.underline}. In [CFF]{.underline}, this key defines the type of work[^2], making it analogous to the BibTeX entries.
[^2]: See a complete list of possible values of [CFF]{.underline} [type]{.underline} in Appendix B.
The cffr package [@hernangomez2021] provides utilities for converting
BibTeX entries (via the R base function bibentry()
) to
[CFF]{.underline} files and vice versa. This section describes how the
conversion between both formats has been implemented. The crosswalk is partially
based on @Haines_Ruby_CFF_Library_2021[^3].
[^3]: Note that this software performs only the conversion from [CFF]{.underline} to BibTeX, however cffr can perform the conversion in both directions.
In the following two sections, I present an overview of the proposed mapping between the Entries and Fields of BibTeX and the [CFF]{.underline} keys. After this initial mapping, I propose further transformations to enhance compatibility between both systems using different Entry Models.
For better clarity, when a field is in bold (e.g., \@book, edition), it corresponds to BibTeX, and when the field is [underlined]{.underline} (e.g., [book, edition]{.underline}), it corresponds to [CFF]{.underline}.
For converting general BibTeX entries to [CFF]{.underline} [types]{.underline}, the following crosswalk is proposed:
df_table <- table_master[table_master$table == "entry_bib2cff", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX** Entry", "[**CFF key: type**]{.underline}", "Notes"), row.names = NA, caption = "Entry/Type crosswalk: From **BibTeX** to [CFF]{.underline}" )
The previous crosswalk has the following specifications:
type:book
and
collection-type: book
, we may utilize a combination of these fields to tag
each entry type in [CFF]{.underline} accordingly.type:thesis
and thesis-type
.[^4]: Note that BibLaTeX [@biblatexpack] handles \@inbook differently, see Appendix A.
Additionally, considering that [CFF]{.underline} allows for a wide range of values[^5] for the [type]{.underline} field, the following conversion would be applied from [CFF]{.underline} to BibTeX:
[^5]: See Appendix B for all possible values. Information extracted from @druskat2019.
df_table <- table_master[table_master$table == "entry_cff2bib", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("[**CFF key: type**]{.underline}", "**BibTeX** Entry", "Notes"), caption = "Entry/Type crosswalk: From [CFF]{.underline} to **BibTeX**" )
There is a significant similarity between the definitions and names of certain BibTeX fields and [CFF]{.underline} keys. While the equivalence is straightforward in some cases, there are instances where certain keys need to be processed depending on the entry type.
df_table <- table_master[table_master$table == "fields_bib2cff", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX Field**", "[CFF key]{.underline}", "Notes"), caption = "**BibTeX** - [CFF]{.underline} Field/Key crosswalk" )
We provide more detail on some of the mappings presented in the table above:
Some fields are not mapped because there is no clear equivalence with [CFF]{.underline} keys (such as annote, crossref, and key). Regarding the type field, the [CFF]{.underline} key [type]{.underline} corresponds to the identifier of the work (similar to an entry in BibTeX), therefore, BibTeX type won't be mapped. These fields are always optional in BibTeX.
For the address field, its intended use in BibTeX varies depending on the entry type (e.g., for \@inproceedings, it denotes the address of the conference, while for \@mastersthesis/\@phdthesis, is the address of the school, etc.). Mapping between BibTeX and [CFF]{.underline} becomes more complex when related to institutions, resulting in varying final mappings in [CFF]{.underline}. When converting from [CFF]{.underline} to BibTeX, we propose to follow the same entry-based logic, using the key [location]{.underline} as a fallback value when converting to address.
In relation with this complexity mentioned above, institution, organization and school would be mapped to [institution]{.underline}.
series would be mapped to [collection-title]{.underline} only on those entries that does not requires booktitle. In practice, this means that collection-title would correspond to booktitle for incollection and inproceedings, and in the rest of cases it would correspond to series. A consequence of this is that series information would be lost for incollection and inproceedings, but on those cases is an optional field.
Regarding series, it would be mapped to [collection-title]{.underline} only for those entries that do not require booktitle. In practice, this means that [collection-title]{.underline} would correspond to booktitle for \@incollection and \@inproceedings, while in other cases it would correspond to series. As a consequence, series information would be lost for \@incollection and \@inproceedings, but in those cases, it is an optional field.
When converting from [CFF]{.underline} to BibTeX, we propose to use [date-published]{.underline} as a fallback for extracting month and year fields.
When pages is provided as a range separated by --
, i.e, pages =
{3--5} would be coerced as [start: 3]{.underline}, [end: 5]{.underline} in
[CFF]{.underline}.
Additionally, there are other [CFF]{.underline} keys that correspond to BibLaTeX fields. We propose to include these fields in the crosswalk[^6], even though they are not part of the core BibTeX fields definition.
[^6]: See @biblatexcheatsheet for a preview of the accepted BibLaTeX fields.
df_table <- table_master[table_master$table == "fields_biblatex2cff", c(2:3)] df_table[is.na(df_table)] <- "" # fix links df_table$f2 <- gsub("link_to_entry_models", "#entrymodels", df_table$f2) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibLaTeX Field**", "[CFF key]{.underline}"), caption = "**BibLaTeX** - [CFF]{.underline} Field/Key crosswalk" )
This section presents the specific mapping proposed for each of the BibTeX entries, providing further information on how each field is treated. Examples are adapted from the xampl.bib file provided with the bibtex package [@patashnik].
The crosswalk of \@article does not require any special treatment.
df_table <- table_master[table_master$table == "model_article", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) df_table$f3 <- gsub("link_to_article", "#article", df_table$f3) df_table$f3 <- gsub("link_to_booklet", "#booklet", df_table$f3) df_table$f3 <- gsub("link_to_book", "#book-inbook", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX**", "[CFF]{.underline}", "Notes"), caption = "**\\@article** Model" )
Examples
BibTeX entry
@article{article-full, title = {The Gnats and Gnus Document Preparation System}, author = {Leslie A. Aamport}, year = 1986, month = jul, journal = {{G-Animal's} Journal}, volume = 41, number = 7, pages = {73+}, note = {This is a full ARTICLE entry} }
[CFF entry]{.underline}
bib <- "@article{article-full, title = {The Gnats and Gnus Document Preparation System}, author = {Leslie A. Aamport}, year = 1986, month = jul, journal = {{G-Animal's} Journal}, volume = 41, number = 7, pages = {73+}, note = {This is a full ARTICLE entry}}" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
In terms of the fields required in BibTeX, the primary difference between \@book and \@inbook is that \@inbook requires a chapter or page field, while \@book does not even allow these fields as optional. Therefore, we propose that an \@inbook entry in [CFF]{.underline} be treated as a \@book with the following supplementary fields:
Additionally, note that in [CFF]{.underline}, the series field corresponds to [collection-title]{.underline}, and the address field represents the [publisher]{.underline}'s [address]{.underline}. By last, the key [collection-type]{.underline} would be populated with [book-series]{.underline}.
df_table <- table_master[table_master$table == "model_book", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) df_table$f3 <- gsub("link_to_article", "#article", df_table$f3) df_table$f3 <- gsub("link_to_booklet", "#booklet", df_table$f3) df_table$f3 <- gsub("link_to_book", "#book-inbook", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX**", "[CFF]{.underline}", "Notes"), caption = "**\\@book / \\@inbook** Model" )
There are notable differences in how BibTeX and BibLaTeX handle the \@inbook entry (further discussed in the Appendix A). We propose to treat a BibLaTeX \@inbook as a BibTeX \@incollection.
Examples: \@book
BibTeX entry
@book{book-full, title = {Seminumerical Algorithms}, author = {Donald E. Knuth}, year = 1981, month = 10, publisher = {Addison-Wesley}, address = {Reading, Massachusetts}, series = {The Art of Computer Programming}, volume = 2, note = {This is a full BOOK entry}, edition = {Second} }
[CFF entry]{.underline}
bib <- "@book{book-full, title = {Seminumerical Algorithms}, author = {Donald E. Knuth}, year = 1981, month = 10, publisher = {Addison-Wesley}, address = {Reading, Massachusetts}, series = {The Art of Computer Programming}, volume = 2, note = {This is a full BOOK entry}, edition = {Second} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
Examples: \@inbook
BibTeX entry
@inbook{inbook-full, title = {Fundamental Algorithms}, author = {Donald E. Knuth}, year = 1973, month = 10, publisher = {Addison-Wesley}, address = {Reading, Massachusetts}, series = {The Art of Computer Programming}, volume = 1, pages = {10--119}, note = {This is a full INBOOK entry}, edition = {Second}, type = {Section}, chapter = {1.2} }
[CFF entry]{.underline}
bib <- "@inbook{inbook-full, title = {Fundamental Algorithms}, author = {Donald E. Knuth}, year = 1973, month = 10, publisher = {Addison-Wesley}, address = {Reading, Massachusetts}, series = {The Art of Computer Programming}, volume = 1, pages = {10--119}, note = {This is a full INBOOK entry}, edition = {Second}, type = {Section}, chapter = {1.2} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
In \@booklet address is mapped to [location]{.underline}.
df_table <- table_master[table_master$table == "model_booklet", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) df_table$f3 <- gsub("link_to_article", "#article", df_table$f3) df_table$f3 <- gsub("link_to_booklet", "#booklet", df_table$f3) df_table$f3 <- gsub("link_to_book", "#book-inbook", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX**", "[CFF]{.underline}", "Notes"), caption = "**\\@booklet** Model" )
Examples
BibTeX entry
@booklet{booklet-full, title = {The Programming of Computer Art}, author = {Jill C. Knvth}, date = {1988-03-14}, month = feb, address = {Stanford, California}, note = {This is a full BOOKLET entry}, howpublished = {Vernier Art Center} }
[CFF entry]{.underline}
bib <- "@booklet{booklet-full, title = {The Programming of Computer Art}, author = {Jill C. Knvth}, date = {1988-03-14}, month = feb, address = {Stanford, California}, note = {This is a full BOOKLET entry}, howpublished = {Vernier Art Center} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
Note that in this case, organization is mapped to [institution]{.underline}. Additionally, series would be ignored as there is not clear mapping on [CFF]{.underline} for this field.
df_table <- table_master[table_master$table == "model_inproceedings", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) df_table$f3 <- gsub("link_to_article", "#article", df_table$f3) df_table$f3 <- gsub("link_to_booklet", "#booklet", df_table$f3) df_table$f3 <- gsub("link_to_book", "#book-inbook", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX**", "[CFF]{.underline}", "Notes"), caption = "**\\@conference / \\@inproceedings** Model" )
Examples
BibTeX entry
@inproceedings{inproceedings-full, title = {On Notions of Information Transfer in {VLSI} Circuits}, author = {Alfred V. Oaho and Jeffrey D. Ullman and Mihalis Yannakakis}, year = 1983, month = mar, booktitle = {Proc. Fifteenth Annual ACM Symposium on the Theory of Computing}, publisher = {Academic Press}, address = {Boston}, series = {All ACM Conferences}, number = 17, pages = {133--139}, editor = {Wizard V. Oz and Mihalis Yannakakis}, organization = {The OX Association for Computing Machinery} }
[CFF entry]{.underline}
bib <- "@inproceedings{inproceedings-full, title = {On Notions of Information Transfer in {VLSI} Circuits}, author = {Alfred V. Oaho and Jeffrey D. Ullman and Mihalis Yannakakis}, year = 1983, month = mar, booktitle = {Proc. Fifteenth Annual ACM Symposium on the Theory of Computing}, publisher = {Academic Press}, address = {Boston}, series = {All ACM Conferences}, number = 17, pages = {133--139}, editor = {Wizard V. Oz and Mihalis Yannakakis}, organization = {The OX Association for Computing Machinery} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
As booktitle is a required field, we propose to map that field to [collection-title]{.underline} and the [type]{.underline} to [generic]{.underline}. Therefore, an \@incollection is a [type: generic]{.underline} with a [collection-title]{.underline} key.
Additionally, series and type would be ignored as there is not clear mapping on [CFF]{.underline} for this field.
df_table <- table_master[table_master$table == "model_incollection", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) df_table$f3 <- gsub("link_to_article", "#article", df_table$f3) df_table$f3 <- gsub("link_to_booklet", "#booklet", df_table$f3) df_table$f3 <- gsub("link_to_book", "#book-inbook", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX**", "[CFF]{.underline}", "Notes"), caption = "**\\@incollection** Model" )
Examples
BibTeX entry
@incollection{incollection-full, title = {Semigroups of Recurrences}, author = {Daniel D. Lincoll}, year = 1977, month = sep, booktitle = {High Speed Computer and Algorithm Organization}, publisher = {Academic Press}, address = {New York}, series = {Fast Computers}, number = 23, pages = {179--183}, note = {This is a full INCOLLECTION entry}, editor = {David J. Lipcoll and D. H. Lawrie and A. H. Sameh}, chapter = 3, type = {Part}, edition = {Third} }
[CFF entry]{.underline}
bib <- "@incollection{incollection-full, title = {Semigroups of Recurrences}, author = {Daniel D. Lincoll}, year = 1977, month = sep, booktitle = {High Speed Computer and Algorithm Organization}, publisher = {Academic Press}, address = {New York}, series = {Fast Computers}, number = 23, pages = {179--183}, note = {This is a full INCOLLECTION entry}, editor = {David J. Lipcoll and D. H. Lawrie and A. H. Sameh}, chapter = 3, type = {Part}, edition = {Third} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
As in the case of \@conference / \@inproceedings, organization is mapped to [institution]{.underline}.
df_table <- table_master[table_master$table == "model_manual", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) df_table$f3 <- gsub("link_to_article", "#article", df_table$f3) df_table$f3 <- gsub("link_to_booklet", "#booklet", df_table$f3) df_table$f3 <- gsub("link_to_book", "#book-inbook", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX**", "[CFF]{.underline}", "Notes"), caption = "**\\@manual** Model" )
Examples
BibTeX entry
Note that month can't be coerce to a single integer in the range 1--12
as
required on CFF, so it is ignored to avoid validation errors.
@manual{manual-full, title = {The Definitive Computer Manual}, author = {Larry Manmaker}, year = 1986, month = {apr-may}, address = {Silicon Valley}, note = {This is a full MANUAL entry}, organization = {Chips-R-Us}, edition = {Silver} }
[CFF entry]{.underline}
bib <- "@manual{manual-full, title = {The Definitive Computer Manual}, author = {Larry Manmaker}, year = 1986, month = {apr-may}, address = {Silicon Valley}, note = {This is a full MANUAL entry}, organization = {Chips-R-Us}, edition = {Silver} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
In terms of field required on BibTeX, it is identical for both \@mastersthesis and \@phdthesis.
We propose here to identify each type of thesis using the key
[thesis-type]{.underline} So if [thesis-type]{.underline} contains a regex
pattern (?i)(phd)
it would be recognized as
\@phdthesis.
Additionally, school would be mapped to [institution]{.underline}.
df_table <- table_master[table_master$table == "model_thesis", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) df_table$f3 <- gsub("link_to_article", "#article", df_table$f3) df_table$f3 <- gsub("link_to_booklet", "#booklet", df_table$f3) df_table$f3 <- gsub("link_to_book", "#book-inbook", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX**", "[CFF]{.underline}", "Notes"), caption = "**\\@mastersthesis / \\@phdthesis** Model" )
Examples: \@mastersthesis
BibTeX entry
@mastersthesis{mastersthesis-full, title = {Mastering Thesis Writing}, author = {Edouard Masterly}, year = 1988, month = jun, address = {English Department}, note = {This is a full MASTERSTHESIS entry}, school = {Stanford University}, type = {Master's project} }
[CFF entry]{.underline}
bib <- "@mastersthesis{mastersthesis-full, title = {Mastering Thesis Writing}, author = {Edouard Masterly}, year = 1988, month = jun, address = {English Department}, note = {This is a full MASTERSTHESIS entry}, school = {Stanford University}, type = {Master's project} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
Examples: \@phdthesis
BibTeX entry
@phdthesis{phdthesis-full, title = {Fighting Fire with Fire: Festooning {F}rench Phrases}, author = {F. Phidias Phony-Baloney}, year = 1988, month = jun, address = {Department of French}, note = {This is a full PHDTHESIS entry}, school = {Fanstord University}, type = {{PhD} Dissertation} }
[CFF entry]{.underline}
bib <- "@phdthesis{phdthesis-full, title = {Fighting Fire with Fire: Festooning {F}rench Phrases}, author = {F. Phidias Phony-Baloney}, year = 1988, month = jun, address = {Department of French}, note = {This is a full PHDTHESIS entry}, school = {Fanstord University}, type = {{PhD} Dissertation} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
The crosswalk of \@misc does not require any special treatment. This entry does not require any field.
Note also that it is mapped to [type: generic]{.underline} as \@incollection, but in this case booktitle is not even an option, so the proposed definition should cover both \@misc and \@incollection without problems.
df_table <- table_master[table_master$table == "model_misc", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) df_table$f3 <- gsub("link_to_article", "#article", df_table$f3) df_table$f3 <- gsub("link_to_booklet", "#booklet", df_table$f3) df_table$f3 <- gsub("link_to_book", "#book-inbook", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX**", "[CFF]{.underline}", "Notes"), caption = "**\\@misc** Model" )
Examples
BibTeX entry
@misc{misc-full, title = {Handing out random pamphlets in airports}, author = {Joe-Bob Missilany}, year = 1984, month = oct, note = {This is a full MISC entry}, howpublished = {Handed out at O'Hare} }
[CFF entry]{.underline}
bib <- "@misc{misc-full, title = {Handing out random pamphlets in airports}, author = {Joe-Bob Missilany}, year = 1984, month = oct, note = {This is a full MISC entry}, howpublished = {Handed out at O'Hare} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
The proposed model is consistent with \@conference / \@inproceedings. Note that \@proceedings does not prescribe a author field. On this cases, as [authors]{.underline} is required on [CFF]{.underline}, we would use anonymous[^7] when converting to [CFF]{.underline} and omit it on the conversion from [CFF]{.underline} to BibTeX.
[^7]: As proposed on How to deal with unknown individual authors?, (Guide to Citation File Format schema version 1.2.0)
df_table <- table_master[table_master$table == "model_proceedings", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) df_table$f3 <- gsub("link_to_article", "#article", df_table$f3) df_table$f3 <- gsub("link_to_booklet", "#booklet", df_table$f3) df_table$f3 <- gsub("link_to_book", "#book-inbook", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX**", "[CFF]{.underline}", "Notes"), caption = "**\\@proceedings** Model" )
Examples
BibTeX entry
@proceedings{proceedings-full, title = {Proc. Fifteenth Annual ACM Symposium on the Theory of Computing}, year = 1983, month = mar, publisher = {Academic Press}, address = {Boston}, series = {All ACM Conferences}, number = 17, note = {This is a full PROCEEDINGS entry}, editor = {Wizard V. Oz and Mihalis Yannakakis}, organization = {The OX Association for Computing Machinery} }
[CFF entry]{.underline}
bib <- "@proceedings{proceedings-full, title = {Proc. Fifteenth Annual ACM Symposium on the Theory of Computing}, year = 1983, month = mar, publisher = {Academic Press}, address = {Boston}, series = {All ACM Conferences}, number = 17, note = {This is a full PROCEEDINGS entry}, editor = {Wizard V. Oz and Mihalis Yannakakis}, organization = {The OX Association for Computing Machinery} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
The crosswalk of \@techreport does not require any special treatment.
df_table <- table_master[table_master$table == "model_techreport", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) df_table$f3 <- gsub("link_to_article", "#article", df_table$f3) df_table$f3 <- gsub("link_to_booklet", "#booklet", df_table$f3) df_table$f3 <- gsub("link_to_book", "#book-inbook", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX**", "[CFF]{.underline}", "Notes"), caption = "**\\@techreport** Model" )
Examples
BibTeX entry
@techreport{techreport-full, title = {A Sorting Algorithm}, author = {Tom Terrific}, year = 1988, month = oct, address = {Computer Science Department, Fanstord, California}, number = 7, note = {This is a full TECHREPORT entry}, institution = {Fanstord University}, type = {Wishful Research Result} }
[CFF entry]{.underline}
bib <- "@techreport{techreport-full, title = {A Sorting Algorithm}, author = {Tom Terrific}, year = 1988, month = oct, address = {Computer Science Department, Fanstord, California}, number = 7, note = {This is a full TECHREPORT entry}, institution = {Fanstord University}, type = {Wishful Research Result} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
The crosswalk of \@unpublished does not require any special treatment.
df_table <- table_master[table_master$table == "model_unpublished", c(2:4)] df_table[is.na(df_table)] <- "" # fix links df_table$f3 <- gsub("link_to_entry_models", "#entrymodels", df_table$f3) df_table$f3 <- gsub("link_to_article", "#article", df_table$f3) df_table$f3 <- gsub("link_to_booklet", "#booklet", df_table$f3) df_table$f3 <- gsub("link_to_book", "#book-inbook", df_table$f3) row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("**BibTeX**", "[CFF]{.underline}", "Notes"), caption = "**\\@unpublished** Model" )
Examples
BibTeX entry
@unpublished{unpublished-minimal, title = {Lower Bounds for Wishful Research Results}, author = {Ulrich Underwood and Ned Net and Paul Pot}, note = {Talk at Fanstord University (this is a minimal UNPUBLISHED entry)} }
[CFF entry]{.underline}
bib <- "@unpublished{unpublished-minimal, title = {Lower Bounds for Wishful Research Results}, author = {Ulrich Underwood and Ned Net and Paul Pot}, note = {Talk at Fanstord University (this is a minimal UNPUBLISHED entry)} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
The definition of \@inbook and \@incollection in BibTeX [@patashnik1988] is as follows:
\@inbook: A part of a book, which may be a chapter (or section) and/or a range of pages. Required fields: author or editor, title, chapter and/or pages, publisher, year (...)
\@incollection: A part of a book having its own title. Required fields: author, title, booktitle, publisher, year (...)
Whereas BibLaTeX [@biblatexpack] specifies:
- \@inbook: A part of a book which forms a self-contained unit with its own title. Note that the [profile]{.underline} of this entry type is [different from standard BibTeX]{.underline}, see § 2.3.1. Required fields: author, title, booktitle, year/date (...).
When considering required fields, an important difference is booktitle requirement in BibLaTeX. Notably, BibTeX \@incollection requires also this field. Moreover, both BibTeX \@incollection and BibLaTeX \@inbook emphasize its reference to "a part of a book (...) with its own title".
In this document, the proposed crosswalk ensures full compatibility with BibTeX. Hence, we propose to consider a BibLaTeX \@inbook entry as equivalent to a BibTeX \@incollection, given the congruence in their definitions and field requirements.
Examples
BibTeX entry
@inbook{inbook-biblatex, author = {Yihui Xie and Christophe Dervieux and Emily Riederer}, title = {Bibliographies and citations}, booktitle = {{R} Markdown Cookbook}, date = {2023-12-30}, publisher = {Chapman and Hall/CRC}, address = {Boca Raton, Florida}, series = {The {R} Series}, isbn = 9780367563837, url = {https://bookdown.org/yihui/rmarkdown-cookbook}, chapter = {4.5} }
[CFF entry]{.underline}
bib <- "@inbook{inbook-biblatex, author = {Yihui Xie and Christophe Dervieux and Emily Riederer}, title = {Bibliographies and citations}, booktitle = {{R} Markdown Cookbook}, date = {2023-12-30}, publisher = {Chapman and Hall/CRC}, address = {Boca Raton, Florida}, series = {The {R} Series}, isbn = 9780367563837, url = {https://bookdown.org/yihui/rmarkdown-cookbook}, chapter = {4.5} }" cff_read_bib_text(bib)
From [CFF]{.underline} to BibTeX
toBibtex(cff_read_bib_text(bib))
From @druskat2019 Table 4: Complete list of [CFF]{.underline} reference types.
df_table <- table_master[table_master$table == "cff_types", c(2:3)] df_table[is.na(df_table)] <- "" row.names(df_table) <- NULL knitr::kable(df_table, col.names = c("Reference type string", "Description"), row.names = NA, caption = "Complete list of [CFF]{.underline} reference types." )
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.