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

Force intext citations to be et al when >3 authors #6

Closed tpbilton closed 5 years ago

tpbilton commented 6 years ago

I have an R package called GUSMap that I have been developing and I have starting using Rdpack for managing my references. However, I'm finding that the first time I cite a reference, all the authors are displayed (this happens in this file). Can Rdpack be forced to convert intext citations to et al when there are more than 3 authors?

Thanks.

GeoBosh commented 6 years ago

Thanks for the report and the example. This needs fixing, I will look into it.

GeoBosh commented 6 years ago

I have now uploaded a fix for this and now "et. all" should be printed instead (printing all authors is the default behaviour of JSS style in the R tools and Journal of Statistical Software), let me know if it resolves the issue properly. I will also do additional testing.

I noticed another issue but am not sure if it is only on my current installation. The surname of the fourth author, D. Chagné, of your main reference is not rendered correctly. Do you observe this as well?

Thanks again for reporting the issue and using Rdpack.

tpbilton commented 6 years ago

Thanks, I'll have a look at this tomorrow.

Re the rendering of the fourth author. Yes I have noticed this as will. I had thought this could be due to the fact that I generated the rd files on linux using roxgyen2 because the bug only seems to show when I install on Windows. I haven't really had time to look more into it though.

GeoBosh commented 6 years ago

Indeed, I am currently on my Windows machine and thought that this might have something to do with the problem. Are you saying that on linux it's ok?

tpbilton commented 6 years ago

Right, I've had a look at and yes your fix has done the trick, thank you.

Re the rendering issues: Yes it is fine on linux. I tried running roxygenise on Windows it didn't change anything. So, it seems that there is some issue with rendering special characters in Windows? Could it be an encoding issue?

GeoBosh commented 6 years ago

Yes, it is an encoding issue. Roxygen indeed is not relevant here.

I am pretty sure that the issue is in \Sexpr. I will report it on R-devel but writing a minimal example for encoding related issues needs some care and I am marking an exam at the moment. It's good that the issue is only on Windows.