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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export(rjournal_article)
export(rsos_article)
export(rss_article)
export(sage_article)
export(science_article)
export(sim_article)
export(springer_article)
export(tf_article)
Expand Down
14 changes: 14 additions & 0 deletions R/article.R
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,20 @@ sage_article <- function(..., highlight = NULL, citation_package = "natbib") {
)
}

#' @section `science_article`: Format for AAAS - Science articles
#' Based on the official Science Journal LaTeX guidelines
#' <http://www.sciencemag.org/authors/preparing-manuscripts-using-latex>.
#'
#' @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 ?

) {
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, ...

)
}

#' @section `sim_article`: Format for creating submissions to Statistics in
#' Medicine. Based on the official Statistics in Medicine
#' [class](http://onlinelibrary.wiley.com/journal/10.1002/(ISSN)1097-0258/homepage/la_tex_class_file.htm).
Expand Down
5 changes: 5 additions & 0 deletions inst/rmarkdown/templates/science/resources/doubts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1. Need a help to figure out how to create a pandoc template for the author's section
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 they don't have a clever system for authors. It is written as is in the template

% Place the author information here.  Please hand-code the contact
% information and notecalls; do *not* use \footnote commands.  Let the
% author contact information appear immediately below the author names
% as shown.  We would also prefer that you don't change the type-size
% settings shown here.

\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].}
}

You just need to replace this by some variable to set in the YAML header (could be several) and a for loop maybe in the template.
It seems less clean than other template because they have only one call to \author for several authors. So you won't be able to use the current YAML organisation I think.

Maybe something like

authors: 
 - John Smith,$^{1\ast}$
 - Jane Doe,$^{1}$
 - Joe Scientist$^{2}$
addresses: 
  - $^{1}$Department of Chemistry, University of Wherever,
  - An Unknown Address, Wherever, ST 00000, USA
  - $^{2}$Another Unknown Address, Palookaville, ST 99999, USA
corresponding_author: |
  $^\ast$To whom correspondence should be addressed; E-mail:  [email protected].

would lead to this

$if(authors)$
\author{
$for(authors)$$authors$$sep$ $endfor$\\
\\
$for(addresses)$
\normalsize{$addresses$}$sep$\\
$endfor$
\\
\\
$if(corresponding_author)$
\normalsize{$corresponding_author$}
$endif$
}
$endif$

or something else. Just try something that works.

Have you look at other templates to have ideas ?

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)

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
Comment on lines +3 to +4
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 ?

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.

Loading