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

Update OUP format to make compatible with elsevier format #406

Merged
merged 23 commits into from
May 31, 2021

Conversation

dmkaplan2000
Copy link
Contributor

I have updated the OUP format so the template Rmarkdown document is largely identical to the elsevier format, facilitating switching between the two formats. The changes are backward compatible so existing documents made with the old format will continue to work.


To contribute a new article template to this package, please make sure you have done the following things (note that journalname_article below is only an example name):

  • [ X] This project uses a Contributor Licence Agreement (CLA) that you'll be asked to sign when opening a PR. This is required for a significant pull request (it is fine not to sign it if a PR is only intended to fix a few typos). We use a tool called CLA assistant for that.
    You could also, unless you have done it in any other RStudio's projects before, sign the individual or corporate contributor agreement. You can send the signed copy to jj@rstudio.com.

  • [ X] Add the journalname_article() function to R/article.R if the output format is simple enough, otherwise create a separate R/journalname_article.R.

  • [ X] Add the Pandoc LaTeX template inst/rmarkdown/templates/journalname/resources/template.tex.

  • [ X] Add a skeleton article inst/rmarkdown/templates/journalname/skeleton/skeleton.Rmd.

  • [ X] Add a description of the template inst/rmarkdown/templates/journalname/template.yaml.

  • [ X] Please include the document class file (*.cls) if needed, but please do not include standard LaTeX packages (*.sty) that can be downloaded from CTAN. If you are using TinyTeX or TeX Live, you can verify if a package is available on CTAN via tinytex::parse_packages(files = "FILENAME"") (e.g., when FILENAME is plain.bst, it should return "bibtex", which means this file is from a standard CTAN package). Please keep the number of new files absolutely minimal (e.g., do not include PDF output files), and also make examples minimal (e.g., if you need a .bib example, try to only leave one or two bibliography entries in it, and don't include too many items in it without using all of them).

  • [ X] Update Rd and namespace (could be done by devtools::document()).

  • [ X] Update NEWS.

  • [ X] Update README with a link to the newly supported journal. Please add your Github username and the full name of the journal (follow other examples in the list).

  • [ X] Add a test to tests/testit/test-formats.R by adding a line test_format("journalname"). We try to keep them in alphabetical order.

  • [ X] Add your name to the list of authors Authors@R in DESCRIPTION. You don't need to bump the package version in DESCRIPTION.

Lastly, please try your best to do only one thing per pull request (e.g., if you want to add two output formats, do them in two separate pull requests), and refrain from making cosmetic changes in the code base: https://yihui.name/en/2018/02/bite-sized-pull-requests/

Thank you!

David M. Kaplan and others added 23 commits January 23, 2020 00:22
Citations not working and strange things happen with a final section, but most other things seem to be working.

Template needs further work to do equations and cross-referencing correctly.
Merging back my changes accepted into rstudio version of rticles after pull request.
…box.

Modifying template to show how to use knitr::kable for generating tables
and how to use place floats at end and number lines using header-includes.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ yihui
❌ David M. Kaplan


David M. Kaplan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dmkaplan2000
Copy link
Contributor Author

David M. Kaplan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.

I do not understand this message. I have looked at my commits as suggested by the link and I do not see any evidence of commits not in my name. Perhaps I am not understanding the instructions.

@dmkaplan2000
Copy link
Contributor Author

I have signed the CLA, but I think it is not recognizing it because I signed as "David Kaplan", when it was looking for "David M. Kaplan". I have tried to fix this, but it won't let me change the name. Is there a way to fix this?

@cderv
Copy link
Collaborator

cderv commented May 31, 2021

Thanks @dmkaplan2000 !

For a better understanding, Oxford university press article and elsevier are suppose to be the same, is that so ? Does your PR mean that we need to make them evolved the same way in the future ? I trying to understand why we have 2 templates if at the end they are quite similar.

About the CLA signing and commit on Github, here are my takes. As you can see above, your commits are not associated with your Github user. We don't see you profile picture in the commit. You can click the commit to see this in more detail.
What is explained in https://docs.github.com/en/github/committing-changes-to-your-project/troubleshooting-commits/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user is that you may have not configured your local Git with the username and / or email address you use on Github. Git must be configured with username and email, and this is used by Github to attribute the commit. As you push with your Github account in the repo, your account is associated with the PR but not the commits. See https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/managing-email-preferences/setting-your-commit-email-address and https://happygitwithr.com/hello-git.html for Git configuration explanation.

Also, it would be helpful for such PR is you use a specific branch instead of committing your change to your master. Right now, we have a lot more commit in this PR above than the real change this commits aims to make on master. This is not a real issue as we will squash the commits when the PR is merged, but it does not help to see quickly the relevant commit.

Thanks again for your PR.

@cderv
Copy link
Collaborator

cderv commented May 31, 2021

For a better understanding, Oxford university press article and elsevier are suppose to be the same, is that so ? Does your PR mean that we need to make them evolved the same way in the future ? I trying to understand why we have 2 templates if at the end they are quite similar.

I am also asking this because from the journal doc (https://academic.oup.com/journals/pages/authors/preparing_your_manuscript) it seems there is a CTAN package containing a template for this article (https://ctan.org/tex-archive/macros/latex/contrib/oup-authoring-template).

But you are the one using it so it is just for my own understanding about this template. I looked at the PR and everything LGTM

@dmkaplan2000
Copy link
Contributor Author

Thanks @dmkaplan2000 !

For a better understanding, Oxford university press article and elsevier are suppose to be the same, is that so ? Does your PR mean that we need to make them evolved the same way in the future ? I trying to understand why we have 2 templates if at the end they are quite similar.

No, OUP and Elsevier have nothing really to do with each other. All I am doing is making it so that essentially the same Rmarkdown document can be used for either journal with only minimal modifications. For example, in my original OUP template, I used the "authors" field for the authors, whereas the Elsevier template uses "author". Now I have synchronized my template with Elsevier's just to have fewer distinct formats for journals.

About the CLA signing and commit on Github, here are my takes. As you can see above, your commits are not associated with your Github user. We don't see you profile picture in the commit. You can click the commit to see this in more detail.
What is explained in https://docs.github.com/en/github/committing-changes-to-your-project/troubleshooting-commits/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user is that you may have not configured your local Git with the username and / or email address you use on Github. Git must be configured with username and email, and this is used by Github to attribute the commit. As you push with your Github account in the repo, your account is associated with the PR but not the commits. See https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/managing-email-preferences/setting-your-commit-email-address and https://happygitwithr.com/hello-git.html for Git configuration explanation.

OK, I see that, but what I don't see for the time being is an easy way to fix it. The instructions said that there is supposed to be a question mark near the commits explaining what the issue is, but I see no such question mark. I will look into it some more, but if there is any way to just accept the PR as is that would be great. The commits are all mine, it is just an issue with different usernames on the different machines I use.

Also, it would be helpful for such PR is you use a specific branch instead of committing your change to your master. Right now, we have a lot more commit in this PR above than the real change this commits aims to make on master. This is not a real issue as we will squash the commits when the PR is merged, but it does not help to see quickly the relevant commit.

OK, will do this for the future, but do you want me to try to fix this for this PR (with not being the preferred answer)?

Thanks again for your PR.

@dmkaplan2000
Copy link
Contributor Author

For a better understanding, Oxford university press article and elsevier are suppose to be the same, is that so ? Does your PR mean that we need to make them evolved the same way in the future ? I trying to understand why we have 2 templates if at the end they are quite similar.

I am also asking this because from the journal doc (https://academic.oup.com/journals/pages/authors/preparing_your_manuscript) it seems there is a CTAN package containing a template for this article (https://ctan.org/tex-archive/macros/latex/contrib/oup-authoring-template).

But you are the one using it so it is just for my own understanding about this template. I looked at the PR and everything LGTM

As you can see from the CTAN package, it was quite recently added and to be honest I was unaware of this change in their format. I published an article in an OUP journal using the old template (via Rmarkdown) after this CTAN package became available (https://doi.org/10.1093/icesjms/fsaa216), so I know they are still accepting it. What I would suggest is that you accept this PR and then I work on another PR to adapt to this new template.

@cderv cderv changed the title Update to OUP format to make skeleton.Rmd largely compatible with elsevier format Update OUP format to make compatible with elsevier format May 31, 2021
@cderv cderv merged commit f7751fd into rstudio:master May 31, 2021
@cderv
Copy link
Collaborator

cderv commented May 31, 2021

I published an article in an OUP journal using the old template (via Rmarkdown) after this CTAN package became available

Good to know! I just merged then.

What I would suggest is that you accept this PR and then I work on another PR to adapt to this new template.

Please do ! We welcome a new PR. (don't forget to use a new branch for this as it will be easier to review).

Thanks again for this PR @dmkaplan2000 !

@dmkaplan2000
Copy link
Contributor Author

dmkaplan2000 commented May 31, 2021 via email

@cderv
Copy link
Collaborator

cderv commented May 31, 2021

  1. As the template is on CTAN, I am no longer supposed to include the
    cls file in rticles, correct?

Yes exactly.

  1. The new template has a number of options that were simply absent from
    the previous template, so if I update to the new template I will
    probably have to break backward compatibility in some way. Is there a
    preferred way to do this, for example, keeping the old oup_article style
    and making a oup_author_template_article style?

This is a good question. I think we need to take the decision based on the real differences between the template. Absent options in previous template could have defaults is not provided for example. If there is no other way than having breaking change, we'll need to thing of the best way to do so. Having a new function is not really the way. I would thing an argument in the function (like version or else) that would allow to switch between old and new template - it would select the right file for example.

However, the aim of rticles package is to be able to write articles to publish in Journals so I would not mind breaking old Rmd documents if to publish to OUP you need to us the new templates only. Users who want to re-render an old report created with articles could install the version of rticles that works for them. Am I wrong to think that ?

Anyway, if we could avoid in hard change and breakage, it is best to do so.

I am not sure if this is the place, but I have a couple of quick
questions regarding updating to the newest OUP template:

You can open a new issue about this updates and we can discuss there as needed.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2021
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.

4 participants