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 Science Template #486

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open

Conversation

christopherkenny
Copy link

@christopherkenny christopherkenny commented May 1, 2022

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

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

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

  • Update Rd and namespace (could be done by devtools::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 to tests/testit/test-formats.R by adding a line test_format("journalname"). We try to keep them in alphabetical order.

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

christopherkenny and others added 30 commits July 11, 2021 02:31
Better look for titlepage
…e. Instead, in the final article, this will be its own text after the bibliography, along with funding, competing interests, etc..
fix
Do not put acknowledgements in a reference note
@CLAassistant
Copy link

CLAassistant commented May 1, 2022

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.
0 out of 2 committers have signed the CLA.

❌ christopherkenny
❌ kuriwaki
You have signed the CLA already but the status is still pending? Let us recheck it.

@cderv cderv mentioned this pull request May 2, 2022
@cderv cderv linked an issue May 2, 2022 that may be closed by this pull request
@cderv
Copy link
Collaborator

cderv commented Aug 25, 2022

Thanks @christopherkenny

Sorry for the delay on this one. We were focusing on other project and rticles was a bit on the side. It will took me more time than usual to review this. It seems the science template is quite complex but you manage to come around.

Did you already use it for article and to submit ?
I am just trying to evaluate how deep of a review and check I need to do here. You document is rendering to PDF and seems fine, I just don't know about Science journal.

@jcolomb as you opened #320 you may be interested to give this format a try maybe.

@cderv cderv mentioned this pull request Aug 25, 2022
11 tasks
@christopherkenny
Copy link
Author

Hi @cderv. No worries. Love the other projects going on at RStudio.

I've used it before for submission. It worked fine and there were no real complaints from the editor side. It's a bit of a weird template, as you saw. Happy to run any tests locally that might help you.

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.

Sorry for the delay on this. Hopefully you'll have time to consider the review and work with me on this one.

Main question: Am I that late on this that we need to consider updating the template and resources from https://www.science.org/content/page/preparing-manuscripts-using-latex ?

Thank you

R/science_article.R Outdated Show resolved Hide resolved
R/science_article.R Outdated Show resolved Hide resolved
R/science_article.R Outdated Show resolved Hide resolved
R/science_article.R Outdated Show resolved Hide resolved
R/science_article.R Outdated Show resolved Hide resolved
Comment on lines +62 to +64
if (!number_sections) {
temp_tex <- unnumber_sections(temp_tex)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand the purpose here is to have all the section unnumbered right ?

Just a reminder this can be done in Markdown with

# section {.unnumbered}

and this could be made a default by using a Lua filter to add the class on each header that needs it.

But I guess tex post processing is working well too

Comment on lines +204 to +206
\begin{scilastnote}
\item $acknowledgements$
\end{scilastnote}
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems the last template available at https://www.science.org/content/page/preparing-manuscripts-using-latex
does not have this part anymore. I wonder if we should update

Comment on lines +55 to +59
# Build Supplement
if (file.exists(paste0('supplement_', output_file))){
tinytex::latexmk(paste0('supplement_', filename),
base$pandoc$latex_engine, clean = clean)
}
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 external .tex file that you wan't to compile to other PDF while rendering this one, right ?

No Rmd file to render() using another template ?

Comment on lines +194 to +197
$if(bibliography)$
\bibliography{$bibliography$}
\bibliographystyle{Science}
$endif$
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think some conditional need to be made around natbib or biblatex. or the format function should only only natbib citation processing.

This is usual among other format if you look for example.

Even using csl file with Pandoc's citeproc won't work for this template as this will still insert those command I think.

Comment on lines +80 to +91
\begin{enumerate}
\item Please cite your references and notes in text {\it only\/} using
the standard \LaTeX\ \verb+\cite+ command, not another command
driven by outside macros.
\item Please separate multiple citations within a single \verb+\cite+
command using commas only; there should be {\it no space\/}
between reference keynames. That is, if you are citing two
papers whose bibliography keys are \texttt{keyname1} and
\texttt{keyname2}, the in-text cite should read
\verb+\cite{keyname1,keyname2}+, {\it not\/}
\verb+\cite{keyname1, keyname2}+.
\end{enumerate}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason to keep this all latex and not use Markdown list and other syntax ?

Just curious

@cderv cderv added the WIP label Apr 19, 2023
christopherkenny and others added 5 commits July 1, 2023 10:33
Co-authored-by: Christophe Dervieux <[email protected]>
Co-authored-by: Christophe Dervieux <[email protected]>
Co-authored-by: Christophe Dervieux <[email protected]>
Co-authored-by: Christophe Dervieux <[email protected]>
Co-authored-by: Christophe Dervieux <[email protected]>
@christopherkenny
Copy link
Author

Hi @cderv, it does look like they've changed the template in the last year or so, but it's more the same than not. I can work through your comments on it and update to the newer template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Waiting reviewee
Development

Successfully merging this pull request may close these issues.

AAAS science template
4 participants