-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
842bf8f
commit 9733376
Showing
3 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#' A Generic, Publisher-Independent Template for Writing Scientific Documents in | ||
#' 'rmarkdown' | ||
#' | ||
#' This package provides a 'rmarkdown' template for authoring scientific documents | ||
#' that is publisher independent. Though the template can be used by itself | ||
#' for many types of scientific documents and likely for submitting publications | ||
#' to many journals, it is primarily intended as a starter format for writing a | ||
#' scientific publication before one has chosen a specific target journal. | ||
#' Once an article has been written, the format can be quickly adapted for use | ||
#' with the [rticles][rticles::oup_article()] package. See the package vignette | ||
#' for more details. | ||
#' | ||
#' \tabular{ll}{ Package: \tab starticles\cr Type: \tab Package\cr Version: | ||
#' \tab 0.1\cr Date: \tab 2022-06-07\cr License: \tab GPL (>= 3)\cr } | ||
#' | ||
#' @author David M. Kaplan \email{dmkaplan2000@@gmail.com} | ||
#' | ||
#' @name starticles | ||
#' @docType package | ||
#' @title A Generic, Publisher-Independent Template for Writing Scientific Documents in 'rmarkdown' | ||
#' @keywords package | ||
#' @example tests/test.starticles.R | ||
#' | ||
#' @seealso `browseVignettes("starticles")`, [rmarkdown][rmarkdown::rmarkdown-package()], [rticles][rticles::oup_article()] | ||
NULL |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Use a temporary directory ---------------------------- | ||
owd = getwd() | ||
td = tempfile() | ||
dir.create(td,recursive=TRUE) | ||
setwd(td) | ||
print(td) # To see where files will be | ||
|
||
# Create the draft template ---------------------------- | ||
rmarkdown::draft("MYARTICLENAME.Rmd","generic_article","starticles",edit=FALSE) | ||
|
||
# Render PDF document ---------------------------------- | ||
# Fails for me when run using RStudio "Run examples" link in help, | ||
# but not when sourced from command line. | ||
|
||
# Requires recent version of pandoc (provided by RStudio) | ||
if (rmarkdown::pandoc_available(version="2.17")) | ||
rmarkdown::render("MYARTICLENAME/MYARTICLENAME.Rmd", | ||
envir=new.env(parent = globalenv())) | ||
|
||
# Return to orignal workind directory ------------------ | ||
setwd(owd) |