├── .github └── workflows │ └── render-examples.yaml ├── .gitignore ├── .quartoignore ├── LICENSE ├── README.md ├── _extensions └── arxiv │ ├── _extension.yml │ ├── arxiv.sty │ ├── orcidlink.sty │ ├── partials │ ├── _authors.tex │ ├── before-body.tex │ └── title.tex │ └── shortcodes.lua ├── _publish.yml ├── _quarto.yml ├── bibliography.bib ├── quarto-arxiv.Rproj ├── sunflower.png └── template.qmd /.github/workflows/render-examples.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: [main, master] 4 | workflow_dispatch: 5 | 6 | name: render-examples 7 | 8 | jobs: 9 | render-examples: 10 | runs-on: ubuntu-latest 11 | env: 12 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Install TeX Live packages 17 | run: sudo apt install -y texlive-base texlive-xetex latexmk 18 | 19 | - uses: r-lib/actions/setup-pandoc@v2 20 | 21 | - uses: r-lib/actions/setup-r@v2 22 | with: 23 | r-version: release 24 | use-public-rspm: true 25 | 26 | - name: Install R dependencies 27 | run: | 28 | install.packages('pak') 29 | pak::pkg_install(c("rmarkdown", "MASS", "broom", "kableExtra")) 30 | shell: Rscript {0} 31 | 32 | - uses: quarto-dev/quarto-actions/setup@v2 33 | 34 | - uses: quarto-dev/quarto-actions/publish@v2 35 | with: 36 | QUARTO_PUB_AUTH_TOKEN: ${{ secrets.QUARTO_PUB_AUTH_TOKEN }} 37 | target: quarto-pub 38 | path: template.qmd 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .Rproj.user 3 | template.tex 4 | /.quarto/ 5 | arxiv.sty 6 | orcidlink.sty 7 | -------------------------------------------------------------------------------- /.quartoignore: -------------------------------------------------------------------------------- 1 | # Add files / folder that are useful to your repo 2 | # but should not be in the downloaded bundle after `quarto use template` 3 | style-guide 4 | quarto-arxiv.Rproj 5 | .github 6 | _quarto.yml 7 | docs 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Mike Mahoney 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ArXiv Template 2 | 3 | This is a Quarto template that assists you in creating PDF outputs which closely match the arXiv template for the rticles package (which is itself derived from [kourgeorge/arxiv-style](https://github.com/kourgeorge/arxiv-style)). If you are intending to publish your article on arXiv, it is highly recommended you upload your TeX files (and supporting files) directly. However, this template supports rendering decent looking PDFs for upload to other repositories either before or instead of submission to arXiv itself. The TeX generated from the default `.qmd` template also passes arxiv's pre-submission build process and checks, and so preprints generated from this template _may_ be able to be submitted to arXiv without any alterations. 4 | 5 | There are currently a few differences between the PDFs generated by this template and those generated by the arXiv rticles template: 6 | 7 | 1. The fonts and spacings are not a perfect match. PRs to fix this are more than welcome. 8 | 2. References and links are not currently hyperlinked. PRs to fix this also more than welcome. 9 | 3. ORCiD IDs will be rendered as clickable logos next to author names. This is an intentional change. 10 | 4. Emails will be displayed as hyperlinks, and not in monospaced font. This is intentional. 11 | 5. Authors with multiple affiliations will have each affiliation listed. This is intentional. 12 | 13 | Any other differences are unintentional bugs -- please open an issue about anything you encounter! 14 | 15 | ## Installation 16 | 17 | You can use this as a template to create a new article. To do this, use the following command: 18 | 19 | ```bash 20 | quarto use template mikemahoney218/quarto-arxiv 21 | ``` 22 | 23 | This will install the extension and create an example qmd file and bibiography that you can use as a starting place for your article. 24 | 25 | You may also use this format with an existing Quarto project or document. From the quarto project or document directory, run the following command to install this format: 26 | 27 | ```bash 28 | quarto install extension mikemahoney218/quarto-arxiv 29 | ``` 30 | 31 | This template uses the Latin Modern family of fonts. On Mac, you might need to install these using: 32 | 33 | ```bash 34 | brew install --cask font-latin-modern 35 | brew install --cask font-latin-modern-math 36 | ``` 37 | 38 | On Ubuntu, you might need to install these fonts using: 39 | 40 | ```bash 41 | sudo apt install lmodern 42 | ``` 43 | 44 | If you have installation instructions for these fonts on another platform, please feel free to open an issue or send in a PR! 45 | 46 | ## Usage 47 | 48 | To use the format, you can use the format names `arxiv-pdf` and `arxiv-html`. For example: 49 | 50 | ```bash 51 | quarto render article.qmd --to arxiv-pdf 52 | ``` 53 | 54 | or in your document yaml 55 | 56 | ```yaml 57 | format: 58 | pdf: default 59 | arxiv-pdf: 60 | keep-tex: true 61 | ``` 62 | 63 | You can view a preview of the rendered template at . 64 | 65 | This template provides a few custom YAML header options to control the PDF output: 66 | 67 | ```yaml 68 | linenumbers: false # Add (continuous) line numbers? 69 | doublespacing: false # Double space the PDF output? 70 | runninghead: "A Preprint" # The text on the top of each page of the output 71 | authorcols: false # Should authors be listed in a single column (default) or in multiple columns (`authorcols: true`) 72 | ``` 73 | 74 | Both `linenumbers` and `doublespacing` are booleans, defaulting to `false`, 75 | and were added in version 0.2.0. `runninghead` can be any text and was added 76 | in version 0.2.1. You can define these either as top-level options, or under 77 | `arxiv-pdf`; they only impact the generated PDF. 78 | 79 | ## In The Wild 80 | 81 | Use this template for a paper or a preprint? [Let me know,](https://github.com/mikemahoney218/quarto-arxiv/issues/new) and I'll add it to the list below! 82 | 83 | The following papers were rendered using this template: 84 | 85 | + [Fine-resolution landscape-scale biomass mapping using a spatiotemporal patchwork of LiDAR coverages](https://arxiv.org/pdf/2205.08530.pdf) -- now published at [International Journal of Applied Earth Observation and Geoinformation](https://doi.org/10.1016/j.jag.2022.103059)! 86 | + [Classification and mapping of low-statured ‘shrubland’ cover types in post-agricultural landscapes of the US Northeast](https://arxiv.org/pdf/2205.05047.pdf) (version 1) -- now published at [International Journal of Remote Sensing](https://doi.org/10.1080/01431161.2022.2155086)! 87 | + [Borch: A Deep Universal Probabilistic Programming Language](https://arxiv.org/abs/2209.06168) 88 | + [Analysing and visualising bike-sharing demand with outliers](https://arxiv.org/abs/2204.06112) (version 2) 89 | + [RANG: Reconstructing reproducible R computational environments](https://arxiv.org/abs/2303.04758) (with source code at https://github.com/chainsawriot/rang/tree/paper/paper !) 90 | + [Assessing the performance of spatial cross-validation approaches for models of spatially structured data](https://arxiv.org/abs/2303.07334) (with source code at https://github.com/cafri-labs/assessing-spatial-cv/ !) 91 | + [waywiser: Ergonomic Methods for Assessing Spatial Models](https://arxiv.org/abs/2303.11312) 92 | + [Mapping historical forest biomass for stock-change assessments at parcel to landscape scales](https://arxiv.org/abs/2304.02632) -- now published at [Forest Ecology and Management](https://doi.org/10.1016/j.foreco.2023.121348)! 93 | + [tmfast fits topic models fast](https://arxiv.org/abs/2305.01535) 94 | + [Strategies and Challenges for Creating Systematic Individual Reports in R using RMarkdown and Quarto](https://doi.org/10.31235/osf.io/2jx9a) 95 | -------------------------------------------------------------------------------- /_extensions/arxiv/_extension.yml: -------------------------------------------------------------------------------- 1 | title: ArXiv Template 2 | author: Mike Mahoney 3 | version: 0.2.3 4 | contributes: 5 | formats: 6 | common: 7 | # define below YAML configuration common to all formats 8 | # filters: 9 | # You can include here Lua filters from your extension format 10 | shortcodes: 11 | # You can include here Lua filters defining shortcodes from your extension 12 | - shortcodes.lua 13 | knitr: 14 | opts_chunk: 15 | echo: false 16 | number-sections: true 17 | pdf: 18 | # define default configuration for the pdf version of your format 19 | documentclass: article 20 | linenumbers: false 21 | doublespacing: false 22 | authorcols: false 23 | # Content to add in header that your format is using 24 | header-includes: | 25 | \usepackage{arxiv} 26 | \usepackage{orcidlink} 27 | \usepackage{amsmath} 28 | \usepackage[T1]{fontenc} 29 | template-partials: ["partials/_authors.tex", "partials/title.tex", "partials/before-body.tex"] 30 | mathfont: "Latin Modern Math" 31 | mainfont: "Latin Modern Roman" 32 | format-resources: 33 | # Add here the resources required for the PDF rendering 34 | - arxiv.sty 35 | - orcidlink.sty 36 | html: 37 | toc: true 38 | # Use a CSL file to style (https://www.zotero.org/styles/) 39 | csl: https://www.zotero.org/styles/chicago-author-date-16th-edition 40 | -------------------------------------------------------------------------------- /_extensions/arxiv/arxiv.sty: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e} 2 | 3 | \ProcessOptions\relax 4 | 5 | % fonts 6 | \renewcommand{\rmdefault}{ptm} 7 | \renewcommand{\sfdefault}{phv} 8 | 9 | % set page geometry 10 | \usepackage[verbose=true,letterpaper]{geometry} 11 | \AtBeginDocument{ 12 | \newgeometry{ 13 | textheight=9in, 14 | textwidth=6.5in, 15 | top=1in, 16 | headheight=14pt, 17 | headsep=25pt, 18 | footskip=30pt 19 | } 20 | } 21 | 22 | \widowpenalty=10000 23 | \clubpenalty=10000 24 | \flushbottom 25 | \sloppy 26 | 27 | \usepackage{fancyhdr} 28 | \fancyhf{} 29 | \pagestyle{fancy} 30 | \renewcommand{\headrulewidth}{0pt} 31 | \fancyheadoffset{0pt} 32 | \rhead{\scshape \runninghead - \today} 33 | \cfoot{\thepage} 34 | 35 | % font sizes with reduced leading 36 | \renewcommand{\normalsize}{% 37 | \@setfontsize\normalsize\@xpt\@xipt 38 | \abovedisplayskip 7\p@ \@plus 2\p@ \@minus 5\p@ 39 | \abovedisplayshortskip \z@ \@plus 3\p@ 40 | \belowdisplayskip \abovedisplayskip 41 | \belowdisplayshortskip 4\p@ \@plus 3\p@ \@minus 3\p@ 42 | } 43 | \normalsize 44 | \renewcommand{\small}{% 45 | \@setfontsize\small\@ixpt\@xpt 46 | \abovedisplayskip 6\p@ \@plus 1.5\p@ \@minus 4\p@ 47 | \abovedisplayshortskip \z@ \@plus 2\p@ 48 | \belowdisplayskip \abovedisplayskip 49 | \belowdisplayshortskip 3\p@ \@plus 2\p@ \@minus 2\p@ 50 | } 51 | \renewcommand{\footnotesize}{\@setfontsize\footnotesize\@ixpt\@xpt} 52 | \renewcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt} 53 | \renewcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt} 54 | \renewcommand{\large}{\@setfontsize\large\@xiipt{14}} 55 | \renewcommand{\Large}{\@setfontsize\Large\@xivpt{16}} 56 | \renewcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{20}} 57 | \renewcommand{\huge}{\@setfontsize\huge\@xxpt{23}} 58 | \renewcommand{\Huge}{\@setfontsize\Huge\@xxvpt{28}} 59 | 60 | % sections with less space 61 | \providecommand{\section}{} 62 | \renewcommand{\section}{% 63 | \@startsection{section}{1}{\z@}% 64 | {-2.0ex \@plus -0.5ex \@minus -0.2ex}% 65 | { 1.5ex \@plus 0.3ex \@minus 0.2ex}% 66 | {\large\bf\raggedright}% 67 | } 68 | \providecommand{\subsection}{} 69 | \renewcommand{\subsection}{% 70 | \@startsection{subsection}{2}{\z@}% 71 | {-1.8ex \@plus -0.5ex \@minus -0.2ex}% 72 | { 0.8ex \@plus 0.2ex}% 73 | {\normalsize\bf\raggedright}% 74 | } 75 | \providecommand{\subsubsection}{} 76 | \renewcommand{\subsubsection}{% 77 | \@startsection{subsubsection}{3}{\z@}% 78 | {-1.5ex \@plus -0.5ex \@minus -0.2ex}% 79 | { 0.5ex \@plus 0.2ex}% 80 | {\normalsize\bf\raggedright}% 81 | } 82 | \providecommand{\paragraph}{} 83 | \renewcommand{\paragraph}{% 84 | \@startsection{paragraph}{4}{\z@}% 85 | {1.5ex \@plus 0.5ex \@minus 0.2ex}% 86 | {-1em}% 87 | {\normalsize\bf}% 88 | } 89 | \providecommand{\subparagraph}{} 90 | \renewcommand{\subparagraph}{% 91 | \@startsection{subparagraph}{5}{\z@}% 92 | {1.5ex \@plus 0.5ex \@minus 0.2ex}% 93 | {-1em}% 94 | {\normalsize\bf}% 95 | } 96 | \providecommand{\subsubsubsection}{} 97 | \renewcommand{\subsubsubsection}{% 98 | \vskip5pt{\noindent\normalsize\rm\raggedright}% 99 | } 100 | 101 | % float placement 102 | \renewcommand{\topfraction }{0.85} 103 | \renewcommand{\bottomfraction }{0.4} 104 | \renewcommand{\textfraction }{0.1} 105 | \renewcommand{\floatpagefraction}{0.7} 106 | 107 | \newlength{\@abovecaptionskip}\setlength{\@abovecaptionskip}{7\p@} 108 | \newlength{\@belowcaptionskip}\setlength{\@belowcaptionskip}{\z@} 109 | 110 | \setlength{\abovecaptionskip}{\@abovecaptionskip} 111 | \setlength{\belowcaptionskip}{\@belowcaptionskip} 112 | 113 | % swap above/belowcaptionskip lengths for tables 114 | \renewenvironment{table} 115 | {\setlength{\abovecaptionskip}{\@belowcaptionskip}% 116 | \setlength{\belowcaptionskip}{\@abovecaptionskip}% 117 | \@float{table}} 118 | {\end@float} 119 | 120 | % footnote formatting 121 | \setlength{\footnotesep }{6.65\p@} 122 | \setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@} 123 | \renewcommand{\footnoterule}{\kern-3\p@ \hrule width 12pc \kern 2.6\p@} 124 | \setcounter{footnote}{0} 125 | 126 | % paragraph formatting 127 | \setlength{\parindent}{\z@} 128 | \setlength{\parskip }{5.5\p@} 129 | 130 | % list formatting 131 | \setlength{\topsep }{4\p@ \@plus 1\p@ \@minus 2\p@} 132 | \setlength{\partopsep }{1\p@ \@plus 0.5\p@ \@minus 0.5\p@} 133 | \setlength{\itemsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@} 134 | \setlength{\parsep }{2\p@ \@plus 1\p@ \@minus 0.5\p@} 135 | \setlength{\leftmargin }{3pc} 136 | \setlength{\leftmargini }{\leftmargin} 137 | \setlength{\leftmarginii }{2em} 138 | \setlength{\leftmarginiii}{1.5em} 139 | \setlength{\leftmarginiv }{1.0em} 140 | \setlength{\leftmarginv }{0.5em} 141 | \def\@listi {\leftmargin\leftmargini} 142 | \def\@listii {\leftmargin\leftmarginii 143 | \labelwidth\leftmarginii 144 | \advance\labelwidth-\labelsep 145 | \topsep 2\p@ \@plus 1\p@ \@minus 0.5\p@ 146 | \parsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@ 147 | \itemsep \parsep} 148 | \def\@listiii{\leftmargin\leftmarginiii 149 | \labelwidth\leftmarginiii 150 | \advance\labelwidth-\labelsep 151 | \topsep 1\p@ \@plus 0.5\p@ \@minus 0.5\p@ 152 | \parsep \z@ 153 | \partopsep 0.5\p@ \@plus 0\p@ \@minus 0.5\p@ 154 | \itemsep \topsep} 155 | \def\@listiv {\leftmargin\leftmarginiv 156 | \labelwidth\leftmarginiv 157 | \advance\labelwidth-\labelsep} 158 | \def\@listv {\leftmargin\leftmarginv 159 | \labelwidth\leftmarginv 160 | \advance\labelwidth-\labelsep} 161 | \def\@listvi {\leftmargin\leftmarginvi 162 | \labelwidth\leftmarginvi 163 | \advance\labelwidth-\labelsep} 164 | 165 | % create title 166 | \providecommand{\maketitle}{} 167 | \renewcommand{\maketitle}{% 168 | \par 169 | \begingroup 170 | \renewcommand{\thefootnote}{\fnsymbol{footnote}} 171 | % for perfect author name centering 172 | \renewcommand{\@makefnmark}{\hbox to \z@{$^{\@thefnmark}$\hss}} 173 | % The footnote-mark was overlapping the footnote-text, 174 | % added the following to fix this problem (MK) 175 | \long\def\@makefntext##1{% 176 | \parindent 1em\noindent 177 | \hbox to 1.8em{\hss $\m@th ^{\@thefnmark}$}##1 178 | } 179 | \thispagestyle{empty} 180 | \@maketitle 181 | \@thanks 182 | %\@notice 183 | \endgroup 184 | \let\maketitle\relax 185 | \let\thanks\relax 186 | } 187 | 188 | % rules for title box at top of first page 189 | \newcommand{\@toptitlebar}{ 190 | \hrule height 2\p@ 191 | \vskip 0.25in 192 | \vskip -\parskip% 193 | } 194 | \newcommand{\@bottomtitlebar}{ 195 | \vskip 0.29in 196 | \vskip -\parskip 197 | \hrule height 2\p@ 198 | \vskip 0.09in% 199 | } 200 | 201 | % create title (includes both anonymized and non-anonymized versions) 202 | \providecommand{\@maketitle}{} 203 | \renewcommand{\@maketitle}{% 204 | \vbox{% 205 | \hsize\textwidth 206 | \linewidth\hsize 207 | \vskip 0.1in 208 | \@toptitlebar 209 | \centering 210 | {\LARGE\sc \@title\par} 211 | \@bottomtitlebar 212 | \textsc{\runninghead}\\ 213 | \vskip 0.1in 214 | \def\And{% 215 | \end{tabular}\hfil\linebreak[0]\hfil% 216 | \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces% 217 | } 218 | \def\AND{% 219 | \end{tabular}\hfil\linebreak[4]\hfil% 220 | \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\ignorespaces% 221 | } 222 | \begin{tabular}[t]{c}\bf\rule{\z@}{24\p@}\@author\end{tabular}% 223 | \vskip 0.4in \@minus 0.1in \center{\today} \vskip 0.2in 224 | } 225 | } 226 | 227 | % add conference notice to bottom of first page 228 | \newcommand{\ftype@noticebox}{8} 229 | \newcommand{\@notice}{% 230 | % give a bit of extra room back to authors on first page 231 | \enlargethispage{2\baselineskip}% 232 | \@float{noticebox}[b]% 233 | \footnotesize\@noticestring% 234 | \end@float% 235 | } 236 | 237 | % abstract styling 238 | \renewenvironment{abstract} 239 | { 240 | \centerline 241 | {\large \bfseries \scshape Abstract} 242 | \begin{quote} 243 | } 244 | { 245 | \end{quote} 246 | } 247 | 248 | \endinput 249 | -------------------------------------------------------------------------------- /_extensions/arxiv/orcidlink.sty: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `orcidlink.sty', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% orcidlink.dtx (with options: `package') 8 | %% 9 | %% This is a generated file. 10 | %% 11 | %% Copyright (C) 2020 by Leo C. Stein 12 | %% -------------------------------------------------------------------------- 13 | %% This work may be distributed and/or modified under the 14 | %% conditions of the LaTeX Project Public License, either version 1.3 15 | %% of this license or (at your option) any later version. 16 | %% The latest version of this license is in 17 | %% http://www.latex-project.org/lppl.txt 18 | %% and version 1.3 or later is part of all distributions of LaTeX 19 | %% version 2005/12/01 or later. 20 | %% 21 | \NeedsTeXFormat{LaTeX2e}[1994/06/01] 22 | \ProvidesPackage{orcidlink} 23 | [2021/06/11 v1.0.4 Linked ORCiD logo macro package] 24 | 25 | %% All I did was package up Milo's code on TeX.SE, 26 | %% see https://tex.stackexchange.com/a/445583/34063 27 | \RequirePackage{hyperref} 28 | \RequirePackage{tikz} 29 | 30 | \ProcessOptions\relax 31 | 32 | \usetikzlibrary{svg.path} 33 | 34 | \definecolor{orcidlogocol}{HTML}{A6CE39} 35 | \tikzset{ 36 | orcidlogo/.pic={ 37 | \fill[orcidlogocol] svg{M256,128c0,70.7-57.3,128-128,128C57.3,256,0,198.7,0,128C0,57.3,57.3,0,128,0C198.7,0,256,57.3,256,128z}; 38 | \fill[white] svg{M86.3,186.2H70.9V79.1h15.4v48.4V186.2z} 39 | svg{M108.9,79.1h41.6c39.6,0,57,28.3,57,53.6c0,27.5-21.5,53.6-56.8,53.6h-41.8V79.1z M124.3,172.4h24.5c34.9,0,42.9-26.5,42.9-39.7c0-21.5-13.7-39.7-43.7-39.7h-23.7V172.4z} 40 | svg{M88.7,56.8c0,5.5-4.5,10.1-10.1,10.1c-5.6,0-10.1-4.6-10.1-10.1c0-5.6,4.5-10.1,10.1-10.1C84.2,46.7,88.7,51.3,88.7,56.8z}; 41 | } 42 | } 43 | 44 | %% Reciprocal of the height of the svg whose source is above. The 45 | %% original generates a 256pt high graphic; this macro holds 1/256. 46 | \newcommand{\@OrigHeightRecip}{0.00390625} 47 | 48 | %% We will compute the current X height to make the logo the right height 49 | \newlength{\@curXheight} 50 | 51 | \DeclareRobustCommand\orcidlink[1]{% 52 | \texorpdfstring{% 53 | \setlength{\@curXheight}{\fontcharht\font`X}% 54 | \href{https://orcid.org/#1}{\XeTeXLinkBox{\mbox{% 55 | \begin{tikzpicture}[yscale=-\@OrigHeightRecip*\@curXheight, 56 | xscale=\@OrigHeightRecip*\@curXheight,transform shape] 57 | \pic{orcidlogo}; 58 | \end{tikzpicture}% 59 | }}}}{}} 60 | 61 | \endinput 62 | %% 63 | %% End of file `orcidlink.sty'. 64 | -------------------------------------------------------------------------------- /_extensions/arxiv/partials/_authors.tex: -------------------------------------------------------------------------------- 1 | $-- You can use as many custom partials as you need. Convention is to prefix name with '_' 2 | $-- It can be useful to use such template to split some template parts in smaller pieces, which is easier to reuse. 3 | $-- This '_custom.tex' is used on 'title.tex' as example. 4 | $-- See other existing format in quarto-journals/ organisation. 5 | $-- %%%% TODO %%%%% 6 | $-- Use it if you need to insert content at this specific place of the main Pandoc's template. Otherwise, remove it. 7 | $-- Here we are using it to format the authors part of the template. 8 | $-- %%%%%%%%%%%%%%% 9 | \textbf{$it.name.literal$}$if(it.orcid)$~\orcidlink{$it.orcid$}$endif$$for(it.affiliations)$\\$it.department$\\$it.name$\\$if(it.city)$$it.city$$if(it.postal-code)$,\ $it.postal-code$$endif$$endif$$endfor$\\$if(it.email)$\href{mailto:$it.email$}{$it.email$}$endif$ 10 | -------------------------------------------------------------------------------- /_extensions/arxiv/partials/before-body.tex: -------------------------------------------------------------------------------- 1 | $-- Implements the frontmatter, title page, and abstract. 2 | $-- 3 | $-- %%%% TODO %%%%% 4 | $-- Customize is needed, otherwise remove this partials to use Quarto default one 5 | $-- %%%%%%%%%%%%%%%% 6 | $if(has-frontmatter)$ 7 | \frontmatter 8 | $endif$ 9 | $if(title)$ 10 | $if(beamer)$ 11 | \frame{\titlepage} 12 | $else$ 13 | \maketitle 14 | $endif$ 15 | $if(abstract)$ 16 | \begin{abstract} 17 | $abstract$ 18 | \end{abstract} 19 | $endif$ 20 | $endif$ 21 | $if(keywords)$ 22 | {\bfseries \emph Keywords} 23 | \def\sep{\textbullet\ } 24 | $for(keywords/allbutlast)$$keywords$ \sep $endfor$ 25 | $for(keywords/last)$$keywords$$endfor$ 26 | 27 | $endif$ 28 | -------------------------------------------------------------------------------- /_extensions/arxiv/partials/title.tex: -------------------------------------------------------------------------------- 1 | $-- Provides configuration of document metadata for writing the title block. 2 | $-- Note that in addition to these templates and partials, Quarto will also make normalized authors and affiliations data available to the template, 3 | $-- making is easy to write custom title blocks against a standard schema. 4 | $-- 5 | $-- %%%% TODO %%%%% 6 | $-- Customize is needed, like below for printing the authors. Otherwise remove this partials to use Quarto default one. 7 | $-- %%%%%%%%%%%%%%%% 8 | $if(linenumbers)$ 9 | \usepackage{lineno} 10 | \linenumbers 11 | $endif$ 12 | $if(doublespacing)$ 13 | \usepackage{setspace} 14 | \doublespacing 15 | $endif$ 16 | $if(date)$ 17 | \renewcommand{\today}{$date$} 18 | $endif$ 19 | \newcommand{\runninghead}{A Preprint } 20 | $if(runninghead)$ 21 | \renewcommand{\runninghead}{$runninghead$ } 22 | $endif$ 23 | $if(title)$ 24 | \title{$title$$if(thanks)$\thanks{$thanks$}$endif$} 25 | $endif$ 26 | $if(subtitle)$ 27 | \usepackage{etoolbox} 28 | \makeatletter 29 | \providecommand{\subtitle}[1]{% add subtitle to \maketitle 30 | \apptocmd{\@title}{\par {\large #1 \par}}{}{} 31 | } 32 | \makeatother 33 | \subtitle{$subtitle$} 34 | $endif$ 35 | \def\asep{\\\\\\ } % default: all authors on same column 36 | $if(authorcols)$ 37 | \def\asep{\And } 38 | $endif$ 39 | \author{${ by-author:_authors.tex()[\asep] }} 40 | \date{$date$} 41 | -------------------------------------------------------------------------------- /_extensions/arxiv/shortcodes.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | This file defines the shortcodes that your extension will make available 3 | https://quarto.org/docs/authoring/shortcodes.html#custom-shortcodes 4 | Quarto exports utils function that can be used in all filters. See 5 | https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/pandoc/datadir/init.lua#L1522-L1576 6 | ]]-- 7 | 8 | -- Example shortcode that provides a nicely formatted 'LaTeX' string 9 | function latex() 10 | if quarto.doc.isFormat("pdf") then 11 | return pandoc.RawBlock('tex', '{\\LaTeX}') 12 | elseif quarto.doc.isFormat("html") then 13 | return pandoc.Math('InlineMath', "\\LaTeX") 14 | else 15 | return pandoc.Span('LaTeX') 16 | end 17 | end -------------------------------------------------------------------------------- /_publish.yml: -------------------------------------------------------------------------------- 1 | - source: template.qmd 2 | quarto-pub: 3 | - id: 376a9371-3109-4c1a-acd9-6a97a5dbfb6c 4 | url: 'https://quartopub.org/sites/mike/quarto-arxiv-template' 5 | -------------------------------------------------------------------------------- /_quarto.yml: -------------------------------------------------------------------------------- 1 | project: 2 | title: "quarto-arxiv" 3 | -------------------------------------------------------------------------------- /bibliography.bib: -------------------------------------------------------------------------------- 1 | @Book{wickham2015, 2 | author = {Wickham, Hadley}, 3 | title = {R Packages}, 4 | year = {2015}, 5 | isbn = {1491910593, 9781491910597}, 6 | edition = {1st}, 7 | publisher = {O'Reilly Media, Inc.}, 8 | } 9 | @article{knuth1984, 10 | title={Literate programming}, 11 | author={Knuth, Donald E.}, 12 | journal={The Computer Journal}, 13 | volume={27}, 14 | number={2}, 15 | pages={97--111}, 16 | year={1984}, 17 | publisher={British Computer Society} 18 | } 19 | -------------------------------------------------------------------------------- /quarto-arxiv.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | -------------------------------------------------------------------------------- /sunflower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikemahoney218/quarto-arxiv/be5078d4d80989ad67d982edd80d2aa77d8c1dde/sunflower.png -------------------------------------------------------------------------------- /template.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Demo arXiv template" 3 | format: 4 | arxiv-pdf: 5 | keep-tex: true 6 | linenumbers: false 7 | doublespacing: false 8 | runninghead: "A Preprint" 9 | arxiv-html: default 10 | author: 11 | - name: Michael J Mahoney 12 | affiliations: 13 | - name: State University of New York College of Environmental Science and Forestry 14 | department: Graduate Program in Environmental Science 15 | address: 1 Forestry Drive 16 | city: Syracuse, NY 17 | country: USA 18 | postal-code: 13210 19 | orcid: 0000-0003-2402-304X 20 | email: fake_email@fakeyfake.com 21 | url: https://mm218.dev 22 | - name: Someone Else 23 | affiliations: 24 | - name: State University of New York College of Environmental Science and Forestry 25 | department: Department of Sustainable Resources Management 26 | address: 1 Forestry Drive 27 | city: Syracuse, NY 28 | country: USA 29 | postal-code: 13210 30 | abstract: | 31 | This document is only a demo explaining how to use the template. 32 | keywords: 33 | - template 34 | - demo 35 | bibliography: bibliography.bib 36 | --- 37 | 38 | # Introduction {#sec-intro} 39 | 40 | This is an example of how to use this template to render journal articles. This template is inspired by the arXiv rticles template for rmarkdown, repurposed for the Quarto publishing system. 41 | 42 | This quarto extension format supports PDF and HTML outputs. This template is primarily focused on generating acceptable {{< latex >}} outputs from Quarto, but renders an acceptable HTML output using the standard Quarto options. 43 | 44 | # Quarto 45 | 46 | Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see . 47 | 48 | # Running Code 49 | 50 | When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this: 51 | 52 | ```{r} 53 | 1 + 1 54 | ``` 55 | 56 | This format hide chunks by default, but you can set `echo` option to `true` locally in the chunk: 57 | 58 | ```{r} 59 | #| echo: true 60 | #| label: tbl-glm 61 | #| tbl-cap: "A table." 62 | 63 | # install.packages("broom") 64 | # install.packages("kableExtra") 65 | data("quine", package = "MASS") 66 | m_pois <- glm(Days ~ (Eth + Sex + Age + Lrn)^2, data = quine, family = poisson) 67 | kableExtra::kable_styling( 68 | kableExtra::kbl(broom::tidy(m_pois)) 69 | ) 70 | ``` 71 | 72 | 73 | # Markdown Basics 74 | 75 | This section of the template is adapted from [Quarto's documentation on Markdown basics](https://quarto.org/docs/authoring/markdown-basics.html). 76 | 77 | ## Text Formatting 78 | 79 | +-----------------------------------+-------------------------------+ 80 | | Markdown Syntax | Output | 81 | +===================================+===============================+ 82 | | *italics* and **bold** | *italics* and **bold** | 83 | +-----------------------------------+-------------------------------+ 84 | | superscript^2^ / subscript~2~ | superscript^2^ / subscript~2~ | 85 | +-----------------------------------+-------------------------------+ 86 | | ~~strikethrough~~ | ~~strikethrough~~ | 87 | +-----------------------------------+-------------------------------+ 88 | | `verbatim code` | `verbatim code` | 89 | +-----------------------------------+-------------------------------+ 90 | 91 | ## Headings {#headings} 92 | 93 | +---------------------+-----------------------------------+ 94 | | Markdown Syntax | Output | 95 | +=====================+===================================+ 96 | | # Header 1 | # Header 1 {.heading-output} | 97 | +---------------------+-----------------------------------+ 98 | | ## Header 2 | ## Header 2 {.heading-output} | 99 | +---------------------+-----------------------------------+ 100 | | ### Header 3 | ### Header 3 {.heading-output} | 101 | +---------------------+-----------------------------------+ 102 | 103 | ## Equations 104 | 105 | Use `$` delimiters for inline math and `$$` delimiters for display math. For example: 106 | 107 | +-------------------------------+-------------------------+ 108 | | Markdown Syntax | Output | 109 | +===============================+=========================+ 110 | | inline math: $E = mc^{2}$ | inline math: $E=mc^{2}$ | 111 | +-------------------------------+-------------------------+ 112 | | display math: | display math:\ | 113 | | | $$E = mc^{2}$$ | 114 | | $$E = mc^{2}$$ | | 115 | +-------------------------------+-------------------------+ 116 | 117 | If assigned an ID, display math equations will be automatically numbered: 118 | 119 | $$ 120 | \frac{\partial \mathrm C}{ \partial \mathrm t } + \frac{1}{2}\sigma^{2} \mathrm S^{2} 121 | \frac{\partial^{2} \mathrm C}{\partial \mathrm C^2} 122 | + \mathrm r \mathrm S \frac{\partial \mathrm C}{\partial \mathrm S}\ = 123 | \mathrm r \mathrm C 124 | $$ {#eq-black-scholes} 125 | 126 | ## Other Blocks 127 | 128 | +-----------------------------+--------------------------+ 129 | | Markdown Syntax | Output | 130 | +=============================+==========================+ 131 | | > Blockquote | > Blockquote | 132 | +-----------------------------+--------------------------+ 133 | | | Line Block | | Line Block | 134 | | | Spaces and newlines | | Spaces and newlines | 135 | | | are preserved | | are preserved | 136 | +-----------------------------+--------------------------+ 137 | 138 | ## Cross-references {#sec-crf} 139 | 140 | ![A sunflower](sunflower.png){#fig-sunflower} 141 | 142 | +---------------------------------------+---------------------------------+ 143 | | Markdown Format | Output | 144 | +=======================================+=================================+ 145 | | @fig-sunflower is pretty. | @fig-sunflower is pretty. | 146 | +---------------------------------------+---------------------------------+ 147 | | @tbl-glm was created from code. | @tbl-glm was created from code. | 148 | +---------------------------------------+---------------------------------+ 149 | | @sec-crf is this section. | @sec-crf is this section. | 150 | +---------------------------------------+---------------------------------+ 151 | | @eq-black-scholes is above. | @eq-black-scholes is above. | 152 | +---------------------------------------+---------------------------------+ 153 | 154 | See the [Quarto documentation on cross-references for more](https://quarto.org/docs/authoring/cross-references.html). 155 | 156 | 157 | # Citations 158 | 159 | This section of the template is adapted from the [Quarto citation documentation](https://quarto.org/docs/authoring/footnotes-and-citations.html). 160 | 161 | Quarto supports bibliography files in a wide variety of formats including BibTeX and CSL. Add a bibliography to your document using the `bibliography` YAML metadata field. For example: 162 | 163 | ``` yaml 164 | --- 165 | title: "My Document" 166 | bibliography: references.bib 167 | --- 168 | ``` 169 | 170 | See the [Pandoc Citations](https://pandoc.org/MANUAL.html#citations) documentation for additional information on bibliography formats. 171 | 172 | ## Citation Syntax {#sec-citations} 173 | 174 | Quarto uses the standard Pandoc markdown representation for citations. Here are some examples: 175 | 176 | 177 | +-------------------------------------------+---------------------------------------------------------------------+ 178 | | Markdown Format | Output | 179 | +===========================================+=====================================================================+ 180 | | Blah Blah [see @knuth1984, pp. 33-35; | Blah Blah [see @knuth1984, pp. 33-35; also @wickham2015, chap. 1] | 181 | | also @wickham2015, chap. 1] | | 182 | +-------------------------------------------+---------------------------------------------------------------------+ 183 | | Blah Blah [@knuth1984, pp. 33-35, | Blah Blah [@knuth1984, pp. 33-35, 38-39 and passim] | 184 | | 38-39 and passim] | | 185 | +-------------------------------------------+---------------------------------------------------------------------+ 186 | | Blah Blah [@wickham2015; @knuth1984]. | Blah Blah [@wickham2015; @knuth1984]. | 187 | +-------------------------------------------+---------------------------------------------------------------------+ 188 | | Wickham says blah [-@wickham2015] | Wickham says blah [-@wickham2015] | 189 | +-------------------------------------------+---------------------------------------------------------------------+ 190 | 191 | You can also write in-text citations, as follows: 192 | 193 | +-----------------------------------+-------------------------------+ 194 | | Markdown Format | Output | 195 | +===================================+===============================+ 196 | | @knuth1984 says blah. | @knuth1984 says blah. | 197 | +-----------------------------------+-------------------------------+ 198 | | @knuth1984 [p. 33] says blah. | @knuth1984 [p. 33] says blah. | 199 | +-----------------------------------+-------------------------------+ 200 | 201 | See the [Pandoc Citations](https://pandoc.org/MANUAL.html#citations) documentation for additional information on citation syntax. 202 | 203 | To provide a custom citation stylesheet, provide a path to a CSL file using the `csl` metadata field in your document, for example: 204 | 205 | ``` yaml 206 | --- 207 | title: "My Document" 208 | bibliography: references.bib 209 | csl: nature.csl 210 | --- 211 | ``` 212 | 213 | {{< pagebreak >}} 214 | 215 | # References {.unnumbered} 216 | 217 | ::: {#refs} 218 | ::: 219 | --------------------------------------------------------------------------------