diff --git a/DESCRIPTION b/DESCRIPTION index f62b8da9d..8c1d650c5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -79,7 +79,8 @@ Authors@R: c( person("Dmytro", "Perepolkin", , "dperepolkin@gmail.com", role = "ctb", comment = c(ORCID = "0000-0001-8558-6183", github = "dmi3kno")), person("Tom", "Palmer", , "remlapmot@hotmail.com", role = "ctb", - comment = c(ORCID = "0000-0003-4655-4511", github = "remlapmot")) + comment = c(ORCID = "0000-0003-4655-4511", github = "remlapmot")), + person("Arthur", "Eschenlauer", role = c("aut", "cph"), email = "esch0041@umn.edu", comment = c(ORCID = "0000-0002-2882-0508")) ) Description: A suite of custom R Markdown formats and templates for authoring journal articles and conference submissions. diff --git a/NAMESPACE b/NAMESPACE index 8929ca591..ba9674f62 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,6 +17,7 @@ export(ctex) export(ctex_article) export(elsevier_article) export(frontiers_article) +export(gigascience_article) export(glossa_article) export(ieee_article) export(ims_article) diff --git a/R/article.R b/R/article.R index 7e15dc5f6..75b2cb125 100644 --- a/R/article.R +++ b/R/article.R @@ -199,6 +199,21 @@ frontiers_article <- function(..., keep_tex = TRUE) { pdf_document_format("frontiers", keep_tex = keep_tex, ...) } +#' @section `gigascience_article`: Format for creating submissions to the +#' GigaScience journal. Adapted from GigaScience Overleaf template +#' . +#' +#' @export +#' @rdname article +gigascience_article <- function(keep_tex = TRUE, + md_extensions = c("-autolink_bare_uris"), + ...) { + pdf_document_format("gigascience", + keep_tex = keep_tex, + md_extensions = md_extensions, + ...) +} + #' @section `glossa_article`: Format for creating submissions to Glossa: a #' journal of general linguistics. Author Guidelines are available on diff --git a/inst/rmarkdown/templates/gigascience/resources/template.tex b/inst/rmarkdown/templates/gigascience/resources/template.tex new file mode 100644 index 000000000..73722d7e1 --- /dev/null +++ b/inst/rmarkdown/templates/gigascience/resources/template.tex @@ -0,0 +1,143 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Please note that whilst this template provides a +% preview of the typeset manuscript for submission, it +% will not necessarily be the final publication layout. +% +\documentclass[$paper$,$reftype$]{$documentclass$} + +% declare highlighting-macros if any +$if(highlighting-macros)$ +$highlighting-macros$ +$endif$ + +%%% declare packages to be used +\usepackage{forarray} +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{siunitx} + +% tightlist command for lists without linebreak +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} + +$if(tables)$ +% From pandoc table feature +\usepackage{longtable,booktabs,array} +$if(multirow)$ +\usepackage{multirow} +$endif$ +\usepackage{calc} % for calculating minipage widths +% 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$ + +$if(csl-refs)$ +% Pandoc citation processing +\newlength{\cslhangindent} +\setlength{\cslhangindent}{1.5em} +\newlength{\csllabelwidth} +\setlength{\csllabelwidth}{3em} +\newlength{\cslentryspacingunit} % times entry-spacing +\setlength{\cslentryspacingunit}{\parskip} +% 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}[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 + \let\oldpar\par + \def\par{\hangindent=\cslhangindent\oldpar} + \fi + % set entry spacing + \setlength{\parskip}{#2\cslentryspacingunit} + }% + {} +\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$ + +% include header-includes if any +$for(header-includes)$ +$header-includes$ +$endfor$ + + +%%% Flushend: You can add this package to automatically balance the final page, but if things go awry (e.g. section contents appearing out-of-order or entire blocks or paragraphs are coloured), remove it! +% \usepackage{flushend} + + + +\title{$title$} + +%%% Authors +$for(author)$ \author[$for(author.affiliation)$$author.affiliation$$sep$,$endfor$$for(author.note)$,\authfn{$author.note$}$endfor$]{$author.name$} $sep$ +$endfor$ + +%%% Author Affiliations +$for(affiliation)$ \affil[$affiliation.id$]{$affiliation.name$$if(affiliation.address)$, $affiliation.address$$endif$} +$endfor$ + +%%% Use the \authfn to add symbols for additional footnotes, if any. 1 is reserved for correspondence emails; then continuing with 2 etc for contributions. +%%% Author Notes +$for(authnote)$\authnote{\authfn{$authnote.id$}$authnote.note$}$sep$ +$endfor$ + + +%%% Paper category +\papercat{$papercat$} + +%%% "Short" author for running page header +\runningauthor{$runningauthor$} + +%%% Should only be set by an editor +\jvolume{00} +\jnumber{0} +\jyear{2018} + +\begin{document} +\begin{frontmatter} +\maketitle +\begin{abstract} +$abstract$ +\end{abstract} + +\begin{keywords} +$for(keywords)$$keywords$$sep$; $endfor$ +\end{keywords} +\end{frontmatter} + +$for(include-before)$ +$include-before$ + +$endfor$ + +\begin{keypoints*} +\begin{itemize} +$for(keypoints)$\item{$keypoints$}$sep$ +$endfor$ +\end{itemize} +\end{keypoints*} + +$body$ + + +$for(include-after)$ +$include-after$ + +$endfor$ +%%% The document ends here +\end{document} diff --git a/inst/rmarkdown/templates/gigascience/skeleton/gigascience-logo.pdf b/inst/rmarkdown/templates/gigascience/skeleton/gigascience-logo.pdf new file mode 100644 index 000000000..cae6823d7 Binary files /dev/null and b/inst/rmarkdown/templates/gigascience/skeleton/gigascience-logo.pdf differ diff --git a/inst/rmarkdown/templates/gigascience/skeleton/oup-contemporary.cls b/inst/rmarkdown/templates/gigascience/skeleton/oup-contemporary.cls new file mode 100644 index 000000000..49b08542d --- /dev/null +++ b/inst/rmarkdown/templates/gigascience/skeleton/oup-contemporary.cls @@ -0,0 +1,429 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% oup-contemporary.cls, v1.1, 2017/06/28 +% Developed by Overleaf +% +% This class file enables authors to prepare +% manuscripts for submission to OUP journals using the +% 'contemporary' layout. +% +% V1.0 Supported journals: +% - gigascience +% - general +% +% V1.1 +% - Moved logos to top level (EM requirements) +% - Handles missing/empty logo files +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +\ProvidesClass{oup-contemporary}[2017/06/28, v1.1] + +\newif\if@numrefs +\newif\if@alpharefs + +%% Options for bibliography style +\DeclareOption{num-refs}{ + \@numrefstrue + \@alpharefsfalse +} +\DeclareOption{alpha-refs}{ + \@numrefsfalse + \@alpharefstrue +} + +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} + +\ExecuteOptions{num-refs} +\ProcessOptions\relax +\LoadClass[twoside,twocolumn]{article} + +\RequirePackage[utf8]{inputenc} +\RequirePackage[T1]{fontenc} +\RequirePackage{ifpdf} +\RequirePackage{microtype} +\RequirePackage{euler} +\RequirePackage{merriweather} +\renewcommand{\ttdefault}{lmtt} +\RequirePackage[italic]{mathastext} +\RequirePackage{relsize} +\RequirePackage{ragged2e} +\RequirePackage{xcolor} +\RequirePackage{colortbl} +\RequirePackage{graphicx} +\RequirePackage{etoolbox,xpatch} +\RequirePackage{environ} +\RequirePackage{lastpage} +\RequirePackage{rotating} +\RequirePackage{lscape} +\RequirePackage{afterpage} +\RequirePackage[absolute]{textpos} +\RequirePackage{url} +\RequirePackage{newfloat} +\RequirePackage{mdframed} +\RequirePackage{titlesec} + +\RequirePackage{scrextend} +\changefontsizes[10.5pt]{7.5pt} + +\RequirePackage{calc} +\RequirePackage{geometry} +\geometry{includefoot, + hmargin=4pc+6.64pt, + bottom=2pc+10pt, + top=5pc+6pt, + headsep=2pc, + headheight=17.5pt, + footnotesep=1pc+6pt, + columnsep=18pt} +\setlength{\parindent}{12pt} + +\RequirePackage[colorlinks,allcolors=black,urlcolor=blue]{hyperref} + +\RequirePackage[noblocks]{authblk} + +\def\@ouplogo{oup.pdf} + +\def\@jname{Journal of X} +\def\@jlogo{example-grid-100x100pt.png} + +\newcommand{\jname}[1]{\def\@jname{#1}} +\newcommand{\jlogo}[1]{\def\@jlogo{#1}} + +\def\@jyear{20xx} +\def\@jvolume{0} +\def\@jnumber{0} +\def\@jstartpage{1} + +\newcommand{\jyear}[1]{\def\@jyear{#1}} +\newcommand{\jvolume}[1]{\def\@jvolume{#1}} +\newcommand{\jnumber}[1]{\def\@jnumber{#1}} +\newcommand{\jstartpage}[1]{\def\@jstartpage{#1}} + +\def\@papercat{} +\def\@runningauthor{} +\def\@runningtitle{} +\def\@corraddress{} +\def\@authnotes{} +\colorlet{jcolour}{blue!40} + +\newcommand{\runningauthor}[1]{\def\@runningauthor{#1}} +\newcommand{\runningtitle}[1]{\def\@runningtitle{#1}} +\newcommand{\corraddress}[1]{\def\@corraddress{#1}} +\newcommand{\authnote}[1]{\appto{\@authnotes}{#1\par}} +\newcommand{\papercat}[1]{\def\@papercat{#1}} + +\newcommand{\journal}[1]{% + \ifstrequal{#1}{gigascience}{% + \jname{GigaScience}% + \jlogo{gigascience-logo.pdf}% + \definecolor{jcolour}{RGB}{122,191,129}% + }{} + \ifstrequal{#1}{general}{% + \jname{Journal of XYZ}% + \jlogo{example-grid-100x100pt.png}% + \definecolor{jcolour}{RGB}{128,0,0}% + } +} + +\RequirePackage[flushmargin,bottom,norule]{footmisc} +\appto{\footnotelayout}{\fontsize{6.5pt}{9.5pt}\selectfont} +\deffootnote{1.5em}{1.5em}{\thefootnotemark\enspace} + +\RequirePackage{fancyhdr} +\fancyhf{} +\renewcommand{\headrule}{\color{black!15}\rule{\textwidth}{2pt}} +\fancyhead[LE]{% + \hspace*{12pt}% + \fontsize{7.8pt}{10pt}\selectfont% + \color{jcolour}% + \textbf{\thepage}% + \hspace{1em}\raisebox{-0.5pt}{|}\hspace{1em}% + \textit{\@jname}, \@jyear, Vol.~\@jvolume, No.~\@jnumber +} +\fancyhead[RO]{% + \fontsize{7.8pt}{10pt}\selectfont% + \color{jcolour}% + \@runningauthor% + \hspace{1em}\raisebox{-0.5pt}{|}\hspace{1em}% + \textbf{\thepage}% + \hspace*{12pt}% +} + +\fancypagestyle{plain}{% + \fancyhf{} + \renewcommand{\headrule}{} + \fancyfoot[R]{% + \fontsize{7.8pt}{10pt}\selectfont% + \color{jcolour}% + \textbf{\thepage}\hspace*{12pt}% + } +} + + +\pagestyle{fancy} + + +\AtBeginDocument{% + \newsavebox{\@gscitedetails} + \newlength{\@gscitedetailsheight} + \newsavebox{\@gsheadbox} + \newlength{\@gsheadboxheight} + \savebox{\@gscitedetails}{% + \parbox{\textwidth-21pc+4pc+6.64pt}{% +% \normalfont{\itshape\bfseries\@jname}, \@jyear, \@jstartpage--\pageref{LastPage}\par +% \vspace{\dimexpr 8pt-1em\relax} + {\color{black!15}\rule{\linewidth}{2pt}}\par% + \vspace{\dimexpr 8pt-1em\relax}% + \fontsize{6.5pt}{9.5pt}\bfseries% + \textcolor{jcolour}{doi: xx.xxxx/xxxx}\par + Manuscript in Preparation\par + \@papercat\par + \vspace{\dimexpr 8pt-1em\relax}% + {\color{black!15}\rule{\linewidth}{2pt}}\par + }}% + \settototalheight{\@gscitedetailsheight}{\usebox{\@gscitedetails}}% + %%%% + \savebox{\@gsheadbox}{% + \parbox{\textwidth-21pc+4pc+6.64pt}{% + \normalfont% + \fontsize{8pt}{9.5pt}\selectfont% + {\itshape\bfseries\@jname}, \@jyear, \@jstartpage--\pageref{LastPage}\par + \vspace{\dimexpr 8pt-1.5pt\relax}% + \usebox{\@gscitedetails} + }% + }% + \settototalheight{\@gsheadboxheight}{\usebox{\@gsheadbox}}% +} + +\RequirePackage{alphalph} +\newalphalph{\fnsymbolmult}[mult]{\@fnsymbol}{5} + +\newcounter{authorfn} +\setcounter{authorfn}{1} +\newcommand{\authfn}[1]{% + \fnsymbolmult{#1}% +} + +\renewcommand\Authands{ and } +\renewcommand\AB@affilsepx{ and } +\renewcommand{\Authfont}{\fontsize{13pt}{18pt}\selectfont} +\renewcommand{\Affilfont}{\fontsize{9pt}{13pt}\selectfont} +\setlength{\affilsep}{21pt-9pt} + +\AtBeginDocument{ +\renewcommand{\@maketitle}{% + \textblockorigin{4pc+6.64pt}{4pc+6pt} + %%%% + \begin{textblock*}{21pc}(0pt,0pt) + \IfFileExists{\@ouplogo}{% + \includegraphics[height=\@gsheadboxheight]{\@ouplogo}% + }{% + \fbox{\begin{minipage}[b][\@gsheadboxheight]{\@gsheadboxheight} + \raggedright + Placeholder for OUP logo \@ouplogo + \end{minipage}}% + } + \hspace{12pt}% + %% Do absolutely nothing if \@jlogo is empty string + \ifdefempty{\@jlogo}{}{% + \IfFileExists{\@jlogo}{% + \includegraphics[height=\@gscitedetailsheight]{\@jlogo} + }{% + \fbox{\begin{minipage}[b][\@gsheadboxheight]{\@gsheadboxheight}% + \raggedright Placeholder for journal logo \@jlogo + \end{minipage}}% + }} + \end{textblock*} + %%% + \begin{textblock*}{\textwidth-21pc}(21pc,0pt) + \usebox{\@gsheadbox} + \end{textblock*}% + %%% + \null\vspace*{\dimexpr 13pc+11pt-5pc-6pt\relax}% + \raggedright% + {\fontsize{14pt}{16pt}\selectfont% + \ifpdf + \textls[200]{\relsize{-1}\MakeUppercase{\@papercat}} + \else %%% don't use letterspace in latex+dvi + \relsize{-1}\MakeUppercase{\@papercat}% + \fi% + \par} + \vspace{\dimexpr 26pt-18pt\relax} + {\fontsize{18pt}{27pt}\bfseries\color{jcolour}\@title\par} + \vspace{\dimexpr 26pt-13pt\relax} + \@author\par + \vspace{\dimexpr 15.5pt-1em} + {% + \renewcommand{\authfn}[1]{% + \textsuperscript{\fnsymbolmult{##1}}% + } + {\fontsize{6.5pt}{9.5pt}\selectfont\@authnotes\par}% + } + \vspace{\dimexpr 16pt-3pt-1em\relax} +} +} + +\RequirePackage[style]{abstract} +\setlength{\absleftindent}{0pt} +\setlength{\absrightindent}{0pt} +\setlength{\absparindent}{12pt} +\setlength{\absparsep}{0pt} +\setlength{\abstitleskip}{16pt-8pt-\baselineskip} +\renewcommand{\abstractnamefont}{\fontsize{10pt}{12pt}\bfseries\color{jcolour}} +\renewcommand{\abstitlestyle}[1]{{\abstractnamefont #1}} +\renewcommand{\abstracttextfont}{\fontsize{8pt}{11pt}\selectfont} +\preto{\abstract}{% + {\noindent\color{jcolour!40}\rule{\hsize+4pc+6.64pt}{3pt}}\par + \vspace*{\dimexpr 23pt-10pt\relax} +} +\appto\abstract{\noindent\raggedright\ignorespaces} +\preto\endabstract{\par} + +\newenvironment{keywords} +{\vspace*{\dimexpr 19pt-8pt-\baselineskip\relax}% +\noindent\fontsize{8pt}{11pt}\selectfont\textbf{Key words}: \ignorespaces}% +{\par} + +\DeclareFloatingEnvironment[placement=t!,name=kpt]{keypoints} + +\xapptocmd{\keypoints}{% + \begin{mdframed}[linewidth=1pt,linecolor=black, + innerleftmargin=8pt,innerrightmargin=8pt, + innertopmargin=16pt-8.2pt,innerbottommargin=6pt] + {\fontsize{8.2pt}{10pt}\bfseries Key Points\par} +}{}{} +\xpretocmd{\endkeypoints}{\end{mdframed}}{}{} + +\xapptocmd{\keypoints*}{% + \begin{mdframed}[linewidth=1pt,linecolor=black, + innerleftmargin=8pt,innerrightmargin=8pt, + innertopmargin=16pt-8.2pt,innerbottommargin=6pt] + {\fontsize{8.2pt}{10pt}\bfseries Key Points\par} +}{}{} +\xpretocmd{\endkeypoints*}{\end{mdframed}}{}{} + + +\if@twocolumn + \NewEnviron{frontmatter} + {\twocolumn[% + \BODY% + \vspace*{\dimexpr 16pt-3pt-1em\relax} + {\noindent\color{jcolour!40}\rule{\hsize+4pc+6.64pt}{3pt}}\par + \vspace*{\dimexpr 23pt-1em\relax}]% + \begin{figure*}[b!] + \fontsize{6.5pt}{9.5pt}\selectfont% + \hrule% + \vspace{\dimexpr 14pt-6.5pt\relax}% + \textbf{Compiled on:} \today.\par + Draft manuscript prepared by the author.\par + \end{figure*} + } +\else + \NewEnviron{frontmatter}{% + \BODY% + \vspace*{\dimexpr 16pt-3pt-1em\relax} + {\noindent\color{jcolour!40}\rule{\hsize+4pc+6.64pt}{3pt}}\par + \vspace*{\dimexpr 23pt-1em\relax}% + \begin{figure*}[b!] + \fontsize{6.5pt}{9.5pt}\selectfont% + \hrule% + \vspace{\dimexpr 14pt-6.5pt\relax}% + \textbf{Compiled on:} \today.\par + Draft manuscript prepared by the author.\par + \end{figure*} + } +\fi + +\setcounter{secnumdepth}{0} +\titleformat*{\section}{\fontsize{10pt}{12pt}\bfseries\color{jcolour}} +\titlespacing*{\section}{0pt}{26.5pt-1em}{16pt-1em} +\titleformat*{\subsection}{\fontsize{8.5pt}{11pt}\bfseries\color{jcolour}} +\titlespacing*{\subsection}{0pt}{2pc-1em}{17pt-1em} +\titleformat*{\subsubsection}{\normalsize\bfseries\slshape} +\titlespacing*{\subsubsection}{0pt}{\baselineskip}{0pt} +\titleformat{\paragraph}[runin]{\normalsize\itshape}{\theparagraph}{0pt}{}[.\enspace] +\titlespacing*{\paragraph}{0pt}{\baselineskip}{0pt} + \titleformat{\subparagraph}[runin]{\relsize{-1}\uppercase}{\thesubparagraph}{0pt}{}[.\enspace] +\titlespacing*{\subparagraph}{0pt}{\baselineskip}{0pt} + +\RequirePackage{enumitem} +\setlist{noitemsep} +\setlist[itemize]{leftmargin=12pt,topsep=16pt-1em} +\setlist[enumerate] +{itemindent=14pt,topsep=16.8pt-1em, + label={\roman*.},labelsep=7pt, + labelwidth=*,leftmargin=*,align=right} + + +% quotes and epigraphs +\RequirePackage{quoting} +\newcommand{\quotefont}{\fontsize{6.5pt}{9.5pt}\selectfont} +\quotingsetup{vskip=16pt-1em,indentfirst=false,font={quotefont},leftmargin=12pt,rightmargin=12pt} + +\renewenvironment{quote}{\begin{quoting}}{\end{quoting}} + +\renewenvironment{quotation}{\begin{quoting}}{\end{quoting}} + +\newenvironment{epigraph}[1] +{\begin{quoting}[font={itshape,fontsize{7.5pt}{10.5pt}},vskip=15pt-1em,leftmargin=0pt,rightmargin=0pt]% + \def\@quotesource{#1}} +{\par\vspace{\dimexpr 15pt-1em\relax}{\upshape---\@quotesource}\end{quoting}} + +% Space above/below equations +\g@addto@macro\normalsize{% + \setlength\abovedisplayskip{\baselineskip}% + \setlength\belowdisplayskip{\baselineskip}% + \setlength\abovedisplayshortskip{\baselineskip}% + \setlength\belowdisplayshortskip{\baselineskip}% +} + +\RequirePackage{stfloats} +\RequirePackage{booktabs} +\RequirePackage{tabularx} +% Left-, right- and center-aligned auto-wrapping column types +\newcolumntype{L}{>{\raggedright\arraybackslash}X} +\newcolumntype{R}{>{\raggedleft\arraybackslash}X} +\newcolumntype{C}{>{\centering\arraybackslash}X} + +\AtBeginEnvironment{tabularx}{% + \fontsize{7pt}{10pt}\selectfont +} +\AtBeginEnvironment{tabular}{% + \fontsize{7pt}{10pt}\selectfont +} + +\setlength{\aboverulesep}{11pt-1em} +\setlength{\belowrulesep}{11pt-1em} +\setlength{\heavyrulewidth}{0.5pt} +\setlength{\lightrulewidth}{0.5pt} +\arrayrulecolor{jcolour} + + +\newcommand{\tnote}[1]{\textsuperscript{\textit{#1}}} +\newlist{tablenotes}{itemize}{1} +\setlist[tablenotes]{label={},labelsep=0pt,leftmargin=0pt,topsep={\dimexpr 12pt-1em\relax}} +\appto{\tablenotes}{\fontsize{6pt}{9pt}\selectfont} + +\RequirePackage[tableposition=top]{caption} +\DeclareCaptionFont{figcaptionfont}{\fontsize{6pt}{9pt}\selectfont} +\DeclareCaptionFont{tabcaptionfont}{\fontsize{7pt}{9pt}\selectfont} +\captionsetup{justification=justified,singlelinecheck=false,labelfont={bf},labelsep=period} +\captionsetup*[figure]{font=figcaptionfont,skip=10pt} +\captionsetup*[table]{font=tabcaptionfont,skip=10pt-1em} + +% Skips for floats +\setlength{\floatsep}{1pc+6pt} +\setlength{\intextsep}{1pc+6pt} +\setlength{\textfloatsep}{1pc+6pt} + +% References +\if@numrefs + \RequirePackage[numbers]{natbib} + \bibliographystyle{vancouver-authoryear} +\fi +\if@alpharefs + \RequirePackage{natbib} + \bibliographystyle{dcu} +\fi +\setlength{\bibhang}{11pt} +\setlength{\bibsep}{0pt} +\renewcommand{\bibnumfmt}[1]{#1.} \ No newline at end of file diff --git a/inst/rmarkdown/templates/gigascience/skeleton/oup.pdf b/inst/rmarkdown/templates/gigascience/skeleton/oup.pdf new file mode 100644 index 000000000..cbaed66dd Binary files /dev/null and b/inst/rmarkdown/templates/gigascience/skeleton/oup.pdf differ diff --git a/inst/rmarkdown/templates/gigascience/skeleton/paper-refs.bib b/inst/rmarkdown/templates/gigascience/skeleton/paper-refs.bib new file mode 100644 index 000000000..544746bd1 --- /dev/null +++ b/inst/rmarkdown/templates/gigascience/skeleton/paper-refs.bib @@ -0,0 +1,120 @@ +@Book{Anderberg83, + author = {Anderberg, M. R.}, + title = {Cluster Analysis for Applications}, + publisher = {New York: Academic Press}, + year = {1983}, + } + + @Manual{R:2010, + title = {R: A Language and Environment for Statistical Computing}, + author = {{R Development Core Team}}, + organization = {Vienna, Austria: R Foundation for Statistical Computing}, + address = {}, + year = {2012}, + note = {{ISBN} 3-900051-07-0, http://www.R-project.org}, + url = {http://www.R-project.org}, + } + + @Article{Arabie80, + author = {Arabie, P. and Carroll, J. D.}, + title = {MAPCLUS: A mathematical programming approach to fitting the ADCLUS models}, + journal = {Psychometrika}, + year = {1980 }, + volume = {445}, + pages = {211-35}, + } + + +@book{Tufte:1990, + Address = {Cheshire, Connecticut}, + Author = {E. R. Tufte}, + Publisher = {Graphics Press}, + Title = {{Envisioning Information}}, + Year = {1990}} + + +@book{Tufte:1983, + Address = {Cheshire}, + Author = {E. R. Tufte}, + Publisher = {Graphics Press}, + Title = {{The Visual Display of Quantitative Information}}, + Year = {1983}} + +@book{Cleveland:1994, + Address = {Summit}, + Author = {W. S. Cleveland}, + Edition = {Revised}, + Publisher = {Hobart Press}, + Title = {{The Elements of Graphing Data}}, + Year = {1994}} + +@book{Cleveland:1993, + Address = {Summit}, + Author = {W. S. Cleveland}, + Publisher = {Hobart Press}, + Title = {{Vizualizing Data}}, + Year = {1993}} + + @TECHREPORT{Ball65 , + AUTHOR = {Ball, G. H. and Hall, D. J. }, + TITLE = {A novel method of data analysis and pattern classification }, + INSTITUTION = {Stanford Research Institute, California }, + YEAR = {1965 }, + } + + @Article{Banfield93, + author = {Banfield, J. D. and Raftery, A. E.}, + title = {Model-Based Gaussian and Non-Gaussian Clustering }, + journal = {Biometrics }, + year = {1993 }, + volume = {49}, + pages = {803--21}, + } + + @Article{Beale69, + author = {Beale, E. M. L.}, + title = {Euclidean cluster analysis }, + journal = {Bulletin of the International Statistical Institute }, + year = {1969 }, + volume = {43}, + pages = {92-94}, + } + + @Article{Bensmail, + author = {Bensmail, H. }, + title = {Model-based Clustering with Noise: Bayesian inference and estimation }, + } + +@Article{Bezdek74, + author = {Bezdek, J. C.}, + title = {Numerical taxonomy with fuzzy sets}, + journal = {Journal of Methematical Biology}, + year = {1974}, + volume = {1}, + pages = {57-71}, + } + +@article{Cox:1972, + Author = {D. R. Cox}, + Journal = {J. R. Statist. Soc. {\rm B}}, + Pages = {187--220}, + Title = {{Regression models and life tables (with Discussion)}}, + Volume = {34}, + Year = {1972}} + +@article{Hear:Holm:Step:quan:2006, + Author = {Heard, Nicholas A. and Holmes, Christopher C. and Stephens, David A.}, + Journal = {J. Am. Statist. Assoc.}, + Keywords = {bayesian hierarchical clustering; gene expression profiles; Microarrays}, + Pages = {18--29}, + Title = {A Quantitative Study of Gene Regulation Involved in the Immune Response of {A}nopheline Mosquitoes: {A}n Application of {B}ayesian Hierarchical Clustering of Curves}, + Volume = {101}, + Year = {2006}} + +@article{Fan:2004, + Author = {Fan, J. and Peng, H.}, + Journal = {Ann. Statist.}, + Pages = {928--61}, + Title = {{Nonconcave penalized likelihood with a diverging number of parameters}}, + Volume = {32}, + Year = {2004}} \ No newline at end of file diff --git a/inst/rmarkdown/templates/gigascience/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/gigascience/skeleton/skeleton.Rmd new file mode 100644 index 000000000..b3f43644e --- /dev/null +++ b/inst/rmarkdown/templates/gigascience/skeleton/skeleton.Rmd @@ -0,0 +1,555 @@ +--- +# title: title of article here +title: Title of submission to GigaScience journal + +# author: list of {name,email,affiliation{*},orchid?,note{*}} +author: + - name: Alice Anonymous + email: alice@example.com + affiliation: + - 1 + orchid: 0000-0000-0000-0001 + note: + - 1 + - 2 + - name: Bob Security + email: bob@example.com + affiliation: + - 2 + - 3 + note: + - 1 + - 2 + - name: Charlie Chaplin + email: cc@actor.com + affiliation: + - 3 + orchid: 0000-0000-0000-0002 + + +# authnote: list of {id,note} +# - author footnotes +# - note for GigaScience that id 1 is should be corresponding authors' addresses +authnote: + - id: 1 + note: alice@example.com; bob@example.com + - id: 2 + note: Contributed equally + +# affiliation: list of {id,name,address?} +# - authors' institutional affiliations +affiliation: + - id: 1 + name: Some Institute of Technology + address: Some Department, Street, City, State, Zip + - id: 2 + name: Another University + - id: 3 + name: British Academy of Film and Television Arts + address: 195 Piccadilly, London, England, UK W1J 9LN + +# runningauthor: author's name in running title +runningauthor: Anonymous et al. + +# papercat (paper category) - one of: +# - Commentary +# - http://academic.oup.com/gigascience/pages/commentary +# - Data Note +# - http://academic.oup.com/gigascience/pages/data_note +# - Research +# - http://academic.oup.com/gigascience/pages/research +# - Review +# - http://academic.oup.com/gigascience/pages/review +# - Technical Note +# - http://academic.oup.com/gigascience/pages/technical_note +papercat: Technical Note + +# abstract: abstract structured according to instructions for paper category +abstract: | + The Abstract (250 words maximum) should be structured according to the instructions for the corresponding 'papercat' (paper category, see https://academic.oup.com/gigascience/pages/instructions_to_authors). + +# keywords: keywords presented as a semicolon-separated list below the abstract +keywords: + - Keyword 1 + - keyword 2 + - keyword 3 (Three to ten keywords representing the main content of the article) + +# keypoints: key points presented as a bullet list in a box at the top of the second page +keypoints: + - This is the first point + - This is the second point + - One last point. + +# highlighting-macros: list of {latex_command+} +# - This may be for syntax-highlighting source-code, but I'm not sure +# - Value is a list; each list-member is a TeX snippet +# - This is included just before 'header-includes' + +# header-includes: list of {latex_command+} +# - Value is a list; each list-member is a TeX snippet +# - You can use 'header-includes' to set or override some TeX settings, e.g., +# - This is included just before 'preamble' +# - concerning specific keys: +# - journal: Only "gigascience" and "general" are implemented now. +# - usepackage: use packages that are not declared in the TeX template used by pandoc +# - bibliographystyle: apples to the natbib TeX package +# - see http://ctan.math.washington.edu/tex-archive/macros/latex/contrib/natbib/natbib.pdf +header-includes: + - \journal{gigascience} + - \usepackage{natbib} +# # the next line is part of the document-class, oup-contemporary +# - \bibliographystyle{vancouver-authoryear} + +# preamble: Tex literal (newlines will be stripped out) +# - Value is a TeX snippet that will be collapsed to a single line +# preamble: | +# \setcounter{errorcontextlines}{4} +# \setcounter{secnumdepth}{2} + +# documentclass - the TeX document class - for GigaScience, must be oup-contemporary +documentclass: oup-contemporary + +# paper: 'a4paper' or 'letterpaper' +paper: letterpaper +#paper: a4paper + +# reftype: 'num-refs' or 'alpha-refs', but 'alpha-refs' may not work ... +reftype: num-refs +#reftype: alpha-refs + +# In some cases, it may be easier to use TeX than rmarkdown for citations: +# - TeX citations may give you more flexibility +# - e.g., references can be deleted or added subsequent to translation from rmarkdown to TeX +# - This may be important if you need to delete references on Overleaf and regenerating +# the TeX is not an option +# Hence: 'bibliography' and 'csl' below are commented out because they are only needed for citations from rmarkdown +# +# bibliography: the file with the bibtex entries +#bibliography: paper-refs.bib +# +# csl: this is needed only for citations from rmarkdown +#csl: gigascience.csl + +# output: specifies the R class used to translate rmarkdown to tex and pdf +output: + rticles::gigascience_article: + md_extensions: +raw_tex +--- + +\begin{epigraph} {\small{\href{https://academic.oup.com/gigascience/pages/instructions_to_authors}{GigaScience Instructions to Authors}}} +Sample epigraph: For creating manuscripts in LaTeX, Gigascience recommends the use of its own LaTeX class files. Our class files are available online \href{https://www.overleaf.com/latex/templates/template-for-gigascience-journal-manuscript-submissions/shgtrssvbjhs}{at Overleaf https://www.overleaf.com/latex/templates/template-for-gigascience-journal-manuscript-submissions/shgtrssvbjhs}. The GigaScience "oup-contemporary.cls" class obtained via this Overleaf link was used as the basis of this "rticle". +\end{epigraph} + +TeX/LaTeX users: Please use OUP’s TeX template and BibTeX stylefile if you use TeX format. During the TeX submission process, please submit your TeX file as the main manuscript file and your bib/bbl file as a dependent file. Please also convert your TeX file into a PDF and submit this PDF as an additional file with the name 'Reference PDF'. This PDF will be used by internal staff as a reference point to check the layout of the article as the author intended. If you have used another template for your manuscript, or if you do not wish to use BibTeX, then please submit your manuscript as a DVI file. We do not recommend converting to RTF. For all TeX submissions, all relevant editable source must be submitted during the submission process. Failing to submit these source files will cause unnecessary delays in the publication procedures. [https://academic.oup.com/gigascience/pages/technical_note](https://academic.oup.com/gigascience/pages/technical_note) + +# Notes for using this `rticle` template + +## About the GigaScience `rticle` template + +The `rticles::gigascience_journal` template is the blended `rmarkdown` and \text{\LaTeX} template for GigaScience journal manuscript submissions. + +## Important preliminaries + +- Specify your manuscript's category with the `\papercat{...}` command in the preamble. +- See the sample code in the YAML header for how author and affiliation information can be specified. + - Particularly, note that the first footnote id is reserved for corresponding authors' email addresses. + +**Please note that whilst this template provides a preview of the typeset manuscript for submission, it will not necessarily be the final publication layout.** + +# Using rmarkdown features with this template + +Reference (among others): [https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf](https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf) + +## Sectional Headings + +You can use `# Section Name` and `## Subsection name` lines to add more sections and subsections to your manuscript. Further sectional levels are provided by `### Subsubsection name`, `#### Paragraph name`, `##### Subparagraph name` lines; e.g.: + +``` + # Header 1 + section + + ## Header 2 + subsection + + ### Header 3 + subsubsection + + #### Header 4 + paragraph + + ##### Header 5 + subparagraph + + ###### Header 6 + subsubparagraph +``` +### +becomes: + +# Header 1 +section + +## Header 2 +subsection + +### Header 3 +subsubsection + +#### Header 4 +paragraph + +##### Header 5 +subparagraph + +###### Header 6 +subsubparagraph + +## Blockquotes + +> This is a quote. Lorem ipsum dolor sit amet, +> consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore +> magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco +> laboris nisi ut aliquip ex ea commodo consequat. + +## Unordered list (bullets) + +- This is a point in a bullet list. + - A sub-point must be indented four more spaces than the parent. + - The same is true for a sub-sub-point. +- A third point. + +## Ordered list (numbered list) + +1. This is a point in a numbered list. + - A sub-point must be indented four more spaces than the parent. + - The same is true for a sub-sub-point. +1. A third point. + +Use R to generate tables rather than attempting to specify them in rmarkdown. + +## Equations + +``` +inline equation: $A = \pi*r^{2}$ (Area of a circle) +``` +inline equation: $A = \pi*r^{2}$ (Area of a circle) + +``` +full-line equation: +$$A = \pi*r^{2}$$ +``` +$$A = \pi*r^{2}$$ + +## Tables + +### Making tables with rmarkdown + +Use R to generate your rmarkdown tables, e.g., see Table \ref{tab:markdown}. Granted, literal rendering of rmarkdown tables is not working, but even if it worked, it would makes no sense to use it when you can use R to lay out tables more coherently. + +\begin{table} +\caption{Table generated using rmarkdown} +\label{tab:markdown} +```{r setup, echo=FALSE, warning=FALSE} +library(knitr) +knitr::opts_chunk$set(echo = TRUE) + +kable( + t( + data.frame( + header=c("Right","Left","Center") + , value=c(1,2,3) + ) + ) +, align = c("r","l","c") +, format = "latex") +``` +\end{table} + +### Laying out tables in \text{\LaTeX} + +Table layout in \text{\LaTeX} is much less intuitive than using R, but this is possible if you find it expedient. + + +## Pre-existing figure + +When you are using RMarkdown to edit a manuscript, it may not always be better to generate images from R code chunks than to include pre-existing images; on the other hand, there certainly is nothing wrong with generating images from markdown. + +```{r warning=FALSE, dev='pdf', fig.show='hide', echo=FALSE, message=FALSE} +# That being said, a file is being generated here solely for demonstration purposes. +invisible({ + pdf(file=file.path(getwd(),'pressure.pdf')) + plot(pressure) + dev.off() +}) +``` + +### Including a figure using \text{\LaTeX} + +With the right \text{\LaTeX} it is comparatively easy to include and control the presentation of a figure is with \text{\LaTeX}. +Figure \ref{fig:pressure} is included this way, and the figure number is a clickable reference. +``` +% "bt!" means favor putting the table at the +% top or bottom of the column, if possible +% "b!" means favor putting the table at the +% bottom of the column, if possible +% "t!" means favor putting the table at the +% top of the column, if possible +\begin{figure}[bt!] +\centering +\includegraphics[width=\linewidth]{pressure.pdf} +\caption{Pressure figure from \text{\LaTeX}} +\label{fig:pressure} +\end{figure} +``` +\begin{figure}[bt!] +\centering +\includegraphics[width=\linewidth]{pressure.pdf} +\caption{Pressure figure from \text{\LaTeX}} +\label{fig:pressure} +\end{figure} + +### Including a figure using markdown + +The "Pressure from markdown"" figure is scaled to 100% because there are two columns, and failing to scale the image results in an image that is two columns wide. Furthermore, no clickable link to it is available becasue the generated TeX code has no label attribute. So, you may resort to using a \text{\LaTeX} expression anyway.... + +\begingroup + \fontsize{6pt}{8pt}\selectfont + \begin{verbatim} +```{r, results='asis', echo=FALSE} +cat(" ```{r,out.width='100%',fig.align='center',fig.cap='Pressure',echo=FALSE} + # Note that out.width='100%' is necessary to + # fit the figure to a single column + knitr::include_graphics('pressure.pdf') + ```") +``` + \end{verbatim} +\endgroup + +```{r, out.width='100%', fig.align='center', fig.cap='Pressure', echo=FALSE} +# note: out.width='100%' is necessary to fit the figure to a single column +knitr::include_graphics('pressure.pdf') +``` + +Overall, it may be easier to use \text{\LaTeX} code than force rmarkdown to do the task. + +```{r refs_section_label, echo=FALSE} + # \bibliography generates the References section label and makes the bibliography entries available through natbib to citep and citet + # However, it does not do so when running knit on .Rmd from within RStudio. + # The workaround is to open the resulting .tex file and click 'Compile PDF' a few times until there is no error. +``` + +## Citations in rmarkdown + +Using TeX for citations rather than rmarkdown for citations may be advantageous. For example, TeX citations give you the flexibility of deleting or adding references can be deleted or added subsequent to translation from rmarkdown to TeX, which could be very helpful under circumstances where you don't have the option of regenerating your TeX from rmarkdown. + +That being said, you can generate explicit references in rmarkdown using a semicolon-separated-values syntax, enclosed in square brackets, prefixing each reference with the `@` character, e.g., `[@Tufte:1983; @Cleveland:1993]`, which results in this: [@Tufte:1983; @Cleveland:1993]. The reference numbers are coded as integers in the TeX output file, which means that editing to add or remove references *must* be done in the rmarkdown file to avoid labor-intensive searching and replacing of the TeX file if the references change. So, this may not be a desirable path to take unless you are absolutely sure that you always have the option of generating TeX from your markdown, i.e., you won't be exchanging TeX with and editor. + +Note that, to get this to work, the following need to be defined in the YAML header: +``` +# these only needed for citations from rmarkdown +# bibliography: the file with the bibtex entries +bibliography: paper-refs.bib +# csl: this is needed only for citations from rmarkdown +csl: gigascience.csl +``` + + +# Using \text{\LaTeX} features with this template + +## Figures and Tables + +Figures and tables can be either a single column-width or double column-width, based on the "environment" passed to begin/end: + +- `table` - a single column-width table, e.g., Table \ref{tab:example} +- `sidewaystable` - a single column-width table, sideways in the column, e.g., Table \ref{tab:example:sideways} +- `table*` - a two column-width table, e.g., Table \ref{tab:example:wide} +- `landscape{table}` - a landscaped table spanning both columns, sideways on the page, e.g., Table \ref{tab:example:landscape} +- `figure` - a single column-width figure, e.g., Figure \ref{fig:pressure} +- `figure*` - a two column-width figure, e.g., Figure \ref{fig:pressure:wide} +- `landscape{figure}` - a landscape figure, e.g., Figure \ref{fig:pressure:landscape} + +If you have a very wide table or figure, you can use \texttt{sidewaystable} or \texttt{sidewaysfigure}, as in Table \ref{tab:example:sideways}: this will be rotated sideways and occupy a *single column* on its own. + +If your table or figure is both wide and tall (so it wouldn't fit well in a single column with \texttt{sidewaystable} or \texttt{figure}), +you can use `table` or `figure` inside a `landscape` environment for a full-page landscaped alternative. A page break will be inserted \emph{immediately before and after} the `landscape` environment (Table \ref{tab:example:landscape}), so you'll need to carefully position it in a suitable location in your manuscript. + +\begin{table}[b!] +\caption{An example table, one column-width.}\label{tab:example} +\begin{tabular}{l r l} +\toprule +Item & Quantity & Notes\\ +\midrule +Widgets & 42 & Over-supplied\textsuperscript{*} \\ +Gadgets & 13 & Under-supplied \\ +\bottomrule +\end{tabular} +\begin{tablenotes} +\item This is a table note. +\item \textsuperscript{*}Another note. +\end{tablenotes} +\end{table} + + +\begin{sidewaystable} +\caption{Automobile land speed records (GR 5-10). This is the same table as before, but rotated sideways.} +\label{tab:example:sideways} +% Use "S" column identifier (from siunitx) to align on decimal point. +% Use "L", "R" or "C" column identifier for auto-wrapping columns with tabularx. +\begin{tabularx}{\linewidth}{S l l l r L} +\toprule +{Speed (mph)} & {Driver} & {Car} & {Engine} & {Date} & {Extra comments}\\ +\midrule +407.447 & Craig Breedlove & Spirit of America & GE J47 & 8/5/63 & (Just to demo a full-width table with auto-wrapping long lines) \\ +413.199 & Tom Green & Wingfoot Express & WE J46 & 10/2/64 \\ +434.22 & Art Arfons & Green Monster & GE J79 & 10/5/64 \\ +468.719 & Craig Breedlove & Spirit of America & GE J79 & 10/13/64 \\ +526.277 & Craig Breedlove & Spirit of America & GE J79 & 10/15/65 \\ +536.712 & Art Arfons & Green Monster & GE J79 & 10/27/65 \\ +555.127 & Craig Breedlove & Spirit of America, Sonic 1 & GE J79 & 11/2/65 \\ +576.553 & Art Arfons & Green Monster & GE J79 & 11/7/65 \\ +600.601 & Craig Breedlove & Spirit of America, Sonic 1 & GE J79 & 11/15/65 \\ +622.407 & Gary Gabelich & Blue Flame & Rocket & 10/23/70 \\ +633.468 & Richard Noble & Thrust 2 & RR RG 146 & 10/4/83 \\ +763.035 & Andy Green & Thrust SSC & RR Spey & 10/15/97\\ +\bottomrule +\end{tabularx} +\begin{tablenotes} +\item Source is from this website: \url{https://www.sedl.org/afterschool/toolkits/science/pdf/ast_sci_data_tables_sample.pdf} +\end{tablenotes} +\end{sidewaystable} + + + +\begin{figure*}%[bt!] +\centering +\includegraphics{pressure.pdf} +\captionsetup{justification=centering} +\caption{An example wide figure, two column-widths.}\label{fig:pressure:wide} +\end{figure*} + +\begin{landscape} +\begin{figure}%[b!] +\centering +\includegraphics{pressure.pdf} +\captionsetup{justification=centering} +\caption{An example wide figure, two column-widths.}\label{fig:pressure:landscape} +\end{figure} +\end{landscape} + +\begin{table*}[bt!] +\caption{Automobile land speed records (GR 5-10), two column-widths}\label{tab:example:wide} +% Use "S" column identifier (from siunitx) to align on decimal point. +% Use "L", "R" or "C" column identifier for auto-wrapping columns with tabularx. +\begin{tabularx}{\linewidth}{S l l l r L} +\toprule +{Speed (mph)} & {Driver} & {Car} & {Engine} & {Date} & {Extra comments}\\ +\midrule +407.447 & Craig Breedlove & Spirit of America & GE J47 & 8/5/63 & (Just to demo a full-width table with auto-wrapping long lines) \\ +413.199 & Tom Green & Wingfoot Express & WE J46 & 10/2/64 \\ +434.22 & Art Arfons & Green Monster & GE J79 & 10/5/64 \\ +468.719 & Craig Breedlove & Spirit of America & GE J79 & 10/13/64 \\ +526.277 & Craig Breedlove & Spirit of America & GE J79 & 10/15/65 \\ +536.712 & Art Arfons & Green Monster & GE J79 & 10/27/65 \\ +555.127 & Craig Breedlove & Spirit of America, Sonic 1 & GE J79 & 11/2/65 \\ +576.553 & Art Arfons & Green Monster & GE J79 & 11/7/65 \\ +600.601 & Craig Breedlove & Spirit of America, Sonic 1 & GE J79 & 11/15/65 \\ +622.407 & Gary Gabelich & Blue Flame & Rocket & 10/23/70 \\ +633.468 & Richard Noble & Thrust 2 & RR RG 146 & 10/4/83 \\ +763.035 & Andy Green & Thrust SSC & RR Spey & 10/15/97\\ +\bottomrule +\end{tabularx} + +\begin{tablenotes} +\item Source is from this website: \url{https://www.sedl.org/afterschool/toolkits/science/pdf/ast_sci_data_tables_sample.pdf} +\end{tablenotes} +\end{table*} + +## Citations in \text{\LaTeX} + +Use the `num-refs` option for numerical citations in the `reftype` item in the YAML header or `alph-refs` for author-year citations. `alpha-refs` may not work. + +Use the `\citep` command for a list of citations (without author names), e.g., `both Tufte and Cleveland \citep{Tufte:1983,Cleveland:1993}`: + +> some fact reported by both Tufte and Cleveland \citep{Tufte:1983,Cleveland:1993}. + +Use `\citet` command for isolated citations (including author names), e.g., `both \citet{Tufte:1983} and \citet{Cleveland:1993}`: + +> some fact reported by both \citet{Tufte:1983} and \citet{Cleveland:1993}. + + +## Footnotes + +This sentence is footnoted.\footnote{This is the footnote text. Quiquid dignum actu nimium agendum est.} The footnote should appear at the bottom of the column in which the text appears. + + +\subsection{Some Mathematics Sample} + +Let $X_1, X_2, \ldots, X_n$ be a sequence of independent and identically distributed random variables with $\text{E}[X_i] = \mu$ and $\text{Var}[X_i] = \sigma^2 < \infty$, and let + +$$ +S_n = \frac{X_1 + X_2 + \cdots + X_n}{n} + = \frac{1}{n}\sum_{i}^{n} X_i +$$ +denote their mean. Then as $n$ approaches infinity, the random variables $\sqrt{n}(S_n - \mu)$ converge in distribution to a normal $\mathcal{N}(0, \sigma^2)$. + + +# Findings + +## Background + +## Performance and testing + +# Methods + +# Discussion + +# Abbreviations + +# Acknowledgements + +# Funding + +# Availability of data and materials + +# Availability of supporting code and requirements + +# Author contributions + +\bibliography{paper-refs} + +# Figures and Appendices + + +## Landscape (sideways) table +\begin{landscape} +\begin{table} +\caption{Automobile land speed records (GR 5-10). This is again the same table as before, but on a landscaped page. \textbf{Note that a hard page break is inserted immediately before and after \texttt{landscape}}, so you'll need to carefully position such an environment at a suitable location in your manuscript!} +\label{tab:example:landscape} +\begin{tabularx}{\linewidth}{S l l l r L} +\toprule +{Speed (mph)} & {Driver} & {Car} & {Engine} & {Date} & {Extra comments}\\ +\midrule +407.447 & Craig Breedlove & Spirit of America & GE J47 & 8/5/63 & (Just to demo a full-width table with auto-wrapping long lines) \\ +413.199 & Tom Green & Wingfoot Express & WE J46 & 10/2/64 \\ +434.22 & Art Arfons & Green Monster & GE J79 & 10/5/64 \\ +468.719 & Craig Breedlove & Spirit of America & GE J79 & 10/13/64 \\ +526.277 & Craig Breedlove & Spirit of America & GE J79 & 10/15/65 \\ +536.712 & Art Arfons & Green Monster & GE J79 & 10/27/65 \\ +555.127 & Craig Breedlove & Spirit of America, Sonic 1 & GE J79 & 11/2/65 \\ +576.553 & Art Arfons & Green Monster & GE J79 & 11/7/65 \\ +600.601 & Craig Breedlove & Spirit of America, Sonic 1 & GE J79 & 11/15/65 \\ +622.407 & Gary Gabelich & Blue Flame & Rocket & 10/23/70 \\ +633.468 & Richard Noble & Thrust 2 & RR RG 146 & 10/4/83 \\ +763.035 & Andy Green & Thrust SSC & RR Spey & 10/15/97\\ +\bottomrule +\end{tabularx} + +\begin{tablenotes} +\item Source is from this website: \url{https://www.sedl.org/afterschool/toolkits/science/pdf/ast_sci_data_tables_sample.pdf} +\end{tablenotes} +\end{table} +\end{landscape} + + diff --git a/inst/rmarkdown/templates/gigascience/skeleton/vancouver-authoryear.bst b/inst/rmarkdown/templates/gigascience/skeleton/vancouver-authoryear.bst new file mode 100644 index 000000000..f4b72c895 --- /dev/null +++ b/inst/rmarkdown/templates/gigascience/skeleton/vancouver-authoryear.bst @@ -0,0 +1,1812 @@ +%% natbib-compatible BibTeX bibliography style `vancouver-authoryear' +%% v1.1 2017/07/2012 Remove sorting by authors' names +%% +%% Use +%% +%% \usepackage{natbib} +%% \bibliographystyle{vancouver-authoryear} +%% +%% and cite references with (e.g.) +%% +%% \cite{smith77} % to get a "[1]" in the text +%% \citep{smith77} % to get a "[1]" in the text +%% \citet{smith77} % to get a "Smith [1]" in the text +%% \citeauthor{smith77} % to get a "Smith" in the text +%% +%% The changes below are inspired by similar changes made to +%% splncs03.bst by Maurizio "Titto" Patrignani of +%% Dipartimento di Informatica e Automazione Universita' Roma Tre. +%% Unfortunately, splncs03.bst was not compatible with natbib (because it +%% was not built with author-year capability). +%% +%% This is derived from `splncsnat.bst', +%--------------------------------------------------------------------- + +ENTRY + { address + assignee % for patents + author + booktitle % for articles in books + chapter % for incollection, esp. internet documents + cartographer % for maps + day + edition + editor + eid + howpublished + institution % for technical reports + inventor % for patents + journal + key + month + note + number + organization + pages + part + publisher + school + series + title + type + url + volume + word + year + } + {} + { label extra.label sort.label short.list } +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 := +} +%% Declaration of string variables +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$ + { " " * 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} +%{ duplicate$ empty$ +% 'pop$ +% 'write$ +% if$ +% newline$ +%} +% +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 {no.blank.or.punct} +{ "" * before.all 'output.state := +} + +FUNCTION {add.semicolon} +{ + ";" * + no.blank.or.punct +} + +FUNCTION {date.block} +{ + "." * + no.blank.or.punct +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% LOGICAL `NOT', `AND', AND `OR' % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Logical 'not': +% If the first element on the stack is A then this function +% does the following: +% push { #0 } +% push { #1 } +% So now the first 3 elements of the stack are +% { #1 } { #0 } A +% The first 3 are popped and subjected to 'if': +% If A > 0 then { #0 } is executed, else { #1 } is executed: +% if A > 0 +% then 0 +% else 1 +% So consider integers as logicals, where 1 = true and 0 = false, +% then this does +% (if A then false else true) +% which is a logical 'not'. + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% GENERAL PURPOSE FUNCTIONS FOR FORMATTING % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% issues warning if field is empty +% call with +% "field" field warning.if.empty +% Note that the first field must be between quotes +% because it is the fieldname for use in the warning message. +% + +FUNCTION {warning.if.empty} +{ empty$ + { "No " swap$ * " in " * cite$ * warning$ } + { pop$ } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % encloses string in pre- and postfix string + % call with + % prefix postfix S enclose.check + % delivers empty string if S empty + % +FUNCTION {enclose.check} +{ duplicate$ empty$ + { pop$ pop$ pop$ + "" + } + { swap$ * * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% emphasizes top of stack +% call with +% string" emphasize.check +% + +FUNCTION {emphasize.check} +{ "\Bem{" swap$ + "}" swap$ + enclose.check +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % brackets top of stack + % call with + % "string" bracket.check + % +FUNCTION {bracket.check} +{ "[" swap$ + "]" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % parenthesizes top of stack + % call with + % "string" parenthesize + % +FUNCTION {parenthesize.check} +{ "(" swap$ + ")" swap$ + enclose.check +} + +STRINGS {z} + +FUNCTION {remove.dots} +{ 'z := % expects string on top of the stack, pops the string and assigns it to variable z + "" % push empty string + { z empty$ not } % returns 0 if variable z is empty + { z #1 #1 substring$ % push the first character of variable z + z #2 global.max$ substring$ 'z := % assigns the 2nd to last character of variable z to variable z + duplicate$ "\" = % pushes 1 if the last character is "\", otherwise 0 + { * % concatenates the last 2 literals + z #1 #1 substring$ % push the first character of variable z + z #2 global.max$ substring$ 'z := % assigns the 2nd to last character of variable z to variable z + * % concatenates the last 2 literals, i.e. every character, even a dot, following a "\" will be printed + } + { duplicate$ "." = % pushes 1 if the last character is ".", otherwise 0 + 'pop$ % pushes the pop$ function + { * } % concatenates the last 2 literals + if$ % pops the last character if it is a dot, otherwise concatenates it with the string on top of the stack + } + if$ + } + while$ +} + +INTEGERS {l} +FUNCTION{string.length} +{ + #1 'l := + { duplicate$ duplicate$ #1 l substring$ = not } + { l #1 + 'l := } + while$ + pop$ l +} + +STRINGS {replace find text} +INTEGERS {find_length} +FUNCTION {find.replace} +{ + 'replace := + 'find := + 'text := + find string.length 'find_length := + "" + { text empty$ not } + { text #1 find_length substring$ find = + { + replace * + text #1 find_length + global.max$ substring$ 'text := + } + { text #1 #1 substring$ * + text #2 global.max$ substring$ 'text := + } + if$ + } + while$ +} + +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} +{ skip$ } + +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +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} +{ "editors" } + +FUNCTION {bbl.editor} +{ "editor" } + +FUNCTION {bbl.cartographers} +{ "cartographers" } + +FUNCTION {bbl.cartographer} +{ "cartographer" } + +FUNCTION {bbl.inventors} +{ "inventors" } + +FUNCTION {bbl.inventor} +{ "inventor" } + +FUNCTION {bbl.assignees} +{ "assignees" } + +FUNCTION {bbl.assignee} +{ "assignee" } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "ed." } + +FUNCTION {bbl.volume} +{ "vol." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "p." } + +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} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +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."} + +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. Software Eng."} + +MACRO {ieeetc} {"IEEE Trans. Comput."} + +MACRO {ieeetcad} + {"IEEE Trans. Comput. Aid. Des."} + +MACRO {ipl} {"Inf. Process. Lett."} + +MACRO {jacm} {"J.~ACM"} + +MACRO {jcss} {"J.~Comput. Syst. Sci."} + +MACRO {scp} {"Sci. Comput. Program."} + +MACRO {sicomp} {"SIAM J. Comput."} + +MACRO {tocs} {"ACM Trans. Comput. Syst."} + +MACRO {tods} {"ACM Trans. Database Syst."} + +MACRO {tog} {"ACM Trans. Graphic."} + +MACRO {toms} {"ACM Trans. Math. Software"} + +MACRO {toois} {"ACM Trans. Office Inf. Syst."} + +MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} + +MACRO {tcs} {"Theor. Comput. Sci."} + +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$ +} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +INTEGERS { nameptr namesleft numnames } + + +STRINGS { bibinfo} + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + "." ". " find.replace 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{ f{}}{ jj}" + format.name$ + remove.dots + bibinfo bibinfo.check + 't := + nameptr #1 > + { + nameptr #6 + #1 + = + numnames #6 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + +FUNCTION {format.names.org} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ff~}{vv~}{ll}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { "; " * t * } + { + ";" * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ + author "author" format.names + %%"." " " "author" find.replace format.names +} + +FUNCTION {format.organizations} +{ organization "organization" format.names.org +} + +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {get.bbl.cartographer} +{ cartographer num.names$ #1 > 'bbl.cartographers 'bbl.cartographer if$ } + +FUNCTION {get.bbl.inventor} +{ inventor num.names$ #1 > 'bbl.inventors 'bbl.inventor if$ } + +FUNCTION {get.bbl.assignee} +{ assignee num.names$ #1 > 'bbl.assignees 'bbl.assignee if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.editor + * + } + if$ +} + +FUNCTION {format.assignees} +{ assignee "assignee" format.names.org duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.assignee + * + } + if$ +} + +FUNCTION {format.cartographers} +{ cartographer "cartographer" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.cartographer + * + } + if$ +} + +FUNCTION {format.inventors} +{ inventor "inventor" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.inventor + * + } + if$ +} + +FUNCTION {format.note} +{ + url empty$ + 'skip$ + { "\urlprefix\url{" url * "}" * output } + if$ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title +%%duplicate$ empty$ 'skip$ +%% { "t" change.case$ } +%%if$ + "title" bibinfo.check +} + + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor } + if$ + } + { author } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[{" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "}]{" * 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} +{ bbl.in capitalize + ":" * + " " * } + +FUNCTION {format.journal.date} +{ + month "month" bibinfo.check + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { + swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + " " * swap$ + } + if$ + * + remove.dots + } + if$ + duplicate$ empty$ + 'skip$ + { + before.all 'output.state := + after.sentence 'output.state := + } + if$ +} + +FUNCTION {format.date} +{ + no.blank.or.punct + ";" + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + swap$ + " " * swap$ + } + if$ + * + } + if$ +} + +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + } + if$ +} + +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.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ bbl.of space.word * swap$ + 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.prefix "number" bibinfo.check * * + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { +% convert.edition + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + 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 duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} + +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ":" * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} + +FUNCTION {format.vol.num} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + format.journal.pages +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ + } + + FUNCTION {format.booktitle} + { + booktitle "booktitle" bibinfo.check + } + + FUNCTION {format.in.ed.booktitle} + { format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + "," * + " " * + get.bbl.editor + ". " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ + } + + FUNCTION {format.in.ed.title} + { format.title duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + "," * + " " * + get.bbl.editor + ". " * + * swap$ + * } + if$ + word.in swap$ * + } + 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 duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ + number "number" bibinfo.check + %%type duplicate$ empty$ + %%{ pop$ bbl.techrep } + %%'skip$ + %%if$ + %%"type" bibinfo.check + %%swap$ duplicate$ empty$ + %%{ pop$ "t" change.case$ } + %%{ tie.or.space.prefix * * } + %%if$ +} + +FUNCTION {format.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + address "address" bibinfo.check * + t empty$ + 'skip$ + { address empty$ + 'skip$ + { ": " * } + if$ + t * + } + if$ + } + if$ +} + +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {format.institution.address} +{ institution "institution" bibinfo.check format.org.or.pub +} +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + capitalize + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {misc} +{ output.bibitem + format.authors "author" output.check + format.editors "author and editor" output.check + format.title "title" output.check + type missing$ + { skip$ } +% { format.type "type" output.check } + { "type" output.check } + %%{ inbrackets type output } + if$ + new.block + format.publisher.address output + format.date "year" output.check + new.block + format.note output + new.block + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output +% output.web.refs % urlbst + fin.entry + empty.misc.check +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + organization empty$ + 'skip$ + { author empty$ + { + format.organizations "organization" output.check + } + { + "; " * + no.blank.or.punct + format.organizations "organization" output.check + } + if$ + } + if$ + new.block + format.title "title" output.check + type missing$ + { skip$ } + { "type" output.check } + if$ + new.block + journal + remove.dots + "journal" bibinfo.check + "journal" output.check + format.journal.date "year" output.check + add.semicolon + format.vol.num.pages output + new.block + format.note output +% output.web.refs % urlbst + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { editor empty$ + { format.organizations "organization" output.check } + { format.editors "author and editor" output.check } + if$ + } + { format.authors output.nonnull + "author and editor" editor either.or.check + } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + new.block + format.edition output + new.sentence + author empty$ not + editor empty$ not + and + { format.editors "author and editor" output.check } + 'skip$ + if$ + format.number.series output + format.publisher.address output + format.date "year" output.check + new.block + format.note output +% output.web.refs % urlbst + fin.entry +} +FUNCTION {booklet} +{ misc } + +FUNCTION {dictionary} +{ output.bibitem + format.booktitle "booktitle" output.check + format.bvolume output + new.block + format.edition output + new.sentence + format.publisher.address output + format.date "year" output.check + format.btitle "title" output.check + add.semicolon + add.blank + format.pages "pages" output.check + new.block + format.note output +% output.web.refs % urlbst + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + format.authors "author" output.check + new.block + chapter "chapter" output.check + new.block + format.in.ed.title "title" output.check + format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + format.date "year" output.check + date.block + add.blank + format.pages "pages" output.check + new.block + format.note output +% output.web.refs % urlbst + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + format.date "year" output.check + date.block +% add.blank + format.pages "pages" output.check + new.block + format.note output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.in.ed.booktitle "booktitle" output.check + format.bvolume output + new.sentence + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.date "year" output.check + date.block + add.blank + format.pages "pages" output.check + new.block + format.note output +% output.web.refs % urlbst + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output +% add.colon + new.block + format.btitle "title" output.check + organization address new.block.checkb + organization "organization" bibinfo.check output + address "address" bibinfo.check output + format.edition output + format.date "year" output.check + % new.block ++++ REMOVED (to get comma before note) + format.note output + fin.entry +} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.btitle "title" output.check + new.block + "PhD thesis" format.thesis.type output.nonnull + school "school" bibinfo.warn output +% address "address" bibinfo.check output + format.date "year" output.check +% new.block +% format.note output +% output.web.refs % urlbst + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output +% add.colon + new.block + format.btitle "title" output.check + format.bvolume output + new.sentence + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.date "year" output.check + % new.block ++++ REMOVED (to get comma before note) + format.note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + new.block + format.title + "title" output.check + new.block + format.institution.address output + format.date "year" output.check +% format.tr.number output.nonnull +% new.block +% format.note output +% output.web.refs % urlbst + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output +% add.colon + new.block + format.title "title" output.check + format.date "year" output.check + % new.block ++++ REMOVED (to get comma before note) + format.note "note" output.check + fin.entry +} + +FUNCTION {default.type} { misc } +READ +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} +FUNCTION {format.lab.names} +{ 's := + "" 't := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ + " " * bbl.etal * + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal * + } + { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + { pop$ "????" } + 'skip$ + if$ + * + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ll{ }}{ ff{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + " " * + namesleft #1 = t "others" = and + { "zzzzz" * } + { t sortify * } + if$ + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} +FUNCTION {presort} +{ calc.label + % label sortify + % " " + % * + % type$ "book" = + % type$ "inbook" = + % or + % 'author.editor.sort + % { type$ "proceedings" = + % 'editor.sort + % 'author.sort + % if$ + % } + % if$ + % #1 entry.max$ substring$ + % 'sort.label := + % sort.label + % * + % " " + % * + % title field.or.null + % sort.format.title + % * + % #1 entry.max$ substring$ + % 'sort.key$ := +} + +ITERATE {presort} +SORT +STRINGS { last.label next.extra } +INTEGERS { last.extra.num number.label } +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := + #0 'number.label := +} +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num int.to.chr$ 'extra.label := + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} +EXECUTE {initialize.extra.label.stuff} +ITERATE {forward.pass} +REVERSE {reverse.pass} +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} +% ITERATE {bib.sort.order} +% SORT +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\providecommand{\natexlab}[1]{#1}" + write$ newline$ + "\providecommand{\url}[1]{\texttt{#1}}" + write$ newline$ +% "\providecommand{\urlprefix}{URL }" ++++ EMPTIED by default + "\providecommand{\urlprefix}{}" + 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 `splncsnat.bst'. diff --git a/inst/rmarkdown/templates/gigascience/template.yaml b/inst/rmarkdown/templates/gigascience/template.yaml new file mode 100644 index 000000000..ff7c3b440 --- /dev/null +++ b/inst/rmarkdown/templates/gigascience/template.yaml @@ -0,0 +1,5 @@ +name: GigaScience Journal Article +description: > + Template for creating an article for submission to GigaScience +create_dir: true + diff --git a/man/article.Rd b/man/article.Rd index 21df48297..b6c2a4147 100644 --- a/man/article.Rd +++ b/man/article.Rd @@ -15,6 +15,7 @@ \alias{ctex} \alias{elsevier_article} \alias{frontiers_article} +\alias{gigascience_article} \alias{glossa_article} \alias{ims_article} \alias{informs_article} @@ -88,6 +89,12 @@ elsevier_article( frontiers_article(..., keep_tex = TRUE) +gigascience_article( + keep_tex = TRUE, + md_extensions = c("-autolink_bare_uris"), + ... +) + glossa_article(..., keep_tex = TRUE, latex_engine = "xelatex") ims_article( @@ -264,6 +271,12 @@ articles. Adapted from \url{https://www.frontiersin.org/about/author-guidelines}. } +\section{\code{gigascience_article}}{ + Format for creating submissions to the +GigaScience journal. Adapted from GigaScience Overleaf template +\url{https://www.overleaf.com/latex/templates/template-for-gigascience-journal-manuscript-submissions/shgtrssvbjhs}. +} + \section{\code{glossa_article}}{ Format for creating submissions to Glossa: a journal of general linguistics. Author Guidelines are available on diff --git a/tests/testit/test-formats.R b/tests/testit/test-formats.R index a7d8c66ff..acf0d58cc 100644 --- a/tests/testit/test-formats.R +++ b/tests/testit/test-formats.R @@ -49,6 +49,7 @@ test_format("copernicus") test_format("ctex", skip = !xfun::is_linux()) # only on linux due to fonts requirements test_format("elsevier", skip = !rmarkdown::pandoc_available("2.10")) test_format("frontiers") +test_format("gigascience") test_format("glossa") test_format("ieee") test_format("ims")