-
Notifications
You must be signed in to change notification settings - Fork 520
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
base: main
Are you sure you want to change the base?
Conversation
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. |
There was a problem hiding this 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.
@@ -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? |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
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 |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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.
type: REVIEW/ARTICLE | ||
figures: true / false [required to decide initial submission vs final draft] |
There was a problem hiding this comment.
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 ...
#' @export | ||
#' @rdname article | ||
science_article <- function( | ||
..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris") |
There was a problem hiding this comment.
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, ... |
There was a problem hiding this comment.
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
"science", md_extensions = md_extensions, ... | |
"science", keep_tex = keep_tex, md_extensions = md_extensions, ... |
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]>
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. |
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. |
\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].} | ||
} | ||
|
There was a problem hiding this comment.
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
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. |
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 ! |
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 toR/article.R
if the output format is simple enough, otherwise create a separateR/journalname_article.R
.inst/rmarkdown/templates/journalname/resources/template.tex
.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 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 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).
tests/testit/test-formats.R
by adding a linetest_format("journalname")
. We try to keep them in alphabetical order.Authors@R
in DESCRIPTION. You don't need to bump the package version in DESCRIPTION.Thank you so much for any guidance to improve this and help me close this PR.