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

Add TRB Article Template #427

Merged
merged 52 commits into from
Nov 25, 2021
Merged

Add TRB Article Template #427

merged 52 commits into from
Nov 25, 2021

Conversation

gregmacfarlane
Copy link
Contributor

This article template is in response to #426

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):

  • 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 [email protected].

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

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

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

  • Add a description of the template inst/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 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()).

  • 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!

@asiripanich
Copy link

Thank you @gregmacfarlane, this is a great addition to rticles for transport people! :)

@asiripanich
Copy link

Just a small suggestion, how about we use knitr::kable() instead of kableExtra::kbl() and base::plot() instead of ggplot()? This won't require the user to install additional packages for the article to compile.

@asiripanich
Copy link

asiripanich commented Jul 26, 2021

One other thing that I have spotted, shouldn't [@reference] omit authors?

Bibliography styles
===================

TRB still wants numbered, unsorted citations. Here are two sample references: [@Feynman1963118; @Dirac1953888].
You can also cite authors, like @Feynman1963118.

image

@gregmacfarlane
Copy link
Contributor Author

Yes, I think removing the dependencies for ggplot and kableExtra is a good idea. Yes, [@author] should probably omit the authors. I'll have a look at this later.

@gregmacfarlane gregmacfarlane marked this pull request as ready for review July 27, 2021 17:27
@cderv cderv linked an issue Jul 28, 2021 that may be closed by this pull request
6 tasks
Copy link
Collaborator

@cderv cderv left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution !

I have made a few comments and suggestions. Happy to discuss!

Thanks!

NEWS.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
R/article.R Outdated Show resolved Hide resolved
inst/rmarkdown/templates/trb/skeleton/trbarticle.cls Outdated Show resolved Hide resolved
inst/rmarkdown/templates/trb/template.yaml Outdated Show resolved Hide resolved
inst/rmarkdown/templates/trb/skeleton/skeleton.Rmd Outdated Show resolved Hide resolved
inst/rmarkdown/templates/trb/skeleton/skeleton.Rmd Outdated Show resolved Hide resolved
inst/rmarkdown/templates/trb/skeleton/skeleton.Rmd Outdated Show resolved Hide resolved
inst/rmarkdown/templates/trb/skeleton/skeleton.Rmd Outdated Show resolved Hide resolved

TRB still wants numbered, unsorted citations. Here are two sample references: [@Feynman1963118; @Dirac1953888].
You can also cite authors, like @Feynman1963118.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We could add more example of content like equation and custom blocks using Markdown syntax.
This would allow to add the missing section from the template
What do you think ?

Suggested change
# Equations
Intelligent driver model equations from wikipedia (<https://en.wikipedia.org/wiki/Intelligent_driver_model>) moved to the left using \verb1amsmath1 package with \verb1fleqn1 options.
\begin{linenomath}
\begin{flalign}
&\dot{x}_\alpha = \frac{\mathrm{d}x_\alpha}{\mathrm{d}t} = v_\alpha \\
&\dot{v}_\alpha = \frac{\mathrm{d}v_\alpha}{\mathrm{d}t} = a\,\left( 1 - \left(\frac{v_\alpha}{v_0}\right)^\delta - \left(\frac{s^*(v_\alpha,\Delta v_\alpha)}{s_\alpha}\right)^2 \right)
\end{flalign}
\end{linenomath}
[Custom blocks](https://bookdown.org/yihui/rmarkdown-cookbook/custom-blocks.html) can also be used to create LaTeX environment but keep a markdown syntax within it.
:::: {.linenomath latex=true}
$$
s^*(v_\alpha,\Delta v_\alpha) = s_0 + v_\alpha\,T + \frac{v_\alpha\,\Delta v_\alpha}{2\,\sqrt{a\,b}}
$$
:::
# Conclusion
This conclude the presentation of this template
# Acknowledgements
Thanks to Gregory Macfarlane who created this **rticles** template in 2021.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think adding math is a good idea. I've added the template authors contribute statement and moved the history stuff to acknowledgements.

@cderv
Copy link
Collaborator

cderv commented Sep 7, 2021

Hi @gregmacfarlane !

As I am going through opened PR while preparing next rticles, I would like to know the status of this PR.
Do you plan to keep working on it following the review ?
No hurry, just want to check the status of this PR.

Thank you.

@gregmacfarlane
Copy link
Contributor Author

I am working on it today, might be able to knock some things out.

Co-authored-by: Christophe Dervieux <[email protected]>
@gregmacfarlane
Copy link
Contributor Author

Okay, @cderv ; I think this is now ready to roll. Have another look, and I'm happy to continue the discussion.

Copy link
Collaborator

@cderv cderv 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 !

I made small tweak before merging.

If we need to improve later, we'll do it in another PR.

[skip ci]
@cderv cderv changed the title TRB Article Template Add TRB Article Template Nov 25, 2021
@cderv cderv merged commit ac55e55 into rstudio:master Nov 25, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2022
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.

Transportation Research Board Template
3 participants