diff --git a/NAMESPACE b/NAMESPACE index 47d0643d0..9aa51ea96 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/R/article.R b/R/article.R index a1d61ee3f..a5fa387b5 100644 --- a/R/article.R +++ b/R/article.R @@ -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 +#' . +#' +#' @export +#' @rdname article +science_article <- function( + ..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris") +) { + pdf_document_format( + "science", 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). diff --git a/inst/rmarkdown/templates/science/resources/doubts.md b/inst/rmarkdown/templates/science/resources/doubts.md new file mode 100644 index 000000000..cd6c3c71b --- /dev/null +++ b/inst/rmarkdown/templates/science/resources/doubts.md @@ -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? +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? \ No newline at end of file diff --git a/inst/rmarkdown/templates/science/resources/pandoc_default.tex b/inst/rmarkdown/templates/science/resources/pandoc_default.tex new file mode 100644 index 000000000..4f82107f9 --- /dev/null +++ b/inst/rmarkdown/templates/science/resources/pandoc_default.tex @@ -0,0 +1,454 @@ + +$if(fontfamily)$ + \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} +$else$ + \usepackage{lmodern} +$endif$ + +$if(linestretch)$ +\usepackage{setspace} +$endif$ + +\usepackage{ifxetex,ifluatex} +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc} + \usepackage[utf8]{inputenc} + \usepackage{textcomp} % provide euro and other symbols +\else % if luatex or xetex + +$if(mathspec)$ + \ifxetex + \usepackage{mathspec} + \else + \usepackage{unicode-math} + \fi +$else$ + \usepackage{unicode-math} +$endif$ + \defaultfontfeatures{Scale=MatchLowercase} + \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} +$if(mainfont)$ + \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} +$endif$ +$if(sansfont)$ + \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$} +$endif$ +$if(monofont)$ + \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$} +$endif$ +$for(fontfamilies)$ + \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$} +$endfor$ +$if(mathfont)$ + +$if(mathspec)$ + \ifxetex + \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} + \else + \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} + \fi +$else$ + \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} +$endif$ + +$endif$ +$if(CJKmainfont)$ + \ifxetex + \usepackage{xeCJK} + \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} + \fi +$endif$ +$if(luatexjapresetoptions)$ + \ifluatex + \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset} + \fi +$endif$ +$if(CJKmainfont)$ + \ifluatex + \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec} + \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} + \fi +$endif$ +\fi +$if(beamer)$ +$if(theme)$ +\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} +$endif$ +$if(colortheme)$ +\usecolortheme{$colortheme$} +$endif$ +$if(fonttheme)$ +\usefonttheme{$fonttheme$} +$endif$ + +$if(mainfont)$ + \usefonttheme{serif} % use mainfont rather than sansfont for slide text + $endif$ + +$if(innertheme)$ +\useinnertheme{$innertheme$} +$endif$ + +$if(outertheme)$ + \useoutertheme{$outertheme$} + $endif$ + +$endif$ + +% Use upquote if available, for straight quotes in verbatim environments +\IfFileExists{upquote.sty}{\usepackage{upquote}}{} +\IfFileExists{microtype.sty}{% use microtype if available + \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype} + \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts +}{} + +$if(indent)$ + +$else$ + +\makeatletter +\@ifundefined{KOMAClassName}{ + \IfFileExists{parskip.sty}{ + \usepackage{parskip} + }{% else + \setlength{\parindent}{0pt} + \setlength{\parskip}{6pt plus 2pt minus 1pt}} +}{ --if KOMA class + \KOMAoptions{parskip=half}} +\makeatother +$endif$ + +$if(verbatim-in-note)$ +\usepackage{fancyvrb} +$endif$ +\usepackage{xcolor} +\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available +\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} +\hypersetup{ +$if(title-meta)$ + pdftitle={$title-meta$}, +$endif$ +$if(author-meta)$ + pdfauthor={$author-meta$}, +$endif$ +$if(lang)$ + pdflang={$lang$}, +$endif$ +$if(subject)$ + pdfsubject={$subject$}, +$endif$ +$if(keywords)$ + pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$}, +$endif$ +$if(colorlinks)$ + colorlinks=true, + linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$, + filecolor=$if(filecolor)$$filecolor$$else$Maroon$endif$, + citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$, + urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$, +$else$ + hidelinks, +$endif$ + pdfcreator={LaTeX via pandoc}} +\urlstyle{same} % disable monospaced font for URLs +$if(verbatim-in-note)$ +\VerbatimFootnotes % allow verbatim text in footnotes +$endif$ +$if(geometry)$ +$if(beamer)$ +\geometry{$for(geometry)$$geometry$$sep$,$endfor$} +$else$ +\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} +$endif$ +$endif$ +$if(beamer)$ +\newif\ifbibliography +$endif$ +$if(listings)$ +\usepackage{listings} +\newcommand{\passthrough}[1]{#1} +\lstset{defaultdialect=[5.3]Lua} +\lstset{defaultdialect=[x86masm]Assembler} +$endif$ +$if(lhs)$ +\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} +$endif$ +$if(highlighting-macros)$ +$highlighting-macros$ +$endif$ +$if(tables)$ +\usepackage{longtable,booktabs,array} +$if(multirow)$ +\usepackage{multirow} +$endif$ +\usepackage{calc} % for calculating minipage widths +$if(beamer)$ +\usepackage{caption} +% Make caption package work with longtable +\makeatletter +\def\fnum@table{\tablename~\thetable} +\makeatother +$else$ +% Correct order of tables after \paragraph or \subparagraph +\usepackage{etoolbox} +\makeatletter +\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{} +\makeatother +% Allow footnotes in longtable head/foot +\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}} +\makesavenoteenv{longtable} +$endif$ +$endif$ +$if(graphics)$ +\usepackage{graphicx} +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} +\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} +\makeatother +% Scale images if necessary, so that they will not overflow the page +% margins by default, and it is still possible to overwrite the defaults +% using explicit options in \includegraphics[width, height, ...]{} +\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} +% Set default figure placement to htbp +\makeatletter +\def\fps@figure{htbp} +\makeatother +$endif$ +$if(links-as-notes)$ +% Make links footnotes instead of hotlinks: +\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} +$endif$ +$if(strikeout)$ +\usepackage[normalem]{ulem} +% Avoid problems with \sout in headers with hyperref +\pdfstringdefDisableCommands{\renewcommand{\sout}{}} +$endif$ +\setlength{\emergencystretch}{3em} % prevent overfull lines +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} +$if(numbersections)$ +\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$} +$else$ +\setcounter{secnumdepth}{-\maxdimen} remove section numbering +$endif$ + +$if(beamer)$ +$else$ +$if(block-headings)$ +% Make \paragraph and \subparagraph free-standing +\ifx\paragraph\undefined\else + \let\oldparagraph\paragraph + \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}} +\fi +\ifx\subparagraph\undefined\else + \let\oldsubparagraph\subparagraph + \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}} +\fi +$endif$ +$endif$ +$if(pagestyle)$ +\pagestyle{$pagestyle$} +$endif$ +$for(header-includes)$ +$header-includes$ +$endfor$ +$if(lang)$ +\ifxetex + % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic) + \usepackage{polyglossia} + \setmainlanguage[$for(polyglossia-lang.options)$$polyglossia-lang.options$$sep$,$endfor$]{$polyglossia-lang.name$} +$for(polyglossia-otherlangs)$ + \setotherlanguage[$for(polyglossia-otherlangs.options)$$polyglossia-otherlangs.options$$sep$,$endfor$]{$polyglossia-otherlangs.name$} +$endfor$ +\else + \usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} +% get rid of language-specific shorthands (see #6817): +\let\LanguageShortHands\languageshorthands +\def\languageshorthands#1{} +$if(babel-newcommands)$ + $babel-newcommands$ +$endif$ +\fi +$endif$ +\ifluatex + \usepackage{selnolig} % disable illegal ligatures +\fi +$if(dir)$ +\ifxetex + % Load bidi as late as possible as it modifies e.g. graphicx + \usepackage{bidi} +\fi +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \TeXXeTstate=1 + \newcommand{\RL}[1]{\beginR #1\endR} + \newcommand{\LR}[1]{\beginL #1\endL} + \newenvironment{RTL}{\beginR}{\endR} + \newenvironment{LTR}{\beginL}{\endL} +\fi +$endif$ +$if(natbib)$ +\usepackage[$natbiboptions$]{natbib} +\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$} +$endif$ +$if(biblatex)$ +\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex} +$for(bibliography)$ +\addbibresource{$bibliography$} +$endfor$ +$endif$ +$if(csl-refs)$ +\newlength{\cslhangindent} +\setlength{\cslhangindent}{1.5em} +\newlength{\csllabelwidth} +\setlength{\csllabelwidth}{3em} +\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing + {% don't indent paragraphs + \setlength{\parindent}{0pt} + % turn on hanging indent if param 1 is 1 + \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi + % set entry spacing + \ifnum #2 > 0 + \setlength{\parskip}{#2\baselineskip} + \fi + }% + {} +\usepackage{calc} +\newcommand{\CSLBlock}[1]{#1\hfill\break} +\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}} +\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break} +\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} +$endif$ +$if(csquotes)$ +\usepackage{csquotes} +$endif$ + +$if(title)$ +\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} +$endif$ +$if(subtitle)$ +$if(beamer)$ +$else$ +\usepackage{etoolbox} +\makeatletter +\providecommand{\subtitle}[1]{% add subtitle to \maketitle + \apptocmd{\@title}{\par {\large #1 \par}}{}{} +} +\makeatother +$endif$ +\subtitle{$subtitle$} +$endif$ +\author{$for(author)$$author$$sep$ \and $endfor$} +\date{$date$} +$if(beamer)$ +$if(institute)$ +\institute{$for(institute)$$institute$$sep$ \and $endfor$} +$endif$ +$if(titlegraphic)$ +\titlegraphic{\includegraphics{$titlegraphic$}} +$endif$ +$if(logo)$ +\logo{\includegraphics{$logo$}} +$endif$ +$endif$ + +\begin{document} +$if(has-frontmatter)$ +\frontmatter +$endif$ +$if(title)$ +$if(beamer)$ +\frame{\titlepage} +$else$ +\maketitle +$endif$ +$if(abstract)$ +\begin{abstract} +$abstract$ +\end{abstract} +$endif$ +$endif$ + +$for(include-before)$ +$include-before$ + +$endfor$ +$if(toc)$ +$if(toc-title)$ +\renewcommand*\contentsname{$toc-title$} +$endif$ +$if(beamer)$ +\begin{frame}[allowframebreaks] +$if(toc-title)$ + \frametitle{$toc-title$} +$endif$ + \tableofcontents[hideallsubsections] +\end{frame} +$else$ +{ +$if(colorlinks)$ +\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$} +$endif$ +\setcounter{tocdepth}{$toc-depth$} +\tableofcontents +} +$endif$ +$endif$ + +$if(lot)$ +\listoftables +$endif$ + +$if(lof)$ +\listoffigures +$endif$ + +$if(linestretch)$ +\setstretch{$linestretch$} +$endif$ +$if(has-frontmatter)$ +\mainmatter +$endif$ +$body$ + +$if(has-frontmatter)$ +\backmatter +$endif$ +$if(natbib)$ +$if(bibliography)$ +$if(biblio-title)$ +$if(has-chapters)$ +\renewcommand\bibname{$biblio-title$} +$else$ +\renewcommand\refname{$biblio-title$} +$endif$ +$endif$ +$if(beamer)$ +\begin{frame}[allowframebreaks]{$biblio-title$} + \bibliographytrue +$endif$ + \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} +$if(beamer)$ +\end{frame} +$endif$ + +$endif$ +$endif$ + +$if(biblatex)$ + +$if(beamer)$ +\begin{frame}[allowframebreaks]{$biblio-title$} + \bibliographytrue + \printbibliography[heading=none] +\end{frame} +$else$ +\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$ +$endif$ + +$endif$ + +$for(include-after)$ +$include-after$ +$endfor$ + +\end{document} \ No newline at end of file diff --git a/inst/rmarkdown/templates/science/resources/science_latex_template.tex b/inst/rmarkdown/templates/science/resources/science_latex_template.tex new file mode 100644 index 000000000..60d7fadf1 --- /dev/null +++ b/inst/rmarkdown/templates/science/resources/science_latex_template.tex @@ -0,0 +1,354 @@ +% Use only LaTeX2e, calling the article.cls class and 12-point type. + +\documentclass[12pt]{article} + +% Users of the {thebibliography} environment or BibTeX should use the +% scicite.sty package, downloadable from *Science* at +% http://www.sciencemag.org/authors/preparing-manuscripts-using-latex +% This package should properly format in-text +% reference calls and reference-list numbers. + +\usepackage{scicite} + +\usepackage{times} + +% The preamble here sets up a lot of new/revised commands and +% environments. It's annoying, but please do *not* try to strip these +% out into a separate .sty file (which could lead to the loss of some +% information when we convert the file to other formats). Instead, keep +% them in the preamble of your main LaTeX source file. + + +% The following parameters seem to provide a reasonable page setup. + +\topmargin 0.0cm +\oddsidemargin 0.2cm +\textwidth 16cm +\textheight 21cm +\footskip 1.0cm + + +%The next command sets up an environment for the abstract to your paper. + +\newenvironment{sciabstract}{% +\begin{quote} \bf} +{\end{quote}} + + + +% Include your paper's title here + +\title{A simple {\it Science\/} 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: jsmith@wherever.edu.} +} + +% Include the date command, but leave its argument blank. + +\date{} + + + +%%%%%%%%%%%%%%%%% END OF PREAMBLE %%%%%%%%%%%%%%%% + + + +\begin{document} + +% Double-space the manuscript. + +\baselineskip24pt + +% Make the title. + +\maketitle + + + +% Place your abstract within the special {sciabstract} environment. + +\begin{sciabstract} + This document presents a number of hints about how to set up your + {\it Science\/} paper in \LaTeX\ . We provide a template file, + \texttt{scifile.tex}, that you can use to set up the \LaTeX\ source + for your article. An example of the style is the special + \texttt{\{sciabstract\}} environment used to set up the abstract you + see here. +\end{sciabstract} + + + +% In setting up this template for *Science* papers, we've used both +% the \section* command and the \paragraph* command for topical +% divisions. Which you use will of course depend on the type of paper +% you're writing. Review Articles tend to have displayed headings, for +% which \section* is more appropriate; Research Articles, when they have +% formal topical divisions at all, tend to signal them with bold text +% that runs into the paragraph, for which \paragraph* is the right +% choice. Either way, use the asterisk (*) modifier, as shown, to +% suppress numbering. + +\section*{Introduction} + +In this file, we present some tips and sample mark-up to assure your +\LaTeX\ file of the smoothest possible journey from review manuscript +to published {\it Science\/} paper. We focus here particularly on +issues related to style files, citation, and math, tables, and +figures, as those tend to be the biggest sticking points. Please use +the source file for this document, \texttt{scifile.tex}, as a template +for your manuscript, cutting and pasting your content into the file at +the appropriate places. + +{\it Science\/}'s publication workflow relies on Microsoft Word. To +translate \LaTeX\ files into Word, we use an intermediate MS-DOS +routine \cite{tth} that converts the \TeX\ source into HTML\@. The +routine is generally robust, but it works best if the source document +is clean \LaTeX\ without a significant freight of local macros or +\texttt{.sty} files. Use of the source file \texttt{scifile.tex} as a +template, and calling {\it only\/} the \texttt{.sty} and \texttt{.bst} +files specifically mentioned here, will generate a manuscript that +should be eminently reviewable, and yet will allow your paper to +proceed quickly into our production flow upon acceptance \cite{use2e}. + +\section*{Formatting Citations} + +Citations can be handled in one of three ways. The most +straightforward (albeit labor-intensive) would be to hardwire your +citations into your \LaTeX\ source, as you would if you were using an +ordinary word processor. Thus, your code might look something like +this: + + +\begin{quote} +\begin{verbatim} +However, this record of the solar nebula may have been +partly erased by the complex history of the meteorite +parent bodies, which includes collision-induced shock, +thermal metamorphism, and aqueous alteration +({\it 1, 2, 5--7\/}). +\end{verbatim} +\end{quote} + + +\noindent Compiled, the last two lines of the code above, of course, would give notecalls in {\it Science\/} style: + +\begin{quote} +\ldots thermal metamorphism, and aqueous alteration ({\it 1, 2, 5--7\/}). +\end{quote} + +Under the same logic, the author could set up his or her reference list as a simple enumeration, + +\begin{quote} +\begin{verbatim} +{\bf References and Notes} + +\begin{enumerate} +\item G. Gamow, {\it The Constitution of Atomic Nuclei +and Radioactivity\/} (Oxford Univ. Press, New York, 1931). +\item W. Heisenberg and W. Pauli, {\it Zeitschr.\ f.\ +Physik\/} {\bf 56}, 1 (1929). +\end{enumerate} +\end{verbatim} +\end{quote} + +\noindent yielding + +\begin{quote} +{\bf References and Notes} + +\begin{enumerate} +\item G. Gamow, {\it The Constitution of Atomic Nuclei and +Radioactivity\/} (Oxford Univ. Press, New York, 1931). +\item W. Heisenberg and W. Pauli, {\it Zeitschr.\ f.\ Physik} {\bf 56}, +1 (1929). +\end{enumerate} +\end{quote} + + +That's not a solution that's likely to appeal to everyone, however --- +especially not to users of B{\small{IB}}\TeX\ \cite{inclme}. If you +are a B{\small{IB}}\TeX\ user, we suggest that you use the +\texttt{Science.bst} bibliography style file and the +\texttt{scicite.sty} package, both of which are downloadable from our author help site. +{\bf While you can use B{\small{IB}}\TeX\ to generate the reference list, please don't submit +your .bib and .bbl files; instead, paste the generated .bbl file into the .tex file, creating + \texttt{\{thebibliography\}} environment.} + You can also +generate your reference lists directly by using +\texttt{\{thebibliography\}} at the end of your source document; here +again, you may find the \texttt{scicite.sty} file useful. + +Whatever you use, be +very careful about how you set up your in-text reference calls and +notecalls. In particular, observe the following requirements: + +\begin{enumerate} +\item Please follow the style for references outlined at our author + help site and embodied in recent issues of {\it Science}. Each + citation number should refer to a single reference; please do not + concatenate several references under a single number. +\item The reference numbering continues from the +main text to the Supplementary Materials (e.g. this main +text has references 1-3; the numbering of references in the +Supplementary Materials should start with 4). +\item Please cite your references and notes in text {\it only\/} using + the standard \LaTeX\ \verb+\cite+ command, not another command + driven by outside macros. +\item Please separate multiple citations within a single \verb+\cite+ + command using commas only; there should be {\it no space\/} + between reference keynames. That is, if you are citing two + papers whose bibliography keys are \texttt{keyname1} and + \texttt{keyname2}, the in-text cite should read + \verb+\cite{keyname1,keyname2}+, {\it not\/} + \verb+\cite{keyname1, keyname2}+. +\end{enumerate} + +\noindent Failure to follow these guidelines could lead +to the omission of the references in an accepted paper when the source +file is translated to Word via HTML. + + + +\section*{Handling Math, Tables, and Figures} + +Following are a few things to keep in mind in coding equations, +tables, and figures for submission to {\it Science}. + +\paragraph*{In-line math.} The utility that we use for converting +from \LaTeX\ to HTML handles in-line math relatively well. It is best +to avoid using built-up fractions in in-line equations, and going for +the more boring ``slash'' presentation whenever possible --- that is, +for \verb+$a/b$+ (which comes out as $a/b$) rather than +\verb+$\frac{a}{b}$+ (which compiles as $\frac{a}{b}$). + Please do not code arrays or matrices as +in-line math; display them instead. And please keep your coding as +\TeX-y as possible --- avoid using specialized math macro packages +like \texttt{amstex.sty}. + +\paragraph*{Tables.} The HTML converter that we use seems to handle +reasonably well simple tables generated using the \LaTeX\ +\texttt{\{tabular\}} environment. For very complicated tables, you +may want to consider generating them in a word processing program and +including them as a separate file. + +\paragraph*{Figures.} Figure callouts within the text should not be +in the form of \LaTeX\ references, but should simply be typed in --- +that is, \verb+(Fig. 1)+ rather than \verb+\ref{fig1}+. For the +figures themselves, treatment can differ depending on whether the +manuscript is an initial submission or a final revision for acceptance +and publication. For an initial submission and review copy, you can +use the \LaTeX\ \verb+{figure}+ environment and the +\verb+\includegraphics+ command to include your PostScript figures at +the end of the compiled file. For the final revision, +however, the \verb+{figure}+ environment should {\it not\/} be used; +instead, the figure captions themselves should be typed in as regular +text at the end of the source file (an example is included here), and +the figures should be uploaded separately according to the Art +Department's instructions. + + + + + + + + +\section*{What to Send In} + +What you should send to {\it Science\/} will depend on the stage your manuscript is in: + +\begin{itemize} +\item {\bf Important:} If you're sending in the initial submission of + your manuscript (that is, the copy for evaluation and peer review), + please send in {\it only\/} a PDF version of the + compiled file (including figures). Please do not send in the \TeX\ + source, \texttt{.sty}, \texttt{.bbl}, or other associated files with + your initial submission. (For more information, please see the + instructions at our Web submission site.) +\item When the time comes for you to send in your revised final + manuscript (i.e., after peer review), we require that you include + source files and generated files in your upload. {\bf The .tex file should include +the reference list as an itemized list (see "Formatting citations" for the various options). The bibliography should not be in a separate file.} + Thus, if the + name of your main source document is \texttt{ltxfile.tex}, you + need to include: +\begin{itemize} +\item \texttt{ltxfile.tex}. +\item \texttt{ltxfile.aux}, the auxilliary file generated by the + compilation. +\item A PDF file generated from + \texttt{ltxfile.tex}. + +\end{itemize} +\end{itemize} + +% Your references go at the end of the main text, and before the +% figures. For this document we've used BibTeX, the .bib file +% scibib.bib, and the .bst file Science.bst. The package scicite.sty +% was included to format the reference numbers according to *Science* +% style. + +%BibTeX users: After compilation, comment out the following two lines and paste in +% the generated .bbl file. + +\bibliography{scibib} + +\bibliographystyle{Science} + + + + + +\section*{Acknowledgments} +Include acknowledgments of funding, any patents pending, where raw data for the paper are deposited, etc. + +%Here you should list the contents of your Supplementary Materials -- below is an example. +%You should include a list of Supplementary figures, Tables, and any references that appear only in the SM. +%Note that the reference numbering continues from the main text to the SM. +% In the example below, Refs. 4-10 were cited only in the SM. +\section*{Supplementary materials} +Materials and Methods\\ +Supplementary Text\\ +Figs. S1 to S3\\ +Tables S1 to S4\\ +References \textit{(4-10)} + + +% For your review copy (i.e., the file you initially send in for +% evaluation), you can use the {figure} environment and the +% \includegraphics command to stream your figures into the text, placing +% all figures at the end. For the final, revised manuscript for +% acceptance and production, however, PostScript or other graphics +% should not be streamed into your compliled file. Instead, set +% captions as simple paragraphs (with a \noindent tag), setting them +% off from the rest of the text with a \clearpage as shown below, and +% submit figures as separate files according to the Art Department's +% instructions. + + +\clearpage + +\noindent {\bf Fig. 1.} Please do not use figure environments to set +up your figures in the final (post-peer-review) draft, do not include graphics in your +source code, and do not cite figures in the text using \LaTeX\ +\verb+\ref+ commands. Instead, simply refer to the figure numbers in +the text per {\it Science\/} style, and include the list of captions at +the end of the document, coded as ordinary paragraphs as shown in the +\texttt{scifile.tex} template file. Your actual figure files should +be submitted separately. + +\end{document} \ No newline at end of file diff --git a/inst/rmarkdown/templates/science/resources/template.tex b/inst/rmarkdown/templates/science/resources/template.tex new file mode 100644 index 000000000..92a5fb064 --- /dev/null +++ b/inst/rmarkdown/templates/science/resources/template.tex @@ -0,0 +1,431 @@ +% Custom made Pandoc template made for RMarkdown +% Some parts of the code is customised/adapted/copied from the default pandoc LaTeX template found at https://github.com/jgm/pandoc-templates/blob/master/default.latex +% The template used is from https://www.sciencemag.org/authors/preparing-manuscripts-using-latex + +% The following code is copied over from the default LaTeX pandoc template linked above. + +% Options for packages loaded elsewhere +\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref} +\PassOptionsToPackage{hyphens}{url} +$if(colorlinks)$ +\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor} +$endif$ +$if(dir)$ +$if(latex-dir-rtl)$ +\PassOptionsToPackage{RTLdocument}{bidi} +$endif$ +$endif$ +$if(CJKmainfont)$ +\PassOptionsToPackage{space}{xeCJK} +$endif$ +\usepackage{amsmath,amssymb} + + +%%% END OF COPIED CODE %%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Use only LaTeX2e, calling the article.cls class and 12-point type. + +\documentclass[12pt]{article} + +% Users of the {thebibliography} environment or BibTeX should use the +% scicite.sty package, downloadable from *Science* at +% http://www.sciencemag.org/authors/preparing-manuscripts-using-latex +% This package should properly format in-text +% reference calls and reference-list numbers. + +\usepackage{scicite} + +\usepackage{times} + +% Pandoc citation processing +$if(csl-refs)$ +\newlength{\csllabelwidth} +\setlength{\csllabelwidth}{3em} +\newlength{\cslhangindent} +\setlength{\cslhangindent}{1.5em} +% for Pandoc 2.8 to 2.10.1 +\newenvironment{cslreferences}% + {$if(csl-hanging-indent)$\setlength{\parindent}{0pt}% + \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}% + {\par} +% For Pandoc 2.11+ +\newenvironment{CSLReferences}[3] % #1 hanging-ident, #2 entry spacing + {% don't indent paragraphs + \setlength{\parindent}{0pt} + % turn on hanging indent if param 1 is 1 + \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi + % set entry spacing + \ifnum #2 > 0 + \setlength{\parskip}{#2\baselineskip} + \fi + }% + {} +\usepackage{calc} % for calculating minipage widths +\newcommand{\CSLBlock}[1]{#1\hfill\break} +\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}} +\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}} +\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} +$endif$ + +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} + +% The preamble here sets up a lot of new/revised commands and +% environments. It's annoying, but please do *not* try to strip these +% out into a separate .sty file (which could lead to the loss of some +% information when we convert the file to other formats). Instead, keep +% them in the preamble of your main LaTeX source file. + + +% The following parameters seem to provide a reasonable page setup. + +\topmargin 0.0cm +\oddsidemargin 0.2cm +\textwidth 16cm +\textheight 21cm +\footskip 1.0cm + + +%The next command sets up an environment for the abstract to your paper. + +\newenvironment{sciabstract}{% +\begin{quote} \bf} +{\end{quote}} + + + +% Include your paper's title here + +$if(title)$ +\title{$title$} +$endif$ + +% 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. + +$if(author)$ +\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: jsmith@wherever.edu.} +} +$endif$ + +% Include the date command, but leave its argument blank. + +\date{} + + + +%%%%%%%%%%%%%%%%% END OF PREAMBLE %%%%%%%%%%%%%%%% + +\begin{document} + +% Double-space the manuscript. + +\baselineskip24pt + +% Make the title. +$if(title)$ +\maketitle +$endif$ + +% Place your abstract within the special {sciabstract} environment. +$if(abstract)$ +\begin{sciabstract} +$abstract$ +\end{sciabstract} +$endif$ + +% TO SET UP TWO TYPES OF ARTICLES - REVIEW / RESEARCH_ARTICLE +% +$if(type=review)$ + +$endif$ + +% In setting up this template for *Science* papers, we've used both +% the \section* command and the \paragraph* command for topical +% divisions. Which you use will of course depend on the type of paper +% you're writing. Review Articles tend to have displayed headings, for +% which \section* is more appropriate; Research Articles, when they have +% formal topical divisions at all, tend to signal them with bold text +% that runs into the paragraph, for which \paragraph* is the right +% choice. Either way, use the asterisk (*) modifier, as shown, to +% suppress numbering. + +$body$ + +\section*{Introduction} + +In this file, we present some tips and sample mark-up to assure your +\LaTeX\ file of the smoothest possible journey from review manuscript +to published {\it Science\/} paper. We focus here particularly on +issues related to style files, citation, and math, tables, and +figures, as those tend to be the biggest sticking points. Please use +the source file for this document, \texttt{scifile.tex}, as a template +for your manuscript, cutting and pasting your content into the file at +the appropriate places. + +{\it Science\/}'s publication workflow relies on Microsoft Word. To +translate \LaTeX\ files into Word, we use an intermediate MS-DOS +routine \cite{tth} that converts the \TeX\ source into HTML\@. The +routine is generally robust, but it works best if the source document +is clean \LaTeX\ without a significant freight of local macros or +\texttt{.sty} files. Use of the source file \texttt{scifile.tex} as a +template, and calling {\it only\/} the \texttt{.sty} and \texttt{.bst} +files specifically mentioned here, will generate a manuscript that +should be eminently reviewable, and yet will allow your paper to +proceed quickly into our production flow upon acceptance \cite{use2e}. + +\section*{Formatting Citations} + +Citations can be handled in one of three ways. The most +straightforward (albeit labor-intensive) would be to hardwire your +citations into your \LaTeX\ source, as you would if you were using an +ordinary word processor. Thus, your code might look something like +this: + + +\begin{quote} +\begin{verbatim} +However, this record of the solar nebula may have been +partly erased by the complex history of the meteorite +parent bodies, which includes collision-induced shock, +thermal metamorphism, and aqueous alteration +({\it 1, 2, 5--7\/}). +\end{verbatim} +\end{quote} + + +\noindent Compiled, the last two lines of the code above, of course, would give notecalls in {\it Science\/} style: + +\begin{quote} +\ldots thermal metamorphism, and aqueous alteration ({\it 1, 2, 5--7\/}). +\end{quote} + +Under the same logic, the author could set up his or her reference list as a simple enumeration, + +\begin{quote} +\begin{verbatim} +{\bf References and Notes} + +\begin{enumerate} +\item G. Gamow, {\it The Constitution of Atomic Nuclei +and Radioactivity\/} (Oxford Univ. Press, New York, 1931). +\item W. Heisenberg and W. Pauli, {\it Zeitschr.\ f.\ +Physik\/} {\bf 56}, 1 (1929). +\end{enumerate} +\end{verbatim} +\end{quote} + +\noindent yielding + +\begin{quote} +{\bf References and Notes} + +\begin{enumerate} +\item G. Gamow, {\it The Constitution of Atomic Nuclei and +Radioactivity\/} (Oxford Univ. Press, New York, 1931). +\item W. Heisenberg and W. Pauli, {\it Zeitschr.\ f.\ Physik} {\bf 56}, +1 (1929). +\end{enumerate} +\end{quote} + + +That's not a solution that's likely to appeal to everyone, however --- +especially not to users of B{\small{IB}}\TeX\ \cite{inclme}. If you +are a B{\small{IB}}\TeX\ user, we suggest that you use the +\texttt{Science.bst} bibliography style file and the +\texttt{scicite.sty} package, both of which are downloadable from our author help site. +{\bf While you can use B{\small{IB}}\TeX\ to generate the reference list, please don't submit +your .bib and .bbl files; instead, paste the generated .bbl file into the .tex file, creating + \texttt{\{thebibliography\}} environment.} + You can also +generate your reference lists directly by using +\texttt{\{thebibliography\}} at the end of your source document; here +again, you may find the \texttt{scicite.sty} file useful. + +Whatever you use, be +very careful about how you set up your in-text reference calls and +notecalls. In particular, observe the following requirements: + +\begin{enumerate} +\item Please follow the style for references outlined at our author + help site and embodied in recent issues of {\it Science}. Each + citation number should refer to a single reference; please do not + concatenate several references under a single number. +\item The reference numbering continues from the +main text to the Supplementary Materials (e.g. this main +text has references 1-3; the numbering of references in the +Supplementary Materials should start with 4). +\item Please cite your references and notes in text {\it only\/} using + the standard \LaTeX\ \verb+\cite+ command, not another command + driven by outside macros. +\item Please separate multiple citations within a single \verb+\cite+ + command using commas only; there should be {\it no space\/} + between reference keynames. That is, if you are citing two + papers whose bibliography keys are \texttt{keyname1} and + \texttt{keyname2}, the in-text cite should read + \verb+\cite{keyname1,keyname2}+, {\it not\/} + \verb+\cite{keyname1, keyname2}+. +\end{enumerate} + +\noindent Failure to follow these guidelines could lead +to the omission of the references in an accepted paper when the source +file is translated to Word via HTML. + + + +\section*{Handling Math, Tables, and Figures} + +Following are a few things to keep in mind in coding equations, +tables, and figures for submission to {\it Science}. + +\paragraph*{In-line math.} The utility that we use for converting +from \LaTeX\ to HTML handles in-line math relatively well. It is best +to avoid using built-up fractions in in-line equations, and going for +the more boring ``slash'' presentation whenever possible --- that is, +for \verb+$a/b$+ (which comes out as $a/b$) rather than +\verb+$\frac{a}{b}$+ (which compiles as $\frac{a}{b}$). + Please do not code arrays or matrices as +in-line math; display them instead. And please keep your coding as +\TeX-y as possible --- avoid using specialized math macro packages +like \texttt{amstex.sty}. + +\paragraph*{Tables.} The HTML converter that we use seems to handle +reasonably well simple tables generated using the \LaTeX\ +\texttt{\{tabular\}} environment. For very complicated tables, you +may want to consider generating them in a word processing program and +including them as a separate file. + +\paragraph*{Figures.} Figure callouts within the text should not be +in the form of \LaTeX\ references, but should simply be typed in --- +that is, \verb+(Fig. 1)+ rather than \verb+\ref{fig1}+. For the +figures themselves, treatment can differ depending on whether the +manuscript is an initial submission or a final revision for acceptance +and publication. For an initial submission and review copy, you can +use the \LaTeX\ \verb+{figure}+ environment and the +\verb+\includegraphics+ command to include your PostScript figures at +the end of the compiled file. For the final revision, +however, the \verb+{figure}+ environment should {\it not\/} be used; +instead, the figure captions themselves should be typed in as regular +text at the end of the source file (an example is included here), and +the figures should be uploaded separately according to the Art +Department's instructions. + + + + + + + + +\section*{What to Send In} + +What you should send to {\it Science\/} will depend on the stage your manuscript is in: + +\begin{itemize} +\item {\bf Important:} If you're sending in the initial submission of + your manuscript (that is, the copy for evaluation and peer review), + please send in {\it only\/} a PDF version of the + compiled file (including figures). Please do not send in the \TeX\ + source, \texttt{.sty}, \texttt{.bbl}, or other associated files with + your initial submission. (For more information, please see the + instructions at our Web submission site.) +\item When the time comes for you to send in your revised final + manuscript (i.e., after peer review), we require that you include + source files and generated files in your upload. {\bf The .tex file should include +the reference list as an itemized list (see "Formatting citations" for the various options). The bibliography should not be in a separate file.} + Thus, if the + name of your main source document is \texttt{ltxfile.tex}, you + need to include: +\begin{itemize} +\item \texttt{ltxfile.tex}. +\item \texttt{ltxfile.aux}, the auxilliary file generated by the + compilation. +\item A PDF file generated from + \texttt{ltxfile.tex}. + +\end{itemize} +\end{itemize} + +% Your references go at the end of the main text, and before the +% figures. For this document we've used BibTeX, the .bib file +% scibib.bib, and the .bst file Science.bst. The package scicite.sty +% was included to format the reference numbers according to *Science* +% style. + +%BibTeX users: After compilation, comment out the following two lines and paste in +% the generated .bbl file. + +\bibliography{scibib} + +\bibliographystyle{Science} + + + + + +\section*{Acknowledgments} +Include acknowledgments of funding, any patents pending, where raw data for the paper are deposited, etc. + +%Here you should list the contents of your Supplementary Materials -- below is an example. +%You should include a list of Supplementary figures, Tables, and any references that appear only in the SM. +%Note that the reference numbering continues from the main text to the SM. +% In the example below, Refs. 4-10 were cited only in the SM. +\section*{Supplementary materials} +Materials and Methods\\ +Supplementary Text\\ +Figs. S1 to S3\\ +Tables S1 to S4\\ + +References \textit{(4-10)} + +% For your review copy (i.e., the file you initially send in for +% evaluation), you can use the {figure} environment and the +% \includegraphics command to stream your figures into the text, placing +% all figures at the end. For the final, revised manuscript for +% acceptance and production, however, PostScript or other graphics +% should not be streamed into your compliled file. Instead, set +% captions as simple paragraphs (with a \noindent tag), setting them +% off from the rest of the text with a \clearpage as shown below, and +% submit figures as separate files according to the Art Department's +% instructions. + + +\clearpage + +\noindent {\bf Fig. 1.} Please do not use figure environments to set +up your figures in the final (post-peer-review) draft, do not include graphics in your +source code, and do not cite figures in the text using \LaTeX\ +\verb+\ref+ commands. Instead, simply refer to the figure numbers in +the text per {\it Science\/} style, and include the list of captions at +the end of the document, coded as ordinary paragraphs as shown in the +\texttt{scifile.tex} template file. Your actual figure files should +be submitted separately. + +\end{document} + + + + + + + + + + + + + + + + diff --git a/inst/rmarkdown/templates/science/skeleton/Science.bst b/inst/rmarkdown/templates/science/skeleton/Science.bst new file mode 100644 index 000000000..2b242086a --- /dev/null +++ b/inst/rmarkdown/templates/science/skeleton/Science.bst @@ -0,0 +1,1353 @@ +%% +%% This is file `Science.bst', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `head,,seq-no,nm-init,ed-au,nmlm,x5,m1,yr-par,xmth,jtit-x,thtit-a,trnum-it,vol-bf,vnum-x,volp-com,jpg-1,numser,jnm-x,pub-date,pre-pub,edby,edbyy,blk-com,blknt,in-x,pp,ed,abr,jabr,xand,etal-it,em-it,{}') +%% physjour.mbs (with options: `,seq-no,nm-init,ed-au,nmlm,x5,m1,yr-par,xmth,jtit-x,thtit-a,trnum-it,vol-bf,vnum-x,volp-com,jpg-1,numser,jnm-x,pub-date,pre-pub,edby,edbyy,blk-com,blknt,in-x,pp,ed,abr,jabr,xand,etal-it,em-it,{}') +%% merlin.mbs (with options: `tail,,seq-no,nm-init,ed-au,nmlm,x5,m1,yr-par,xmth,jtit-x,thtit-a,trnum-it,vol-bf,vnum-x,volp-com,jpg-1,numser,jnm-x,pub-date,pre-pub,edby,edbyy,blk-com,blknt,in-x,pp,ed,abr,jabr,xand,etal-it,em-it,{}') +%% ---------------------------------------- +%% *** Applicable to Science Journal references *** +%% +%% Copyright 1994-1999 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[1999/05/28 3.89 (PWD)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is a numerical citation style, and as such is standard LaTeX. + % It requires no extra package to interface to the main text. + % The form of the \bibitem entries is + % \bibitem{key}... + % Usage of \cite is as follows: + % \cite{key} ==>> [#] + % \cite[chap. 2]{key} ==>> [#, chap. 2] + % where # is a number determined by the ordering in the reference list. + % The order in the reference list is that by which the works were originally + % cited in the text, or that in the database. + %--------------------------------------------------------------------- + +ENTRY + { address + author + booktitle + chapter + edition + editor + howpublished + institution + journal + key + month + note + number + organization + pages + publisher + school + series + title + type + volume + year + } + {} + { label } + +INTEGERS { output.state before.all mid.sentence after.sentence after.block } + +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} + +STRINGS { s t } + +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {date.block} +{ + skip$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "{\it " swap$ * "\/}" * } + if$ +} + +FUNCTION {bolden} +{ duplicate$ empty$ + { pop$ "" } + { "{\bf " swap$ * "}" * } + if$ +} + + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "eds." } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "edn." } + +FUNCTION {bbl.volume} +{ "vol." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.chapter} +{ "chap." } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +FUNCTION {bbl.first} +{ "First" } + +FUNCTION {bbl.second} +{ "Second" } + +FUNCTION {bbl.third} +{ "Third" } + +FUNCTION {bbl.fourth} +{ "Fourth" } + +FUNCTION {bbl.fifth} +{ "Fifth" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +FUNCTION {bbl.th} +{ "th" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + + %------------------------------------------------------------------- + % Begin module: + % \ProvidesFile{physjour.mbs}[1999/02/24 2.0d (PWD)] +MACRO {aa}{"Astron. \& Astrophys."} +MACRO {aasup}{"Astron. \& Astrophys. Suppl. Ser."} +MACRO {aph} {"Acta Phys."} +MACRO {advp} {"Adv. Phys."} +MACRO {ajp} {"Amer. J. Phys."} +MACRO {ajm} {"Amer. J. Math."} +MACRO {amsci} {"Amer. Sci."} +MACRO {anofd} {"Ann. Fluid Dyn."} +MACRO {am} {"Ann. Math."} +MACRO {ap} {"Ann. Phys. (NY)"} +MACRO {adp} {"Ann. Phys. (Leipzig)"} +MACRO {ao} {"Appl. Opt."} +MACRO {apl} {"Appl. Phys. Lett."} +MACRO {app} {"Astroparticle Phys."} +MACRO {apj} {"Astrophys. J."} +MACRO {apjsup} {"Astrophys. J. Suppl. Ser."} +MACRO {baps} {"Bull. Amer. Phys. Soc."} +MACRO {cmp} {"Comm. Math. Phys."} +MACRO {cpam} {"Commun. Pure Appl. Math."} +MACRO {cppcf} {"Comm. Plasma Phys. \& Controlled Fusion"} +MACRO {cpc} {"Comp. Phys. Comm."} +MACRO {cqg} {"Class. Quant. Grav."} +MACRO {cra} {"C. R. Acad. Sci. A"} +MACRO {fed} {"Fusion Eng. \& Design"} +MACRO {ft} {"Fusion Tech."} +MACRO {grg} {"Gen. Relativ. Gravit."} +MACRO {ieeens} {"IEEE Trans. Nucl. Sci."} +MACRO {ieeeps} {"IEEE Trans. Plasma Sci."} +MACRO {ijimw} {"Interntl. J. Infrared \& Millimeter Waves"} +MACRO {ip} {"Infrared Phys."} +MACRO {irp} {"Infrared Phys."} +MACRO {jap} {"J. Appl. Phys."} +MACRO {jasa} {"J. Acoust. Soc. America"} +MACRO {jcp} {"J. Comp. Phys."} +MACRO {jetp} {"Sov. Phys.--JETP"} +MACRO {jfe} {"J. Fusion Energy"} +MACRO {jfm} {"J. Fluid Mech."} +MACRO {jmp} {"J. Math. Phys."} +MACRO {jne} {"J. Nucl. Energy"} +MACRO {jnec} {"J. Nucl. Energy, C: Plasma Phys., Accelerators, Thermonucl. Res."} +MACRO {jnm} {"J. Nucl. Mat."} +MACRO {jpc} {"J. Phys. Chem."} +MACRO {jpp} {"J. Plasma Phys."} +MACRO {jpsj} {"J. Phys. Soc. Japan"} +MACRO {jsi} {"J. Sci. Instrum."} +MACRO {jvst} {"J. Vac. Sci. \& Tech."} +MACRO {nat} {"Nature"} +MACRO {nature} {"Nature"} +MACRO {nedf} {"Nucl. Eng. \& Design/Fusion"} +MACRO {nf} {"Nucl. Fusion"} +MACRO {nim} {"Nucl. Inst. \& Meth."} +MACRO {nimpr} {"Nucl. Inst. \& Meth. in Phys. Res."} +MACRO {np} {"Nucl. Phys."} +MACRO {npb} {"Nucl. Phys. B"} +MACRO {nt/f} {"Nucl. Tech./Fusion"} +MACRO {npbpc} {"Nucl. Phys. B (Proc. Suppl.)"} +MACRO {inc} {"Nuovo Cimento"} +MACRO {nc} {"Nuovo Cimento"} +MACRO {pf} {"Phys. Fluids"} +MACRO {pfa} {"Phys. Fluids A: Fluid Dyn."} +MACRO {pfb} {"Phys. Fluids B: Plasma Phys."} +MACRO {pl} {"Phys. Lett."} +MACRO {pla} {"Phys. Lett. A"} +MACRO {plb} {"Phys. Lett. B"} +MACRO {prep} {"Phys. Rep."} +MACRO {pnas} {"Proc. Nat. Acad. Sci. USA"} +MACRO {pp} {"Phys. Plasmas"} +MACRO {ppcf} {"Plasma Phys. \& Controlled Fusion"} +MACRO {phitrsl} {"Philos. Trans. Roy. Soc. London"} +MACRO {prl} {"Phys. Rev. Lett."} +MACRO {pr} {"Phys. Rev."} +MACRO {physrev} {"Phys. Rev."} +MACRO {pra} {"Phys. Rev. A"} +MACRO {prb} {"Phys. Rev. B"} +MACRO {prc} {"Phys. Rev. C"} +MACRO {prd} {"Phys. Rev. D"} +MACRO {pre} {"Phys. Rev. E"} +MACRO {ps} {"Phys. Scripta"} +MACRO {procrsl} {"Proc. Roy. Soc. London"} +MACRO {rmp} {"Rev. Mod. Phys."} +MACRO {rsi} {"Rev. Sci. Inst."} +MACRO {science} {"Science"} +MACRO {sciam} {"Sci. Am."} +MACRO {sam} {"Stud. Appl. Math."} +MACRO {sjpp} {"Sov. J. Plasma Phys."} +MACRO {spd} {"Sov. Phys.--Doklady"} +MACRO {sptp} {"Sov. Phys.--Tech. Phys."} +MACRO {spu} {"Sov. Phys.--Uspeki"} + % End module: physjour.mbs +%% Copyright 1994-1999 Patrick W Daly +MACRO {acmcs} {"ACM Comput. Surv."} + +MACRO {acta} {"Acta Inf."} + +MACRO {cacm} {"Commun. ACM"} + +MACRO {ibmjrd} {"IBM J. Res. Dev."} + +MACRO {ibmsj} {"IBM Syst.~J."} + +MACRO {ieeese} {"IEEE Trans. Softw. Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput.-Aided Design Integrated Circuits"} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Programming"} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Gr."} + +MACRO {toms} {"ACM Trans. Math. Softw."} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."} + +MACRO {tcs} {"Theoretical Comput. Sci."} + + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{f.~}{vv~}{ll}{, jj}" format.name$ + 't := + nameptr #1 > + { + nameptr #1 + #1 + = + numnames #5 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal emphasize * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {format.names.ed} +{ format.names } + +FUNCTION {format.authors} +{ author empty$ + { "" } + { author format.names } + if$ +} + +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor format.names + ", " * + editor num.names$ #1 > + 'bbl.editors + 'bbl.editor + if$ + * + } + if$ +} + +FUNCTION {format.in.editors} +{ editor empty$ + { "" } + { editor format.names.ed + } + if$ +} + +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * + } + if$ +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { title "t" change.case$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ "" } + +FUNCTION {format.date} +{ year empty$ + { "" } + 'year + if$ + duplicate$ empty$ + 'skip$ + { + before.all 'output.state := + " (" swap$ * ")" * + } + if$ +} + +FUNCTION {format.btitle} +{ title emphasize +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.connect + series empty$ + 'skip$ + { bbl.of space.word * series emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.connect + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { bbl.in space.word * series * } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ edition extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s eng.ord 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { output.state mid.sentence = + { convert.edition "l" change.case$ " " * bbl.edition * } + { convert.edition "t" change.case$ " " * bbl.edition * } + if$ + } + if$ +} + +INTEGERS { multiresult } + +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {format.pages} +{ pages empty$ + { "" } + { pages multi.page.check + { bbl.pages pages n.dashify tie.or.space.connect } + { bbl.page pages tie.or.space.connect } + if$ + } + if$ +} + +FUNCTION {first.page} +{ 't := + "" + { t empty$ not t #1 #1 substring$ "-" = not and } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + while$ +} + +FUNCTION {format.journal.pages} +{ pages empty$ + 'skip$ + { duplicate$ empty$ + { pop$ format.pages } + { + ", " * + pages first.page * + } + if$ + } + if$ +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + bolden + format.journal.pages +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ } + if$ + chapter tie.or.space.connect + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + { "" } + { editor empty$ + { word.in booktitle emphasize * } + { word.in booktitle emphasize * + ", " * + format.in.editors * + ", " * + editor num.names$ #1 > + { bbl.editors } + { bbl.editor } + if$ + * + } + if$ + } + if$ +} + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + } + if$ +} + +FUNCTION {format.tr.number} +{ type empty$ + { bbl.techrep } + 'type + if$ + number empty$ + { "t" change.case$ } + { number tie.or.space.connect } + if$ +} + +FUNCTION {format.article.crossref} +{ + key empty$ + { journal empty$ + { "need key or journal for " cite$ * " to crossref " * crossref * + warning$ + "" + } + { word.in journal emphasize * } + if$ + } + { word.in key * " " *} + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.crossref.editor} +{ editor #1 "{vv~}{ll}" format.name$ + editor num.names$ duplicate$ + #2 > + { pop$ + " " * bbl.etal emphasize * + } + { #2 < + 'skip$ + { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal emphasize * + } + { bbl.and space.word * editor #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ +} + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + word.in + } + { bbl.volume volume tie.or.space.connect + bbl.of space.word * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { series emphasize * } + if$ + } + { key * } + if$ + } + { format.crossref.editor * } + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.incoll.inproc.crossref} +{ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ + { booktitle empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + "" + } + { word.in booktitle emphasize * } + if$ + } + { word.in key * " " *} + if$ + } + { word.in format.crossref.editor * " " *} + if$ + " \cite{" * crossref * "}" * +} + +FUNCTION {format.org.or.pub} +{ 't := + "" + year empty$ + { "empty year in " cite$ * warning$ } + 'skip$ + if$ + address empty$ t empty$ and + year empty$ and + 'skip$ + { + add.blank "(" * + t empty$ + { address empty$ + 'skip$ + { address * } + if$ + } + { t * + address empty$ + 'skip$ + { ", " * address * } + if$ + } + if$ + year empty$ + 'skip$ + { t empty$ address empty$ and + 'skip$ + { ", " * } + if$ + year * + } + if$ + ")" * + } + if$ +} + +FUNCTION {format.publisher.address} +{ publisher empty$ + { "empty publisher in " cite$ * warning$ + "" + } + { publisher } + if$ + format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization empty$ + { "" } + { organization } + if$ + format.org.or.pub +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + crossref missing$ + { journal + emphasize + "journal" output.check + add.blank + format.vol.num.pages output + format.date "year" output.check + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.sentence + format.note output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.btitle "title" output.check + crossref missing$ + { format.bvolume output + format.number.series output + format.publisher.address output + } + { + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.edition output + new.sentence + format.note output + fin.entry +} + +FUNCTION {booklet} +{ output.bibitem + format.authors output + format.title "title" output.check + howpublished output + address output + format.date output + new.sentence + format.note output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + format.btitle "title" output.check + crossref missing$ + { + format.number.series output + format.publisher.address output + format.bvolume output + format.chapter.pages "chapter and pages" output.check + } + { + format.chapter.pages "chapter and pages" output.check + format.book.crossref output.nonnull + format.date "year" output.check + } + if$ + format.edition output + new.sentence + format.note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.number.series output + format.publisher.address output + format.bvolume output + format.chapter.pages output + format.edition output + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + new.sentence + format.note output + fin.entry +} + +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.number.series output + publisher empty$ + { format.organization.address output } + { organization output + format.publisher.address output + } + if$ + format.bvolume output + format.pages output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + new.sentence + format.note output + fin.entry +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {manual} +{ output.bibitem + author empty$ + { organization empty$ + 'skip$ + { organization output.nonnull + address output + } + if$ + } + { format.authors output.nonnull } + if$ + format.btitle "title" output.check + author empty$ + { organization empty$ + { + address output + } + 'skip$ + if$ + } + { + organization output + address output + } + if$ + format.edition output + format.date output + new.sentence + format.note output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + format.title "title" output.check + bbl.mthesis format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + new.sentence + format.note output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + format.title output + howpublished output + format.date output + new.sentence + format.note output + fin.entry + empty.misc.check +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + format.title "title" output.check + bbl.phdthesis format.thesis.type output.nonnull + school "school" output.check + address output + format.date "year" output.check + new.sentence + format.note output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization output } + { format.editors output.nonnull } + if$ + format.btitle "title" output.check + format.bvolume output + editor empty$ + { publisher empty$ + 'skip$ + { + format.number.series output + format.publisher.address output + } + if$ + } + { publisher empty$ + { + format.organization.address output } + { + organization output + format.publisher.address output + } + if$ + } + if$ + new.sentence + format.note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + format.title "title" output.check + format.tr.number emphasize output.nonnull + institution "institution" output.check + address output + format.date "year" output.check + new.sentence + format.note output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + format.title "title" output.check + format.date output + new.sentence + format.note "note" output.check + fin.entry +} + +FUNCTION {default.type} { misc } + +READ + +STRINGS { longest.label } + +INTEGERS { number.label longest.label.width } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} + +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} + +EXECUTE {initialize.longest.label} + +ITERATE {longest.label.pass} + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * + write$ newline$ +} + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} + +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `Science.bst'. \ No newline at end of file diff --git a/inst/rmarkdown/templates/science/skeleton/scibib.bib b/inst/rmarkdown/templates/science/skeleton/scibib.bib new file mode 100644 index 000000000..d2bfa7387 --- /dev/null +++ b/inst/rmarkdown/templates/science/skeleton/scibib.bib @@ -0,0 +1,42 @@ +% scibib.bib + +% This is the .bib file used to compile the document "A simple Science +% template" (scifile.tex). It is not intended as an example of how to +% set up your BibTeX file. + + + + +@misc{tth, note = "The package is TTH, available at +http://hutchinson.belmont.ma.us/tth/ ."} + +@misc{use2e, note = "As the mark-up of the \TeX\ source for this +document makes clear, your file should be coded in \LaTeX +2${\varepsilon}$, not \LaTeX\ 2.09 or an earlier release. Also, +please use the \texttt{article} document class."} + +@misc{inclme, note="Among whom are the author of this document. The +``real'' references and notes contained herein were compiled using +B{\small{IB}}\TeX\ from the sample .bib file \texttt{scibib.bib}, the style +package \texttt{scicite.sty}, and the bibliography style file +\texttt{Science.bst}."} + + +@misc{nattex, note="One of the equation editors we use, Equation Magic +(MicroPress Inc., Forest Hills, NY; http://www.micropress-inc.com/), +interprets native \TeX\ source code and generates an equation as an +OLE picture object that can then be cut and pasted directly into Word. +This editor, however, does not handle \LaTeX\ environments (such as +\texttt{\{array\}} or \texttt{\{eqnarray\}}); it can interpret only +\TeX\ codes. Thus, when there's a choice, we ask that you avoid these +\LaTeX\ calls in displayed math --- for example, that you use the +\TeX\ \verb+\matrix+ command for ordinary matrices, rather than the +\LaTeX\ \texttt{\{array\}} environment."} + + + + + + + + diff --git a/inst/rmarkdown/templates/science/skeleton/scicite.sty b/inst/rmarkdown/templates/science/skeleton/scicite.sty new file mode 100644 index 000000000..5842b522c --- /dev/null +++ b/inst/rmarkdown/templates/science/skeleton/scicite.sty @@ -0,0 +1,513 @@ +% What follows is a slightly modified version of D. Arseneau's +% cite.sty style file, to take into account the form of references +% for the journal Science. We have left all copyright information +% intact, as instructed by the author of the original file. + + + + +% C I T E . S T Y +% +% version 4.01 (Nov 2003) +% +% Compressed, sorted lists of on-line or superscript numerical citations. +% see also drftcite.sty (And the stub overcite.sty) +% +% Copyright (C) 1989-2003 by Donald Arseneau +% These macros may be freely transmitted, reproduced, or modified +% provided that this notice is left intact. +% +% Instructions follow \endinput. +% ------------------------------------ +% First, ensure that some catcodes have the expected values +\edef\citenum{% to restore funny codes + \catcode\string`\string ` \the\catcode\string`\` + \catcode\string`\string ' \the\catcode\string`\' + \catcode\string`\string = \the\catcode\string`\= + \catcode\string`\string _ \the\catcode\string`\_ + \catcode\string`\string : \the\catcode\string`\:} +\catcode\string`\` 12 +\catcode`\' 12 +\catcode`\= 12 +\catcode`\_ 8 +\catcode`\: 12 + +% Handle optional variations: +% [ verbose, nospace, space, ref, nosort, noadjust, superscript, nomove ], +% \citeform,\citeleft,\citeright,\citemid,\citepunct,\citedash +% +% Set defaults: + +% Science change -- ( on the left, per Science Style. +\providecommand\citeleft{(} + +% Science change -- ) on the right: +\providecommand\citeright{)} + +% Science addition -- biblabel changed to numerals with periods. +\renewcommand\@biblabel[1]{#1.} + +% , (comma space) before note +\providecommand\citemid{,\penalty\@medpenalty\ } + +% , (comma thin-space) between entries; [nospace] eliminates the space +\providecommand\citepunct{,\penalty\@m\hskip.13emplus.1emminus.1em}% + +% -- (endash) designating range of numbers: +% (using \hbox avoids easy \exhyphenpenalty breaks) +\providecommand{\citedash}{\hbox{--}\penalty\@m} + +% Each number left as-is: +\providecommand\citeform{} + +% punctuation characters to move for overcite +\providecommand{\CiteMoveChars}{.,:;} + +% font selection for superscript numbers +\providecommand\OverciteFont{\fontsize\sf@size\baselineskip\selectfont} + + +% Do not repeat warnings. [verbose] reverses +\let\oc@verbo\relax + +% Default is to move punctuation: +\def\oc@movep#1{\futurelet\@tempb\@citey} + +%---------------------- +% \citen uses \@nocite to ignore spaces after commas, and write the aux file +% \citation. \citen then loops over the citation tags, using \@make@cite@list +% to make a sorted list of numbers. Finally, \citen executes \@citelist to +% compress ranges of numbers and print the list. \citen can be used by itself +% to give citation numbers without the brackets and other formatting; e.g., +% "See also ref.~\citen{junk}." +% +\DeclareRobustCommand\citen[1]{% + \begingroup + \let\@safe@activesfalse\@empty + \@nocite{#1}% ignores spaces, writes to .aux file, returns #1 in \@no@sparg + \@tempcntb\m@ne % \@tempcntb tracks highest number + \let\@h@ld\@empty % nothing held from list yet + \let\@citea\@empty % no punctuation preceding first + \let\@celt\delimiter % an unexpandable, but identifiable, token + \def\@cite@list{}% % empty list to start + \@for \@citeb:=\@no@sparg\do{\@make@cite@list}% make a sorted list of numbers + % After sorted citelist is made, execute it to compress citation ranges. + \@tempcnta\m@ne % no previous number + \let\@celt\@compress@cite \@cite@list % output number list with compression + \@h@ld % output anything held over + \endgroup + \@restore@auxhandle + } + +% For each citation, check if it is defined and if it is a number. +% if a number: insert it in the sorted \@cite@list +% otherwise: output it immediately. +% +\def\@make@cite@list{% + \expandafter\let \expandafter\@B@citeB + \csname b@\@citeb\@extra@b@citeb \endcsname + \ifx\@B@citeB\relax % undefined: output ? and warning + \@citea {\bfseries ?}\let\@citea\citepunct \G@refundefinedtrue + \@warning {Citation `\@citeb' on page \thepage\space undefined}% + \oc@verbo \global\@namedef{b@\@citeb\@extra@b@citeb}{?}% + \else % defined % remove previous line to repeat warnings + \ifcat _\ifnum\z@<0\@B@citeB _\else A\fi % a positive number, put in list + \@addto@cite@list + \else % citation is not a number, output immediately + \@citea \citeform{\@B@citeB}\let\@citea\citepunct + \fi\fi} + +% Regular definition for adding entry to cite list, with sorting + +\def\@addto@cite@list{\@tempcnta\@B@citeB \relax + \ifnum \@tempcnta>\@tempcntb % new highest, add to end (efficiently) + \edef\@cite@list{\@cite@list \@celt{\@B@citeB}}% + \@tempcntb\@tempcnta + \else % arbitrary number: insert appropriately + \edef\@cite@list{\expandafter\@sort@celt \@cite@list \@gobble @}% + \fi} +% +% \@sort@celt inserts number (\@tempcnta) into list of \@celt{num} (#1{#2}) +% \@celt must not be expandable; list should end with two vanishing tokens. +% +\def\@sort@celt#1#2{\ifx \@celt #1% parameters are \@celt {num} + \ifnum #2<\@tempcnta % number goes later in list + \@celt{#2}% + \expandafter\expandafter\expandafter\@sort@celt % continue + \else % number goes here + \@celt{\number\@tempcnta}\@celt{#2}% stop comparing +\fi\fi} + +% Check if each number follows previous and can be put in a range +% +\def\@compress@cite#1{% % This is executed for each number + \advance\@tempcnta\@ne % Now \@tempcnta is one more than the previous number + \ifnum #1=\@tempcnta % Number follows previous--hold on to it + \ifx\@h@ld\@empty % first pair of successives + \expandafter\def\expandafter\@h@ld\expandafter{\@citea + \citeform{#1}}% + \else % compressible list of successives + \def\@h@ld{\citedash \citeform{#1}}% + \fi + \else % non-successor -- dump what's held and do this one + \@h@ld \@citea \citeform{#1}% + \let\@h@ld\@empty + \fi \@tempcnta#1\let\@citea\citepunct +} + +% Make \cite choose superscript or normal + +\DeclareRobustCommand{\cite}{% + \@ifnextchar[{\@tempswatrue\@citex}{\@tempswafalse\@citex[]}} + +% Do \cite command on line. +% +\def\@citex[#1]#2{\@cite{\citen{#2}}{#1}} + +% Modified by Science for italic number, roman parentheses. + +\def\@cite#1#2{\leavevmode \cite@adjust + \citeleft{\itshape {#1\if@tempswa\@safe@activesfalse\citemid{#2}\fi + \spacefactor\@m % punctuation in note doesn't affect outside + }}\citeright + \@restore@auxhandle} + +% Put a penalty before the citation, and adjust the spacing: if no space +% already or if there is extra space due to some punctuation, then change +% to one inter-word space. +% +\def\cite@adjust{\begingroup% + \@tempskipa\lastskip \edef\@tempa{\the\@tempskipa}\unskip + \ifnum\lastpenalty=\z@ \penalty\@highpenalty \fi + \ifx\@tempa\@zero@skip \spacefactor1001 \fi % if no space before, set flag + \ifnum\spacefactor>\@m \ \else \hskip\@tempskipa \fi + \endgroup} + + +\edef\@zero@skip{\the\z@skip} + +% Superscript cite, with no optional note. Check for punctuation first. +% +\def\@citew#1{\begingroup \leavevmode + \@if@fillglue \lastskip \relax \unskip + \def\@tempa{\@tempcnta\spacefactor + \/% this allows the last word to be hyphenated, and it looks better. + \@citess{\citen{#1}}\spacefactor\@tempcnta + \endgroup \@restore@auxhandle}% + \oc@movep\relax}% check for following punctuation (depending on options) + +% Move trailing punctuation before the citation: +% +\def\@citey{\let\@tempc\@tempa + % Watch for double periods and suppress them + \ifx\@tempb.\ifnum\spacefactor<\@bigSfactor\else + \let\@tempb\relax \let\@tempc\oc@movep + \fi\fi + % Move other punctuation + \expandafter\@citepc\CiteMoveChars\delimiter + \@tempc}% + +\def\@citepc#1{% + \ifx\@tempb#1\@empty #1\let\@tempc\oc@movep \fi + \ifx\delimiter#1\else \expandafter\@citepc\fi} + +% Replacement for \@cite which defines the formatting normally done +% around the citation list. This uses superscripts with no brackets. +% HOWEVER, trailing punctuation has already been moved over. The +% format for cites with note is given by \@cite. Redefine \@cite and/ +% or \@citex to get different appearance. I don't use \textsuperscript +% because it is defined BADLY in compatibility mode. + +\def\@citess#1{\mbox{$\m@th^{\hbox{\OverciteFont{#1}}}$}} + +% \nocite: This is changed to ignore *ALL* spaces and be robust. The +% parameter list, with spaces removed, is `returned' in \@no@sparg, which +% is used by \citen. +% +\DeclareRobustCommand\nocite[1]{% + \@bsphack \@nocite{#1}% + \@for \@citeb:=\@no@sparg\do{\@ifundefined{b@\@citeb\@extra@b@citeb}% + {\G@refundefinedtrue\@warning{Citation `\@citeb' undefined}% + \oc@verbo \global\@namedef{b@\@citeb\@extra@b@citeb}{?}}{}}% + \@esphack} + +\def\@nocite#1{\begingroup\let\protect\string% normalize active chars + \xdef\@no@sparg{\expandafter\@ignsp#1 \: }\endgroup% and remove ALL spaces + \if@filesw \immediate\write\@newciteauxhandle % = \@auxout, except with multibib + {\string\citation {\@no@sparg}}\fi + } + +% for ignoring *ALL* spaces in the input. This presumes there are no +% \outer tokens and no \if-\fi constructs in the parameter. Spaces inside +% braces are retained. +% +\def\@ignsp#1 {\ifx\:#1\@empty\else #1\expandafter\@ignsp\fi} + +% \@if@fillglue{glue}{true}{false} +\begingroup + \catcode`F=12 \catcode`I=12\catcode`L=12 + \lowercase{\endgroup + \def\@if@fillglue#1{% + \begingroup \skip@#1\relax + \expandafter\endgroup\expandafter + \@is@fil@ \the\skip@ \relax\@firstoftwo FIL\relax\@secondoftwo\@nil} + \def\@is@fil@ #1FIL#2\relax#3#4\@nil{#3} +} + +\let\nocitecount\relax % in case \nocitecount was used for drftcite + +% For the time being, just prevent gross errors from using hyperref. +% There are no hyper-links. (I will need to carry the cite tags through +% the sorting process, and use \hyper@natlinkstart) + +\providecommand\hyper@natlinkstart[1]{} +\providecommand\hyper@natlinkend{} +\providecommand\NAT@parse{\@firstofone} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% option processing + +\DeclareOption{verbose}{\def\oc@verbo#1#2#3#4{}} +\DeclareOption{nospace}{\def\citepunct{,\penalty\@m}} +\DeclareOption{space}{\def\citepunct{,\penalty\@highpenalty\ }} +\DeclareOption{ref}{\def\citeleft{[Ref.\penalty\@M\ }} +\DeclareOption{nosort}{\def\@addto@cite@list + {\edef\@cite@list{\@cite@list \@celt{\@B@citeB}}}} +\DeclareOption{sort}{}% default! +\DeclareOption{nomove}{\def\oc@movep{\@tempa}\let\@citey\oc@movep} +\DeclareOption{move}{}% default +\DeclareOption{nocompress}{% + \def\@compress@cite#1{% % This is executed for each number + \@h@ld \@citea \hyper@natlinkstart\citeform{#1}\hyper@natlinkend + \let\@h@ld\@empty \let\@citea\citepunct} +} +\DeclareOption{compress}{}% default +\DeclareOption{super}{\ExecuteOptions{superscript}} +\DeclareOption{superscript}{% + \DeclareRobustCommand{\cite}{% + \@ifnextchar[{\@tempswatrue\@citex}{\@tempswafalse\@citew}} +} +\DeclareOption{noadjust}{\let\cite@adjust\@empty}% Don't change spaces +\DeclareOption{adjust}{}% adjust space before [ ] +\DeclareOption{biblabel}{\def\@biblabel#1{\@citess{#1}\kern-\labelsep\,}} +\ProvidesPackage{scicite}[2003/11/04 \space v 4.01] +\ProcessOptions + +\ifx\@citey\oc@movep\else % we are moving punctuation; must ensure sfcodes + \mathchardef\@bigSfactor3000 + \expandafter\def\expandafter\frenchspacing\expandafter{\frenchspacing + \mathchardef\@bigSfactor1001 + \sfcode`\.\@bigSfactor \sfcode`\?\@bigSfactor \sfcode`\!\@bigSfactor }% + \ifnum\sfcode`\.=\@m \frenchspacing \fi +\fi + +% Compatability with chapterbib (see use of \@extra@b@citeb) +\@ifundefined{@extra@b@citeb}{\def\@extra@b@citeb{}}{} + +% Compatability with multibib (see use of \@newciteauxhandle) (Yes, this is +% overly messy, but I asked for it... I can't have multibib putting junk after +% the cite command because it hides following punctuation, but then I have +% to restore the ordinary meaning of \@newciteauxhandle = \@auxout.) +\providecommand\@newciteauxhandle{\@auxout} +\AtBeginDocument{\@ifundefined{newcites}{\global\let\@restore@auxhandle\relax}{}} +\def\@restore@auxhandle{\def\@newciteauxhandle{\@auxout}} + + +\@ifundefined{G@refundefinedtrue}{\let\G@refundefinedtrue\relax}{} + +\@ifundefined{@safe@activesfalse}{}{} +\@ifundefined{bbl@cite@choice}{}{\@ifundefined{org@@citex}{}% + {\let\org@@citex\@citex}}% Prevent stomping by babel + + +\citenum % execute restore-catcodes + +% Aliases: +\let\citenum\citen +\let\citeonline\citen + +\endinput +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + CITE.STY + +Modify LaTeX's normal citation mechanism to: + +o Put a comma and a small space between each citation number. The option + [nospace] removes that space, and the option [space] replaces it with + an ordinary inter-word space. + +o Sort citation numbers into ascending order, printing non-numbers before + numbers. All numbers should be greater than zero. The [nosort] package + option turns off sorting. + +o Compress lists of three or more consecutive numbers to one number range + which can be split, with difficulty, after the dash. All numbers should + be greater than zero. E.g., if you used to get the (nonsense) list + [7,5,6,?,4,9,8,Einstein,6], then this style will give [?,Einstein,4-6,6-9]. + Compression of ranges is disabled by the [nocompress] package option. + +o Allow, but strongly discourage, line breaks within a series of + citations. Each number is separated by a comma and a small space. + A break at the beginning of an optional note is discouraged also. + +o Put a high-penalty breakpoint before the citation (unless you specifically + forbid it with ~ ). Also, adjust the spacing: if there is no space or if + there is extra space due to some punctuation, then change to one inter-word + space. E.g., A space will be inserted here\cite{Larry,Curly,Moe}. + +o With package option [superscript] (or [super] for short), display citation + numbers as superscripts (unless they have optional notes, causing them to + be treated as described above). Superscripted citations follow these + additional rules: + +- Superscript citations use THE SAME INPUT FORMAT as ordinary citations; this + style will ignore spaces before the citation, and move trailing punctuation + before the superscript citation. For example, "information \cite{source};" + ignores the space before \cite and puts the semicolon before the number, just + as if you had typed "information;$^{12}$". You may switch off movement with + the [nomove] package option (only relevant with [superscript]). + +- The punctuation characters that will migrate before the superscript are + listed in the macro \CiteMoveChars, which you can redefine. The default is + .,;:. Perhaps ! and ? should too, but they weren't listed in the APS style + manual I looked at, and I agree with that rule to prevent too much visual + separation. Quotes were listed, but they should never have to migrate + because both on-line and superscript versions put quotes before the citation. + This gives one difficulty --- punctuation following quotes won't migrate + inside the quotation: e.g., "``Transition State Theory''\cite{Eyring}." gives + "``Transition State Theory''.$^8$", but you may want the period inside the + quotes, thus: ``Transition State Theory.''$^8$. + +- Doubling of periods (.., ?., !.) is checked for and suppressed. The spacing + after the citation is set according to the final punctuation mark moved. + There is a problem with double periods after a capitalized abbreviation + or directly after \@ : Both of "N.A.S.A. \cite{space}." and "et al.\@ + \cite{many}." will give doubled periods. These can be fixed as follows: + "N.A.S.A\@. \cite{space}." and "et al.\ \cite{many}.". The NASA example + gives the wrong spacing when there is no citation. Sorry. Use \ after + abbreviations like et al. to get the right spacing within a sentence whether + or not a citation follows. + +- Remember, these rules regarding punctuation only apply when the [superscript] + option was given (or overcite.sty used) and the [nomove] option was NOT + given. + +o Define \citen to get just the numbers without the brackets or superscript + and extra formatting. Aliases are \citenum and \citeonline for easy + conversion to other citation packages. + +o `Citation...undefined' warnings are only given once per undefined citation + tag. In the text, missing numbers are represented with a bold `?' at the + first occurrence, and with a normal `?' thenceforth. The package option + [verbose] restores the usual repeated warnings. + +o Make \nocite, \cite, and \citen all ignore spaces in the input tags. + +Although each \cite command sorts its numbers, better compression into +ranges can usually be achieved by carefully selecting the order of the +\bibitem entries or the order of initial citations when using BibTeX. +Having the entries pre-sorted will also save processing time, especially +for long lists of numbers. + +Customization: +~~~~~~~~~~~~~~ +There are several options for \usepackage{cite}, some already mentioned. + + [superscript] use superscrpts for cites without optional notes + [super] alias for [superscript] (like natbib) + [verbose] causes warnings for undefined cites to be repeated each time + [ref] uses the format "[Ref.~12, optional note]" (useful with + the superscript option) + [nospace] eliminates the spaces after commas in the number list. + [space] uses a full inter-word space after the commas + [nosort] prevents sorting of the numbers (default is to sort, and a + [sort] option is provided for completeness). + [nomove] prevents moving the superscript cite after punctuation. + [move] is the default + [noadjust] disables `smart' handling of space before a cite + [adjust] is the default + [nocompress] inhibit compression of consecutive numbers into ranges + [compress] is the default + [biblabel] define the bibliography label as a superscript + +There are several commands that you may redefine to change the formatting +of citation lists: + +command function default +---------- ----------------------- ---------------------------- +\citeform reformats each number nothing +\citepunct printed between numbers comma + penalty + thin space +\citeleft left delimiter of list [ +\citeright right delimeter of list ] +\citemid printed before note comma + space +\citedash used in a compressed range endash + penalty +\CiteMoveChars charcters that move .,:; +\OverciteFont font selection command for superscripts + +The left/mid/right commands don't affect the formatting of superscript +citations. You may use \renewcommand to change any of these. Remember, +these commands are extensions made by this package; they are not regular +LaTeX. Some examples of changes: + +1: \renewcommand\citeform[1]{\romannumeral 0#1}} % roman numerals i,vi +2: \renewcommand\citeform[1]{(#1)} % parenthesized numbers (1)-(5),(9) +3: \renewcommand\citeform{\thechapter.} % by chapter: ^{2.18-2.21} +4: \renewcommand\citepunct{,} % no space and no breaks at commas +5: \renewcommand\citemid{; } % semicolon before optional note +6: \renewcommand\citeleft{(} % parentheses around list with note + \renewcommand\citeright{)} % parentheses around list with note + +The appearance of the whole citation list is governed by \@cite, (for full- +sized cites) and \@citess (for superscripts). For more extensive changes +to the formatting, redefine these. For example, to get brackets around the +list of superscript numbers you can do: + + \def\@citess#1{\textsuperscript{[#1]}} + +after \makeatletter. + +Related Note: The superscript option does not affect the numbering format +of the bibliography; the "[12]" style is still the default. To get +superscripts in the bibliography (at any time) you can define + + \renewcommand\@biblabel[1]{\textsuperscript{#1}} + +Aw, OK, for your convenience, there is the [biblabel] package option that +just performs this definition (sort of). + +\@extra@b@citeb is a hook for other style files to further specify +citations; for example, to number by chapter (see chapterbib.sty). + +% Version 1991: Ignore spaces after commas in the parameter list. Move most of +% \citen into \@cmpresscites for speed. Give the proper \spacefactor afterwards. +% Version 1992: make \citepunct hold the punctuation between numbers (for ease +% of changing). Add \/ to allow hyphenation of previous word, and look better +% in italics. +% 1992a: Make it work with NFSS. (Thank you C. Hamlin and Rainer Schoepf) +% +% Version 3.0 (1992): Rewrite, including sorting. Make entries like "4th" +% be treated properly as text. +% 3.1: Bug fixes (and Joerg-Martin Schwarz also convinced me to use \ifcat) +% 3.2: NFSS support was wrong--added \reset@font. Suppress repetitions of +% warnings. Include \@extra@b@citeb hook. +% 3.3: Handle LaTeX2e options. Introduce various customization hooks. +% 3.4: Heuristics to avoid removing \hspace glue before on-line \cite. +% Make \nocite ignore spaces in list, simplify. Aliases for \citen. +% Compatability with amsmath (which defines \over). +% 3.5: Replace \reset@font with \selectfont so italics are preserved +% Include \G@refundefinedtrue. Fix cite-with-note bug (Lars Engebretsen). +% 3.6: Add nosort option. +% 3.7: Add nomove option; catcode preservation and global \@no@sparg for +% french.sty; warnings in \nocite. +% 3.8: \citedash hook, fix token look-ahead (Heiko Selber), noadjust, babel. +% 3.9: More babel-compatibility hacks. Punctuation move with \frencspacing. +% 4.0: Combine overcite with cite: [superscript] option. Also add [nocompress] +% option and \CiteMoveChars; multibib hooks. +% 4.01 \bf -> \bfseries +% +% Send problem reports to asnd@triumf.ca + +Test file integrity: ASCII 32-57, 58-126: !"#$%&'()*+,-./0123456789 +:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ \ No newline at end of file diff --git a/inst/rmarkdown/templates/science/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/science/skeleton/skeleton.Rmd new file mode 100644 index 000000000..558d6c405 --- /dev/null +++ b/inst/rmarkdown/templates/science/skeleton/skeleton.Rmd @@ -0,0 +1,51 @@ +--- +title: Title of submission to AAAS-Science journal +author: + - name: Rob Anonymous + email: rob@unknown.com + affiliation: Some Institute of Technology + corresponding: rob@unknown.com + - name: Martha Doe + email: martha@doe.com + affiliation: + - Another University + - Some Institute of Technology +address: + - code: Some Institute of Technology + address: Department 1, Street, City, State, Zip + - code: Another University + address: Department 2, Street, City, State, Zip +abstract: | + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eget porta erat. Morbi consectetur est vel gravida pretium. Suspendisse ut dui eu ante cursus gravida non sed sem. Nullam sapien tellus, commodo id velit id, eleifend volutpat quam. Phasellus mauris velit, dapibus finibus elementum vel, pulvinar non tellus. Nunc pellentesque pretium diam, quis maximus dolor faucibus id. Nunc convallis sodales ante, ut ullamcorper est egestas vitae. Nam sit amet enim ultrices, ultrices elit pulvinar, volutpat risus. + +author_summary: | + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eget porta erat. Morbi consectetur est vel gravida pretium. Suspendisse ut dui eu ante cursus gravida non sed sem. Nullam sapien tellus, commodo id velit id, eleifend volutpat quam. Phasellus mauris velit, dapibus finibus elementum vel, pulvinar non tellus. Nunc pellentesque pretium diam, quis maximus dolor faucibus id. Nunc convallis sodales ante, ut ullamcorper est egestas vitae. Nam sit amet enim ultrices, ultrices elit pulvinar, volutpat risus. + +bibliography: mybibfile.bib +output: rticles::science_article +csl: +type: REVIEW/ARTICLE +figures: true / false [required to decide initial submission vs final draft] +--- + +# Introduction + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eget porta erat. Morbi consectetur est vel gravida pretium. Suspendisse ut dui eu ante cursus gravida non sed sem. Phasellus mauris velit, dapibus finibus elementum vel, pulvinar non tellus. Nunc pellentesque pretium diam, quis maximus dolor faucibus id. Nunc convallis sodales ante, ut ullamcorper est egestas vitae. Nam sit amet enim ultrices, ultrices elit pulvinar, volutpat risus. + +A list + +- Item 1 +- Item 2 + + +# Materials and Methods + +## Sub-heading 1 + +## Sub-heading 2 + +# Conclusions +Here are two sample references: + +# References + diff --git a/inst/rmarkdown/templates/science/template.yaml b/inst/rmarkdown/templates/science/template.yaml new file mode 100644 index 000000000..b069e2792 --- /dev/null +++ b/inst/rmarkdown/templates/science/template.yaml @@ -0,0 +1,4 @@ +name: AAAS - Science Journal Article +description: > + Template for creating an article for submission to Science Journal (AAAS) +create_dir: true diff --git a/man/article.Rd b/man/article.Rd index c040c3844..e2d645015 100644 --- a/man/article.Rd +++ b/man/article.Rd @@ -28,6 +28,7 @@ \alias{plos_article} \alias{pnas_article} \alias{sage_article} +\alias{science_article} \alias{sim_article} \alias{springer_article} \alias{tf_article} @@ -132,6 +133,8 @@ pnas_article(..., keep_tex = TRUE) sage_article(..., highlight = NULL, citation_package = "natbib") +science_article(..., keep_tex = TRUE, md_extensions = c("-autolink_bare_uris")) + sim_article(..., highlight = NULL, citation_package = "natbib") springer_article(..., keep_tex = TRUE, citation_package = "default") @@ -346,6 +349,12 @@ Possible arguments for the YAML header are: } } +\section{\code{science_article}}{ + Format for AAAS - Science articles +Based on the official Science Journal LaTeX guidelines +\url{http://www.sciencemag.org/authors/preparing-manuscripts-using-latex}. +} + \section{\code{sim_article}}{ Format for creating submissions to Statistics in Medicine. Based on the official Statistics in Medicine diff --git a/tests/testit/test-formats.R b/tests/testit/test-formats.R index 1313ce929..8ea7436bb 100644 --- a/tests/testit/test-formats.R +++ b/tests/testit/test-formats.R @@ -64,6 +64,7 @@ test_format("rjournal") test_format("rsos") test_format("rss") test_format("sage") +test_format("science") test_format("sim") test_format("springer") test_format("tf")