Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate conversion of \emph in bibtex entries #3

Open
aravind-j opened this issue May 24, 2021 · 5 comments
Open

Inaccurate conversion of \emph in bibtex entries #3

aravind-j opened this issue May 24, 2021 · 5 comments

Comments

@aravind-j
Copy link

In case of bibtex entries with italicized codes specified using \emph{}, rbibuitils is converting backslash in \emph to \backslash, resulting in \backslashemph leading to a unknown macro '\backslashemph' error.

bib1 <- "@article{burton_quantitative_1951,
	title = {Quantitative inheritance in pearl millet (\\emph{{Pennisetum} glaucum})},
	volume = {43},
	number = {9},
	journal = {Agronomy Journal},
	author = {Burton, Glenn W.},
	year = {1951},
	pages = {409--417}
}"


bib2 <- "@article{diwan_methods_1995,
  title = {Methods of developing a core collection of annual \\emph{{Medicago}} species},
  volume = {90},
  language = {en},
  number = {6},
  journal = {Theoretical and Applied Genetics},
  author = {Diwan, N. and McIntosh, M. S. and Bauchan, G. R.},
  month = may,
  year = {1995},
  keywords = {Annual Medicago species, Core collection, Germplasm collection, Relative Diversity method},
  pages = {755--761}
}"

rbibutils::charToBib(bib1)
#> Burton GW (1951). "Quantitative inheritance in pearl millet
#> (\backslashemph{{Pennisetum} glaucum})." _Agronomy Journal_, *43*(9),
#> 409-417.
rbibutils::charToBib(bib2)
#> Diwan N, McIntosh MS, Bauchan GR (1995). "Methods of developing a core
#> collection of annual \backslashemph{{Medicago}} species." _Theoretical
#> and Applied Genetics_, *90*(6), 755-761.
@GeoBosh
Copy link
Owner

GeoBosh commented May 24, 2021

Thanks for the report, I will fix it.

Interestingly, the CRAN version of EvaluateCore contains entries with \emph{} but passes the checks on CRAN. Maybe those entries were unused in that version of EvaluateCore.

@aravind-j
Copy link
Author

That is interesting, but the problematic entries with \emph{} (diwan_methods_1995, basigalup_development_1995, tai_core_2001 and studnicki_comparing_2013) were being used in the documentation.

@GeoBosh
Copy link
Owner

GeoBosh commented May 26, 2021

This comment is mainly for me. Maybe it would be best to change the call in Rdpack to use direct = TRUE. With the above objects bib1 and bib2 it gives:

rbibutils::charToBib(bib1, direct = TRUE)
## Burton GW (1951). “Quantitative inheritance in pearl millet
## (_Pennisetum glaucum_).” _Agronomy Journal_, *43*(9), 409-417.
rbibutils::charToBib(bib2, direct = TRUE)
## Diwan N, McIntosh MS, Bauchan GR (1995). “Methods of developing a core## 
## collection of annual _Medicago_ species.” _Theoretical and Applied
## Genetics_, *90*(6), 755-761.

@GeoBosh
Copy link
Owner

GeoBosh commented Jun 1, 2021

I updated Rdpack on github to use option direct = TRUE, as in the example in my previous comment. This should resolve the issue for Rdpack users and was the plan anyway. I am leaving this issue open since it should be fixed for the case direct = FALSE.

I believe that if you build your package with the github version of Rdpack it will pass the CRAN checks. I have checked the reverse dependencies of Rdpack with the versions of rbibutils on CRAN and github and all pass on my system (ubuntu 20.04) but it may take some time before submitting to CRAN.

@GeoBosh
Copy link
Owner

GeoBosh commented Jun 19, 2021

The above change in Rdpack is on CRAN (version 2.1.2).

@GeoBosh GeoBosh closed this as completed Nov 5, 2021
@GeoBosh GeoBosh reopened this Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants