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

docs: add DOI to CITATION #773

Merged
merged 4 commits into from
May 15, 2023
Merged

docs: add DOI to CITATION #773

merged 4 commits into from
May 15, 2023

Conversation

maelle
Copy link
Contributor

@maelle maelle commented Apr 11, 2023

Fix #711
The package whose citation I used as example is GPL-3 licenced https://github.com/cran/lidR/blob/f0dae39007c9d174f6e1962ff236fd8826f1501d/DESCRIPTION#L22

citation("igraph")
#> 
#> To cite 'igraph' in publications use:
#> 
#>   Csardi G, Nepusz T (2006). "The igraph software package for complex
#>   network research." _InterJournal_, *Complex Systems*, 1695.
#>   <https://igraph.org>.
#> 
#> Csárdi G, Nepusz T, Traag V, Horvát S, Zanini F, Noom D, Müller K
#> (2023). _igraph: Network Analysis and Visualization in R_.
#> doi:10.5281/zenodo.7682609 <https://doi.org/10.5281/zenodo.7682609>, R
#> package version 1.4.99.9002,
#> <https://CRAN.R-project.org/package=igraph>.
#> 
#> To see these entries in BibTeX format, use 'print(<citation>,
#> bibtex=TRUE)', 'toBibtex(.)', or set
#> 'options(citation.bibtex.max=999)'.

Created on 2023-04-11 with reprex v2.0.2

How it looks on the authors page

image

@szhorvat
Copy link
Member

#> Csárdi G, Nepusz T, Traag V, Horvát S, Zanini F, Noom D, Müller K

This should be Horvát Sz instead of Horvát S, but most automatic systems don't deal well with this, so if it's not an easy fix, don't bother. More info on why and how it's normally done in BibTeX.

@ntamas
Copy link
Member

ntamas commented Apr 11, 2023

So can the CITATION file include arbitrary R code? 😮

@maelle maelle marked this pull request as draft April 11, 2023 15:49
@maelle
Copy link
Contributor Author

maelle commented Apr 11, 2023

@szhorvat ouch, this is most unfortunate, sorry about that, and good to know!

I tried different variations (spaces, backslashes) and positions of a line à la authors <- sub("Szabolcs", "\\{\\\\relax Sz\\}abolcs", authors) without success. I didn't find any use of "relax" in CITATION files on CRAN via GitHub advanced search.

Maybe I should write out the names without any code, and instead add docs in the contributing guide of how to "register" an author?

@krlmlr
Copy link
Contributor

krlmlr commented Apr 17, 2023

I'm not familiar with CITATION files either.

@szhorvat
Copy link
Member

@maelle I'm sorry, I didn't see your response until now. It sounds like it's complicated. Just don't worry about it, it's fine as it is :-)

@maelle
Copy link
Contributor Author

maelle commented Apr 20, 2023

I am so annoyed that the \relax thing doesn't work, and I could not find any example anywhere.

With the current commit the text version is ok but not the R one see

image

What's better? 😅

@szhorvat
Copy link
Member

Don't worry about it, just leave it as an "S" :-)

@maelle maelle marked this pull request as ready for review April 20, 2023 13:36
@maelle
Copy link
Contributor Author

maelle commented May 5, 2023

@szhorvat @dieghernan kindly contributed a nearly perfect fix for the abbreviation! 🙏 maelle/wrongabbreviation#1

@dieghernan
Copy link

So can the CITATION file include arbitrary R code? 😮

Yup, but only using base functions

https://cran.r-project.org/doc/manuals/R-exts.html#CITATION-files

The CITATION file is parsed as R code (in the package’s declared encoding, or in ASCII if none is declared). It will contain calls to function bibentry

@szhorvat
Copy link
Member

szhorvat commented May 5, 2023

Thank you so much @dieghernan and @maelle, that's amazing that this could be made to work!

@maelle
Copy link
Contributor Author

maelle commented May 5, 2023

really all I had to do was complain about inst/CITATION somewhere where @dieghernan was listening 😉

@krlmlr krlmlr merged commit 12e54c9 into igraph:main May 15, 2023
@krlmlr
Copy link
Contributor

krlmlr commented May 15, 2023

Thanks!

@krlmlr
Copy link
Contributor

krlmlr commented May 20, 2023

@maelle: I'm seeing in https://win-builder.r-project.org/o164EoCgBrr7/00check.log :

Problems when formatting CITATION entries:
  x:1: unexpected END_OF_INPUT '\relax'

Only for 1.4.99.9xxx, not for 1.4.2. Any idea?

@maelle
Copy link
Contributor Author

maelle commented May 23, 2023

@krlmlr I was not able to reproduce on R-hub, because the build failed too early (at install). 🤔
However, won't 1.4.2 be submitted anyway?


txt <- gsub("Horvát S", "Horvát Sz", entry_for_txt)

aut_new <- sub("Szabolcs", "{\\\\relax Sz}abolcs", authors)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This came back from CRAN:

Problems when formatting CITATION entries:
  x:1: unexpected END_OF_INPUT '\relax'

Do we really need four backslashes here? Would "{Sz}abolcs" work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, {Sz} does not achieve the intended effect.

However, I feel that I already caused too much trouble by even bringing this up. If there's no easy solution, I don't want to stand in the way of removing this feature. What concerns me is that Maëlle already put a lot of work into making it work ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, no worries. We can try again with the next release. I now understand the four backslashes too.

Unfortunately, I can't replicate the error locally. It could require a specific locale.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Zenodo entry to CITATION file
5 participants