pinp is not PNAS

Introduction

The pinp is not PNAS template extends and reworks the pnas_article template from the wonderful rticles package. This vignette aims to list all the available option in order to provide both a reference documentation, and a simple introduction. The source of this vignette is of course included in the package itself.

YAML Content

author

Fields name and affiliation must be given. The latter can be a single-letter index referring to the address field described in the next paragraph.

address

Fields code (referring to the index from affiliation) and address must be given. The latter is free-form, and may include \url{} and other LaTeX macros.

lead_author_surnames

A free-form field usable for either a simple “Author et al”, or a simple text field listing two or more authors. This field is not post-processed.

abstract

A short free-form abstract can be used to inform the reader of the essence of the subsequent document.

acknowledgements

An optional free-form text which will be typset at the very end of the document right before the (optional also) references.

keywords

An optional list (entered as a YAML list following - marks) which will be typeset as a list of alternatives separated by vertical pipe symbols.

Options

fontsize

Default it 9pt, also supported are 10pt, 11pt and 12pt which may make sense in one-column mode.

one_column

An optional override (using value true) for the default two-column layout. Useful for initial stages of a document, as well as for documents with wide-format tables and figures.

lineno

An optional selection (via value true) of line numbers, selectable only if one_column: true is set. Currently typesets number on both the left and right-hand side which seems in error.

one_sided

An optional selection (via value true) of one-sided rather than two-sided output. This should probably alter the footnote but does not currently do so.

numbersections

An optional selection (via value true) for overriding the default unnumbered section headers. Useful if you need to refer to sections by number.

secnumdepth

An optional selection (via values 1, 2, 3, …) of section numbering depth, selectable only if numbersections: true is set. Useful if you only want to number sections and subsections but not subsubsections and so on.

skip_final_break

An optional selection (via value true) that avoids inserting a \pnasbreak at the end of the document. This is useful when dealing with float issues that may appear at the end of documents with acknowledgements and bibliographies.

bibliography

A field for an optional selection of a Bibtex input file, extension can be omitted. Alternative, bibliographic information may also be included directly as a thebibliography environment by including the content of the generated bbl file. The after_body include of the YAML header can also be used.

watermark

An optional selection of a ‘Draft’ watermark drawn across the center of the page (using value true). Note that figures may be plotted above the watermark.

date_subtitle

An optional free-form text string. Could be used, for example, to mention the bibliographic info in a post-print. If not specified, defaults to “This version was compiled on {current date}”

document_date

An optional free-form text string designed to specify the date of the document. It can be useful for example to specify the exact date of the publication in a post-print. If not specified, defaults to the current date.

Code

Knitr

The knitr package is also available to both typeset code, typically in R or one of the other supported engines. Knitr segments used three backticks (just like Pandoc described below) followed by curly brace sgement listing first the desired engine, and then the selected display options. Output from the code can also be shown, and a myriad of options permit many variants.

a <- 2 + 2
a
## [1] 4

Output from such code blocks is also shown in a framed and shaded box. Code segments containing plots producing figures results in these figures being automatically inlined:

set.seed(42)
par(mar=c(3,3,3,0))
plot(cumsum(rnorm(100)), type='l',
     main="Up and and away")

Pandoc

The easiest way to typeset code is to simply open three backticks followed by the name of one of the numerous built-in pandoc parsers, i.e., to typeset in the C languags.

/* this is a C function example */
int doubleMe(int x) {
    return x + x;          
}

Pandoc segments are highlighted as usual, and per a convention in this template also shown in a framed and slightly shaded box as seen here and above.

Another example from Python:

# A Python example
def printSomething(str):
   "This prints the string passed in"
   print str
   

Environments

Standard LaTeX

All standard LaTeX environment are directly usable if needed, including of course all mathematical environments and symbols such as, say, the greek lettering: α, β, γ, and so on.

The following is set as usual via the displaymath environment:

figure*

Figure can span two columns (when the default two-column mode is used) by using a (LaTeX) \begin{figure*} ... \end{figure*\it} environment, . Figures will then be floats in the LaTeX sense and place at the top or bottom of the page. An example is given by the skeleton document of the package. Similarly, \begin{figure*} ... \end{figure*} could be used around a wide table structure.

widetext

The \begin{widetext} ... \end{widetext} environment can be used to break text from two-column mode to one-column mode and back. As of the 2018 release of the underlying PNAS macros, this feature is deprecated upstream. But both the figure* and table* environments work, as does relying on commands \onecolumn and \twocolumn.

Other Help

RMarkdown

The rmarkdown site by RStudio is very comprehensive and can answer many questions pertaining to Markdown processing in R using the rmarkdown package.

LaTeX

Ultimately, this style uses LaTeX to produce the pdf output. The tex StackExchange can be very helpful for specific LaTeX questions.