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

sim_article update #547

Closed
henrikibster opened this issue Nov 1, 2023 · 14 comments · Fixed by #548
Closed

sim_article update #547

henrikibster opened this issue Nov 1, 2023 · 14 comments · Fixed by #548
Assignees
Labels
feature a feature request or enhancement help wanted ❤️ we'd love your help!

Comments

@henrikibster
Copy link

henrikibster commented Nov 1, 2023

I have used the sim_article to create an article for Statistics in Medicine. However I have gotten the following feedback "...please ensure that the references are in the correct Statistics in Medicine style. We are now using the American Medical Association reference style".

Would it be possible to update the package so this new style is supported?

Details of the new template can be found at https://authorservices.wiley.com/author-resources/Journal-Authors/Prepare/new-journal-design.html?_gl=1*rfvm07*_gcl_au*MTAyNjA3NDI3OS4xNjkyMDk4MTM5

Br, Henrik

@cderv
Copy link
Collaborator

cderv commented Nov 1, 2023

The template already use the AMA option for the class

\documentclass[AMA,STIX1COL,$for(classoption)$$classoption$$sep$,$endfor$]{WileyNJD-v2}

which will correctly load the style with natbib

\if@AMArefstyle%
\IfFileExists{NJDnatbib.sty}{\usepackage[numbers,super]{NJDnatbib}}{\usepackage[numbers,super]{natbib}}%
\bibliographystyle{WileyNJD-AMA}%

And sim_article() defaults to natbib

sim_article <- function(..., highlight = NULL, citation_package = "natbib") {

However, it seems no one PR a new update of WJD template, so files are clearly out dated. So I can try updating the files included with the package.

To confirm before doing the work, did you try them after downloading on the website ?

Can you share how it should looks like ? I can't see the difference with the document we currently produce
image
image

and an online published article https://onlinelibrary.wiley.com/doi/epdf/10.1002/sim.9916
image
image

Is this the reference part which has too much spacing ?

i'll see if I can make a PR to test the new version available on website

@cderv cderv added feature a feature request or enhancement help wanted ❤️ we'd love your help! labels Nov 1, 2023
@henrikibster
Copy link
Author

henrikibster commented Nov 1, 2023

I did download the zip file with the template (WileyNJDv5_Template.zip), but as I am quite the amateur I do not know where to put these files in order for them to be used.
The output you have generated above appears to be correct as far as I can judge.
However when I knit my document it does not appear to be correct:
image

An update that would fix this issue for me, would be much appreciated.

@cderv
Copy link
Collaborator

cderv commented Nov 1, 2023

However when I knit my document it does not appear to be correct:

You should have the same output as me - I only used the default template for sim_article(). What is your Rmd document header? Did you tweak some options ?

I'll push a PR with V5 updates, but you will need to adapt your article to it probably.

@henrikibster
Copy link
Author

My header is this (some stuff deleted):
image

@cderv
Copy link
Collaborator

cderv commented Nov 1, 2023

It should be ok. I don't know why you don't ket the correct format. You should check you version.

  • Of rticles
  • Of the local resources (you can get them by creating a new article from template) required.
  • Of pandoc (rmarkdown::pandoc_version()) => what is your version ?

By the way, check the indentation of your field in YAML. the screenshot shows that some are not correct.

@henrikibster
Copy link
Author

  • My version of rticles is 0.25
  • my pandoc is version ‘3.1.1’
    I may have messed up my indentation of the header when I removed stuff, but I will give it a look.
    I will try and make a new document and see if the problem persists.
    How will I get the new updated version?

@cderv
Copy link
Collaborator

cderv commented Nov 1, 2023

How will I get the new updated version?

You can install the PR directly

pak::pak("rstudio/rticles#548")
# or 
remotes::install_github("rstudio/rticles#548")

This will install the version from the PR.

@henrikibster
Copy link
Author

After having downloaded this and knitting I get the error: ! LaTeX Error: File `WileyNJD-v5.cls' not found.
And when I look in the "WileyNJDv5_Template.zip" file, there is no file called that - there is a "WileyNJDv5.cls" though.
Am I missing something here?

@cderv
Copy link
Collaborator

cderv commented Nov 2, 2023

rticles works by providing format functions, but also resources that goes with it. Those resources are bundled in articles but in the same way they are supposed to be used with the original template. This implies that when you update to the new articles versions, you need to update the resources. To do that, you need to create a new template for sim_article() and then put your article content in the new .Rmd.

There is no other way to update right now. But you experience makes me think of severals improvement we need to do probably

  • Prevent this type of error by detecting the outdated resources and error correctly before rendering
  • Add a function that would help update resources in an existing article

These improvement won't be made right away, but they can definitely be useful.

@henrikibster
Copy link
Author

Great.
I have it up and running now - thank you very much for the help.

@cderv
Copy link
Collaborator

cderv commented Nov 2, 2023

Awesome. So this means the PR works right ?

@henrikibster
Copy link
Author

Actually not, the latex appears to contain some errors, so I rolled back. It may be an issue with my system though.
I tried to install again just now, but the
remotes::install_github("#548") does not appear to work this morning.

@cderv
Copy link
Collaborator

cderv commented Nov 3, 2023

The PR has been merged as shown in this issue.

You can now install directly from the repo

pak::pak("rstudio/rticles")
remotes::install_github("rstudio/rticles")

The test of compilation for the tempate Rmd are passing - if there is some other issue. Please open a new one and share what is not working for you. Thanks!

Copy link

github-actions bot commented May 6, 2024

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 May 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement help wanted ❤️ we'd love your help!
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants