GeoBosh / Rdpack

R package Rdpack provides functions and macros facilitating writing and management of R documentation.
https://geobosh.github.io/Rdpack/
28 stars 6 forks source link

'series' field output #7

Closed kisungyou closed 5 years ago

kisungyou commented 5 years ago

Hi, I had some occasions where 'series' title appears in the compiled output when items of '@inproceedings', '@book' type articles are compiled. I wish I knew how to report an issue in a concrete manner, but I'm more than happy to cooperate in order to remove the name of a field showing up. One of such examples would be an item

@inproceedings{he_neighborhood_2005,
    address = {Washington, DC, USA},
    series = {{ICCV} '05},
    title = {Neighborhood {Preserving} {Embedding}},
    isbn = {0-7695-2334-X-02},
    url = {http://dx.doi.org/10.1109/ICCV.2005.167},
    doi = {10.1109/ICCV.2005.167},
    booktitle = {Proceedings of the {Tenth} {IEEE} {International} {Conference} on {Computer} {Vision} - {Volume} 2},
    publisher = {IEEE Computer Society},
    author = {He, Xiaofei and Cai, Deng and Yan, Shuicheng and Zhang, Hong-Jiang},
    year = {2005},
    pages = {1208--1213}
}

and the corresponding output would look like this 2018-09-19 21-21-17,

where the text 'series' appears before ICCV.

GeoBosh commented 5 years ago

Thank you for the report and the example. I edited the code in your post to format it better.

Rdpack produces the references using the base R style, which inserts the word 'series' in front of the contents of the bibtex field 'series' unconditionally. I checked several bibtex styles none of them does this. It seems that the jss style used by the Journal of Statistical Software also doesn't insert 'series'. Since the default base R style mimics the jss style, this looks like a bug to me but it may be an intentional feature, as well.

I will ask on R-devel about this but it will be better to use a shorter bibtex entry, preferably of type @book. Could you find such an entry in your bib files, since @inproceedings contains too many entries not relevant to the issue?

Here is a reproducible example. Package bibtex is used to import the bibtex reference.

library(bibtex)
f <- tempfile()
writeLines("@inproceedings{he_neighborhood_2005,
    address = {Washington, DC, USA},
    series = {{ICCV} '05},
    title = {Neighborhood {Preserving} {Embedding}},
    isbn = {0-7695-2334-X-02},
    url = {http://dx.doi.org/10.1109/ICCV.2005.167},
    doi = {10.1109/ICCV.2005.167},
    booktitle = {Proceedings of the {Tenth} {IEEE} {International} {Conference} on {Computer} {Vision} - {Volume} 2},
    publisher = {IEEE Computer Society},
    author = {He, Xiaofei and Cai, Deng and Yan, Shuicheng and Zhang, Hong-Jiang},
    year = {2005},
    pages = {1208--1213}
    }", f)
read.bib(f)

The last line above prints:

He X, Cai D, Yan S, Zhang H (2005). "Neighborhood Preserving Embedding." In _Proceedings of the Tenth IEEE International Conference on Computer Vision - Volume 2_, 
series ICCV '05, 1208-1213. 
ISBN 0-7695-2334-X-02, doi: 10.1109/ICCV.2005.167 (URL:
http://doi.org/10.1109/ICCV.2005.167), <URL:
http://dx.doi.org/10.1109/ICCV.2005.167>.

and we see the word 'series' prepended to the contents of that field ({ICCV} '05).

kisungyou commented 5 years ago

Here is another shortened example for @book item.

library(bibtex)
f <- tempfile()
writeLines("
@book{fukunaga_introduction_1990, 
  address = {Boston},
  edition = {2nd ed},
  series = {Computer science and scientific computing},
  title = {Introduction to statistical pattern recognition},
  isbn = {978-0-12-269851-4},
  publisher = {Academic Press},
  author = {Fukunaga, Keinosuke},
  year = {1990},
}", f)
read.bib(f)

and the return is,

Fukunaga K (1990). _Introduction to statistical pattern recognition_, series Computer science and scientific computing, 2nd ed edition. Academic
Press, Boston. ISBN 978-0-12-269851-4.

where we can see the text series appearing again. Maybe your previous suggestion of showing the text series only when the field does not contain any similar words seems nice.

GeoBosh commented 5 years ago

I have now updated Rdpack on github to handle field 'series' more like other BibTeX styles, including JSS. Now the word 'series' is not prepended to the contents of the field, File "./inst/examples/RdpackTester.pdf" shows a number of rendered examples based on the bib entries given by Kisung and modified by me to test also cases with volume or number fields.

Please let me know what you think. Further examples are welcome.