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

Multiple corresponding authors not working for the 'copernicus_article' template #214

Closed
pzhaonet opened this issue Mar 18, 2019 · 9 comments · Fixed by #221
Closed

Multiple corresponding authors not working for the 'copernicus_article' template #214

pzhaonet opened this issue Mar 18, 2019 · 9 comments · Fixed by #221

Comments

@pzhaonet
Copy link

pzhaonet commented Mar 18, 2019

It is a good experience for me to write a Copernicus manuscript with the 'rticles' package. I've just found a problem that it seems not supporting multiple corresponding authors in the 'copernicus_article' template. A mini example could be produced by creating an .Rmd file in RStudio - File - New File - R Markdown - From Template - Copernicus Journal Article, and add one more line to the author information in the yaml:

author:
  - given_name: Daniel
    surname: Nüst
    affiliation: 1
    email: daniel.nuest@uni-muenster.de
    corresponding: true
  - given_name: Josiah
    surname: Carberry
    affiliation: 2
    email: j.carberry@orcid.org
    corresponding: true # one more line
  - given_name: Markus
    surname: Konkol
    affiliation: 1

Both Daniel and Josiah are supposed to the corresponding authors. However, only the last one is shown in the pdf file.

I found a loop in library/rticles/rmarkdown/templates/copernicus_article/resources/template.tex:

$for(author)$
$if(author.corresponding)$
\correspondence{$author.given_name$\ $author.surname$\ ($author.email$)}
$endif$
$endfor$

I guess there must be something wrong of rmarkdown for processing this loop. I hack the template by setting correspongdingauthors in the yaml header and using $correspongdingauthors$ in the template for temporary use.

Could you please have a look at it if it is a bug? Maybe it is a Pandoc issue? Just not sure...

Thanks a lot!

> xfun::session_info('rticles')
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 14393), RStudio 1.2.1322

Locale:
  LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
  LC_NUMERIC=C                           LC_TIME=English_United States.1252    

Package version:
  base64enc_0.1.3  digest_0.6.18    evaluate_0.13    glue_1.3.1       graphics_3.5.2   grDevices_3.5.2  highr_0.7        htmltools_0.3.6 
  jsonlite_1.6     knitr_1.22       magrittr_1.5     markdown_0.9     methods_3.5.2    mime_0.6         Rcpp_1.0.1       rmarkdown_1.12.2
  rticles_0.7.1    stats_3.5.2      stringi_1.4.3    stringr_1.4.0    tinytex_0.11     tools_3.5.2      utils_3.5.2      xfun_0.5.2      
  yaml_2.2.0
@yihui
Copy link
Member

yihui commented Mar 20, 2019

I'm not really familiar with these journal format details. @nuest introduced the template via #172, and I wonder if he has an elegant solution for this case. I have a possible solution, but I'd like to hear his thoughts first.

@nuest
Copy link
Contributor

nuest commented Mar 20, 2019

I can take a look later this week, travelling now.

@pzhaonet the author guidelines are not very clear about that: do you have an example of a paper with multiple correspondence authors? Just wondering if this might not be a feature, i.e. Copernicus might only allow one corresponding author.

Does the PDF render fine with two \correspondence items in the LaTeX?

@nuest
Copy link
Contributor

nuest commented Mar 20, 2019

Looking at the original template, there is only one correspondence element. I will check with Copernicus staff about this.

@pzhaonet
Copy link
Author

pzhaonet commented Mar 20, 2019

@yihui @nuest Thanks to you guys for your fast response. Well, I am not sure if Copernicus allows multiple corresponding authors. I am working on a manuscript, which has two corresponding authors. I will definitely figure it out when submission.

Anyway, I think it is a little confusing, from the technical point, that it does not work when there are multiple corresponding: trues in yaml and there is a loop in the .tex template.

I guess a line of correspongdingauthors: author1, author2 in the yaml header with $correspongdingauthors$ in the .tex template is a simple way, although it is not that elegant.

@nuest
Copy link
Contributor

nuest commented Mar 20, 2019

Response from Copernicus: use the following way for multiple authors:

\correspondence{Anja Rasmussen (anja.rasmussen@copernicus.org), Sarah Schneemann (sarah.schneemann@copernicus.org), and Daniel Nüst (daniel.nuest@uni-muenster.de)}

or with 2:

\correspondence{Anja Rasmussen (anja.rasmussen@copernicus.org) and Daniel Nüst (daniel.nuest@uni-muenster.de)}

It should be possible to build that string in the template, but I am unsure how to do it most elegantly to handle the different cases. @yihui Can you sketch how you would approach this?

@yihui
Copy link
Member

yihui commented Mar 20, 2019

I'd give users an option to specify corresponding authors separately:

$if(correspongdingauthors)$
\correspondence{$correspongdingauthors$}
$else$
$for(author)$
$if(author.corresponding)$
\correspondence{$author.given_name$\ $author.surname$\ ($author.email$)}
$endif$
$endfor$
$endif$

If there is only one corresponding author, they can specify it under the author field via corresponding: true, otherwise they provide the full list of corresponding authors by themselves via correspondingauthors.

@nuest
Copy link
Contributor

nuest commented Apr 15, 2019

I tried to find a way to construct the statement manually, but eventually went with @yihui's suggestion.

@pzhaonet Feel free to try out my fork's master branch, where this is implemented.

@pzhaonet
Copy link
Author

pzhaonet commented May 2, 2019

Great! Many thanks!

@github-actions
Copy link

github-actions bot commented Nov 2, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2020
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 a pull request may close this issue.

3 participants