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

Format for AAAS Science Journal #373

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft

Conversation

sasank89
Copy link

@sasank89 sasank89 commented Feb 11, 2021

Hi! @cderv

This is in reference to issue #320 . I have tried to do what I can. I do have some doubts which are given in /templates/science/resources/doubts.md. I have added my doubts in detail to the individual things below.

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.

Have done this bit. I am not sure how to word the function. Is this the function that is responsible for generating the output. I am not clearly understanding how the data is flowing through this.

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

Added. I also included the original template from the Science website

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

Added. Might update this as rest changes.

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

Not yet done.

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

Not yet done. Will do once the template etc is finalised.

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

Not yet done.

Thank you so much for any guidance to improve this and help me close this PR.

@CLAassistant
Copy link

CLAassistant commented Feb 11, 2021

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 3 committers have signed the CLA.

✅ cderv
❌ Sasank
❌ sasank89


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

@sasank89 sasank89 closed this Feb 12, 2021
@sasank89 sasank89 reopened this Feb 12, 2021
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.

Hi,

Thank you for this first draft!

I tried to answer most of your questions.

With there special workflow to not include images, this is not an easy template. One the workflow is correctly known and understood, I believe setting some knitr option and maybe pre/post processor for rmarkdown would do the job.

This could be tricky to automate maybe. so the idea of the after_body content to be written in another file manually could be simpler.

I let you see what you want to do with all this.

Thanks.

inst/rmarkdown/templates/science/template.yaml Outdated Show resolved Hide resolved
inst/rmarkdown/templates/science/template.yaml Outdated Show resolved Hide resolved
@@ -0,0 +1,5 @@
1. Need a help to figure out how to create a pandoc template for the author's section
2. Is there a way to get Pandoc to render all images at the end?
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you mean by that exactly ? Not sure to understand.

It would not be Pandoc but knitr or rmarkdown. Maybe this format would require a more advanced pre process and post process as other formats in the rticles package. If so, this would be done on the R side.

If you explain more precisely I can guide you.

Copy link
Author

Choose a reason for hiding this comment

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

The journal requirements for figures are as follows -

If the manuscript is an initial submission, you should include figures within the PDF file that you upload, preferably at the end of the text.
For the final submission (after peer review)- Save your figures as separate files, using Science's guidelines for preparing figures, and upload the figures separately with figure captions at the end of your LaTeX file as ordinary text (i.e., do not use the {figure} environment)

So, my thought was to let the author set a variable to either "Draft" or "Final" in the YAML header and then compile the document as needed without having to change the primary rmarkdown file.

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 a good thought. I hope this will be possible to do so. You may try. I think it will need to be in the R function that would set or unset a value of a knitr option. It could also be a variable set in the setup chunk to use in chunks with figures. This variable would modify the value of the chunk option accordingly. I let you try what you think is better.

But Pandoc itself won't be able to do that (unless maybe using a Lua filter, but it seems too much)

Comment on lines +3 to +4
3. Problem is that they want figures rendered for the initial draft / peer review, but no figures included for the final version -
- potential solution - get pandoc variable "figures:true" to decide if images should be included in the PDF or not
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would need to be controlled by knitr options I think. For example fig.show = "hide" would generate the figure but not include them in the document.

What should the output document look like ? No figure inside the document but what in replacement ?

2. Is there a way to get Pandoc to render all images at the end?
3. Problem is that they want figures rendered for the initial draft / peer review, but no figures included for the final version -
- potential solution - get pandoc variable "figures:true" to decide if images should be included in the PDF or not
4. In which format does science want references? is there a custom csl file - There only appears to be Science.bst file?
Copy link
Collaborator

Choose a reason for hiding this comment

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

.bst file is enough for the style. This command in the template

\bibliographystyle{Science}

is the one that should set the style.

Comment on lines +27 to +28
type: REVIEW/ARTICLE
figures: true / false [required to decide initial submission vs final draft]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure this is needed either.

If you need to show examples in the Rmd, do not use a this / that syntax. It should be valid YAML

figures: true # use false to ...

R/article.R Outdated Show resolved Hide resolved
#' @export
#' @rdname article
science_article <- function(
..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious why this extension needs to be unset ?

..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris")
) {
pdf_document_format(
"science", md_extensions = md_extensions, ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

keep_tex is defined above but is missing

Suggested change
"science", md_extensions = md_extensions, ...
"science", keep_tex = keep_tex, md_extensions = md_extensions, ...

@cderv
Copy link
Collaborator

cderv commented Sep 7, 2021

Hi @sasank89 !

Just a friendly ping. Are you planning to keep working on this branch to add the AAAS template ?

Just in order to know what are the plan on this one.

Thanks.

@cderv
Copy link
Collaborator

cderv commented Nov 29, 2021

Hi @sasank89,

I have merge master branch into this PR so that it is easier to start on better grounds next time you'll work on this.

Do you plan to continue this PR any time soon ?

No rush, just to know the status on this.

Comment on lines +50 to +59
\author
{John Smith,$^{1\ast}$ Jane Doe,$^{1}$ Joe Scientist$^{2}$\\
\\
\normalsize{$^{1}$Department of Chemistry, University of Wherever,}\\
\normalsize{An Unknown Address, Wherever, ST 00000, USA}\\
\normalsize{$^{2}$Another Unknown Address, Palookaville, ST 99999, USA}\\
\\
\normalsize{$^\ast$To whom correspondence should be addressed; E-mail: [email protected].}
}

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 we have CI error because of this here: $ cant be used as is in the template because it has special meanings. You need to escape that as Pandoc expects it: https://pandoc.org/MANUAL.html#delimiters

@sasank89
Copy link
Author

sasank89 commented Jan 1, 2022

Hi @cderv ,

So sorry I dropped off for a few months. Unfortunately, I did not get much time to work on this the past few months. I do want to work on it and complete it. Hopefully, I will be able to do more in the coming months.

@cderv
Copy link
Collaborator

cderv commented Jan 3, 2022

Hi @sasank89,

No problem. Take your time on it, I am in no hurry. I'll just continue to ping once in a while to get status update so that I know if this becomes stale or not.

Happy to help in any way, so please do ping me for anything that I could help with to add this article format.

Thanks for your time and work on this !

@cderv
Copy link
Collaborator

cderv commented Aug 25, 2022

@sasank89 Just to share that there is another try at this in #486

@cderv cderv added the WIP label Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants