Coder Social home page Coder Social logo

sim_article update about rticles HOT 14 CLOSED

henrikibster avatar henrikibster commented on June 18, 2024
sim_article update

from rticles.

Comments (14)

cderv avatar cderv commented on June 18, 2024

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

from rticles.

henrikibster avatar henrikibster commented on June 18, 2024

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.

from rticles.

cderv avatar cderv commented on June 18, 2024

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.

from rticles.

henrikibster avatar henrikibster commented on June 18, 2024

My header is this (some stuff deleted):
image

from rticles.

cderv avatar cderv commented on June 18, 2024

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.

from rticles.

henrikibster avatar henrikibster commented on June 18, 2024
  • 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?

from rticles.

cderv avatar cderv commented on June 18, 2024

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.

from rticles.

henrikibster avatar henrikibster commented on June 18, 2024

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?

from rticles.

cderv avatar cderv commented on June 18, 2024

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.

from rticles.

henrikibster avatar henrikibster commented on June 18, 2024

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

from rticles.

cderv avatar cderv commented on June 18, 2024

Awesome. So this means the PR works right ?

from rticles.

henrikibster avatar henrikibster commented on June 18, 2024

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.

from rticles.

cderv avatar cderv commented on June 18, 2024

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!

from rticles.

github-actions avatar github-actions commented on June 18, 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.

from rticles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.