[R] Format utils::bibentry with a 'corporate name'

Sam Albers ton|ght@then|ght @end|ng |rom gm@||@com
Fri Oct 29 19:21:45 CEST 2021


Hi all,

Does anyone know of a way to force utils::bibentry to mimic the BibTex
behaviour of using double { to force a "corporate name" in the author
field to print correctly? For example take this bibentry:

entry <- utils::bibentry(
  bibtype = "Manual",
  title = "The Thing",
  author = "The Data People",
  organization = "The Data Org",
  year = format(Sys.Date(), "%Y")
)

entry
#> People TD (2021). _The Thing_. The Data Org.
print(entry, style = "citation")
#>
#> People TD (2021). _The Thing_. The Data Org.
#>
#> A BibTeX entry for LaTeX users is
#>
#>   @Manual{,
#>     title = {The Thing},
#>     author = {The Data People},
#>     organization = {The Data Org},
#>     year = {2021},
#>   }

I can simply add "{" right in the author string which then passes that
to the Bibtex entry but the author field is still thinking it is a
person with a name and I also get some warnings:

entry <- utils::bibentry(
  bibtype = "Manual",
  title = "The Thing",
  author = "{The Data People}",
  organization = "The Data Org",
  year = format(Sys.Date(), "%Y")
)


print(entry, style = "citation")
#> Warning in parseLatex(x): x:1: unexpected '}'
#> Warning in parseLatex(x): x:1: unexpected END_OF_INPUT 'The'
#> Warning in parseLatex(x): x:1: unexpected '}'
#> Warning in parseLatex(x): x:1: unexpected END_OF_INPUT 'The'
#> Warning in withCallingHandlers(.External2(C_parseRd, tcon, srcfile,
"UTF-8", :
#> <connection>:1: unexpected '}'
#> Warning in withCallingHandlers(.External2(C_parseRd, tcon, srcfile,
"UTF-8", : <connection>:4: unexpected END_OF_INPUT 'The Data Org.
#> '
#>
#> People D (2021). _The Thing_. The Data Org.
#>
#> A BibTeX entry for LaTeX users is
#>
#>   @Manual{,
#>     title = {The Thing},
#>     author = {{The Data People}},
#>     organization = {The Data Org},
#>     year = {2021},
#>   }

Any thoughts?

Thanks in advance,

Sam



More information about the R-help mailing list