rstudio/rticles

Affiliation rendering incorrectly with elsev article

gjpstrain opened this issue · 5 comments

The elsevier article class does not render commas between different parts of the address for the affiliations. Other punctuation renders correctly (period etc.), but the commas between e.g Department, State etc do not render. This happens when knitting the elsevier article straight out of the box, and I have replicated this with Rstudio cloud as well.

The intermediate .tex file has the commas in it, but for some reason they do not render. Below is what the .tex looks like, which doesn't work.

  \fnref{2}}
   \ead{derek@example.com} 
      \affiliation[Some Institute of Technology]{Department, Street,
City, State, Zip}

Below is a change that does work, but unfortunately I don't know how to reverse-engineer this so the rmarkdown produces it in the .tex file.

  \fnref{2}}
   \ead{derek@example.com} 
      \affiliation[Some Institute of Technology]{
		organization = {Department},
		addressline = {A street 29},
		postcode = {2054 NX},
		city = {Manchester},
		country = {The Netherlands}}

I have asked this on stackoverflow - https://stackoverflow.com/questions/74197086/elsevier-rticle-not-rendering-affiliation-properly

By filing an issue to this repo, I promise that

  • [ x] I have fully read the issue guide at https://yihui.name/issue/.
  • [ x] I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('rticles'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/rticles').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • [ x] I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@gjpstrain

The template files could probably use some additional yaml variables to fill the template.tex file correctly. But here is a work around:

author:
  - name: First Name
    email: first.name@bigwiguniversity.edu
    affiliation: 1
    correspondingauthor: true
address:
  - code: 1
    address: |
      ```{=latex}
      organization={Big Wig University},
      addressline={1 main street}, 
      city={Gotham}, state={State}, postcode={123456},
      country={United States}
      ```

This will insert the raw latex into the address variable used in the template file and render the commas correctly.

cderv commented

Thanks for the report

You can now do the affiliation like

address:
  - code: Some Institute of Technology
    organization: Big Wig University
    addressline: 1 main street
    city: Gotham
    state: State
    postcode: 123456
    country: United States
  - code: Another University
    organization: Department
    addressline: A street 29
    postcode: 2054 NX
    city: Manchester,
    country: The Netherlands

It should solve the issue. address should still be supported and not break your current workaround

address:
  - code: Some Institute of Technology
    organization: Big Wig University
    addressline: 1 main street
    city: Gotham
    state: State
    postcode: 123456
    country: United States
  - code: Another University
    organization: Department
    addressline: A street 29
    postcode: 2054 NX
    city: Manchester,
    country: The Netherlands

Hi there,
I just tested this code and it doesn't work. I cannot produce any output at all with it.
I also tested the following code:

author:
  - name: First Name
    email: first.name@bigwiguniversity.edu
    affiliation: 1
    correspondingauthor: true
address:
  - code: 1
    address: |
      ```{=latex}
      organization={Big Wig University},
      addressline={1 main street}, 
      city={Gotham}, state={State}, postcode={123456},
      country={United States}
      ```

However, the only entry I can change is the organisation. If I change any of the other entries (address line, city,...) it sticks to the values stated above. Anything hard-coded that should not be hard-coded, perhaps?

cderv commented

Are you using latest development version ? I did not yet made the release on CRAN. Should be done later this week though.

See the new template rendered with 0.24.10 at https://pkgs.rstudio.com/rticles/articles/examples.html#elsevier---elsevier-journal-article

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.