Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update to elsevier template#467

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
cderv merged 17 commits intorstudio:masterfromrobjhyndman:master
Feb 10, 2022
Merged

Update to elsevier template#467

cderv merged 17 commits intorstudio:masterfromrobjhyndman:master
Feb 10, 2022

Conversation

@robjhyndman
Copy link
Contributor

@robjhyndmanrobjhyndman commentedFeb 9, 2022
edited
Loading

How to contribute a new output format ?

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

  • 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 theindividual orcorporate contributor agreement. You can send the signed copy tojj@rstudio.com.

  • Add thejournalname_article() function toR/article.R if the output format is simple enough, otherwise create a separateR/journalname_article.R.

  • Document your function usingroxygen2. Markdown syntax is supported. Refer tohttps://roxygen2.r-lib.org/articles/rd-formatting.html for formatting references.

  • Add the Pandoc LaTeX templateinst/rmarkdown/templates/journalname/resources/template.tex.

  • Add a skeleton articleinst/rmarkdown/templates/journalname/skeleton/skeleton.Rmd.

  • Add a description of the templateinst/rmarkdown/templates/journalname/template.yaml.

  • 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 viatinytex::parse_packages(files = "FILENAME"") (e.g., whenFILENAME isplain.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).

  • Update Rd and namespace (could be done bydevtools::document()).

  • Update NEWS.

  • 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).

  • Add a test totests/testit/test-formats.R by adding a linetest_format("journalname"). We try to keep them in alphabetical order.

  • Add your name to the list of authorsAuthors@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!

@robjhyndman
Copy link
ContributorAuthor

As per#396

@cdervcderv linked an issueFeb 9, 2022 that may beclosed by this pull request
3 tasks
Copy link
Collaborator

@cdervcderv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks a lot for tackling this. Here is a first review.

My main point of concerns is how I should handle potential breaking change for this format. Either the pandoc requirement, or the template change.

we don't have a good way to handle this currently. But maybe there is not so much user, and publishing to elservier would require the new template.

@cboettig do you have a thought on this as the first contributor to this template ?

@robjhyndman you can also add you on the README table.https://github.com/rstudio/rticles#templates

#' journals. Adapted from
#' <https://www.elsevier.com/authors/policies-and-guidelines/latex-instructions>.
#'
#' It requires a minimum version of 2.10 for Pandoc.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I need to think about this. I don't mind doing that for new articles formats, butelsevier_article() is not a new function. Adding this requirement will make this a breaking change. They would need to have a newer Pandoc. Version 2.10 is not that old "2020-06-29" and even if RStudio is shipping with recent version, there could be some users still using an older Pandoc.

Comment on lines -210 to +220
$if(keywords)$\begin{keyword}$for(keywords)$$keywords$$sep$$endfor$\end{keyword}$endif$
$if(keywords)$
\begin{keyword}
$for(keywords/allbutlast)$$keywords$\sep$endfor$
$for(keywords/last)$$keywords$$endfor$
\end{keyword}
$endif$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is the part where Pandoc 2.10 is required right ?

So that we havekeyword1 \sep keyword2 and notkeyword1 \sep keyword2 \sep ?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes, that's the only place that requires pandoc 2.10. I can't think of another way to do it without the user explicitly adding the \sep separators which is a bit ugly.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

yes this is cleaner, but it brings a pretty recent version of Pandoc as a requirement for this template.
You have concerns aboutelsarticle.cls being outdated on some Linux distribution and that user won't update. Shouldn't we have the same concerns regarding Pandoc ?

If we consider thatrticles users are mainly RStudio users, a pandoc version > 2.10 is available since last release. And next release with upgraded version should be soon. So we can set the minimum requirement and see if someone complain.

Other option would be indeed to have a comment in YAML header to ask user to add\sep at the end of the last keyword, or do that ourself in the format by modifying the metadata before doing conversion with Pandoc.

@cboettig
Copy link
Contributor

@cderv I don't have any deep insights here (been too long since I was up-to-date on changes to pandoc etc), but perhaps it is worth introducing a version number to the template rather than creating a breaking change?elsevier_article2?

Personally I don't have too many reservations though about requiring the newer version of pandoc going forward without that (particularly if RStudio is shipping with a recent enough version of pandoc). I have plenty of old papers/drafts using the old template, but those usually need to run in version-locked environments anyway as changes to packages or even LaTeX style files can break those builds.

@cderv
Copy link
Collaborator

Thanks for the feedback.

perhaps it is worth introducing a version number to the template rather than creating a breaking change? elsevier_article2?

That is one option. We did that foroup_article() by introducing the version scheme as an argument. Not straightforward.

I have plenty of old papers/drafts using the old template, but those usually need to run in version-locked environments anyway as changes to packages or even LaTeX style files can break those builds.

I like this - Maybe I should add a vignette or other documentation to recommend usingrenv withrticles project so that one can rerun an article with a fixedrticles version. This would allow us to be less conservative about changes in the template.

Considering this, I would go with the breaking change here.

@cdervcderv merged commit3cc8bfc intorstudio:masterFeb 10, 2022
@cderv
Copy link
Collaborator

Thanks@robjhyndman !

@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsAug 15, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@cdervcdervcderv approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Outdated elsarticle.cls

3 participants

@robjhyndman@cboettig@cderv

[8]ページ先頭

©2009-2025 Movatter.jp