Skip to content

Commit f6334db

Browse files
Match template closer
1 parent 0cfa99c commit f6334db

File tree

7 files changed

+97
-28
lines changed

7 files changed

+97
-28
lines changed

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
This is a Quarto template that assists you in creating PDF outputs which closely match those published on arXiv. If you are intending to publish your article on arXiv, it is highly recommended you upload your TeX files (and supporting files, including generated `.bbl` and figure files) directly. However, this template supports rendering PDFs which resemble arXiv preprints for upload to other repositories either before or instead of submission to arXiv itself.
44

5-
Please note this template should be considered an early alpha as I work out a few mismatches between the current output and the arXiv style.
5+
There are currently a few differences between the PDFs generated by this template and those generated by arXiv:
6+
7+
1. The fonts and spacings are not a perfect match. PRs to fix this are more than welcome.
8+
2. ORCiD IDs will be rendered as clickable logos next to author names.
9+
3. Emails will be displayed as hyperlinks, not in monospaced fonts.
10+
11+
Any other differences are unintentional bugs -- please open an issue about anything you encounter!
612

713
## Creating a New Article
814

9-
You can use this as a template to create a preprint for ArXiV. To do this, use the following command:
15+
You can use this as a template to create a preprint for ArXiv. To do this, use the following command:
1016

1117
```quarto use template mikemahoney218/quarto-arxiv```
1218

_extensions/arxiv/_extension.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
title: ArXiV Template
22
author: Mike Mahoney
3-
version: 0.0.1
3+
version: 0.1.0
44
contributes:
55
formats:
66
common:
77
# define below YAML configuration common to all formats
88
filters:
99
# You can include here Lua filters from your extension format
10-
- scholarly-metadata.lua
11-
- author-info-blocks.lua
10+
#- scholarly-metadata.lua
11+
#- author-info-blocks.lua
1212
shortcodes:
1313
# You can include here Lua filters defining shortcodes from your extension
1414
- shortcodes.lua
1515
knitr:
1616
opts_chunk:
1717
echo: false
18+
number-sections: true
1819
pdf:
1920
# define default configuration for the pdf version of your format
2021
documentclass: article
@@ -23,13 +24,12 @@ contributes:
2324
\usepackage{arxiv}
2425
\usepackage{orcidlink}
2526
\usepackage{amsmath}
26-
# template-partials:
27+
\usepackage[T1]{fontenc}
28+
template-partials: ["partials/_authors.tex", "partials/title.tex", "partials/before-body.tex"]
2729
format-resources:
2830
# Add here the resources required for the PDF rendering
2931
- arxiv.sty
3032
html:
31-
# define default configuration for the html version of your format
32-
number-sections: true
3333
toc: true
3434
# Use a CSL file to style (https://www.zotero.org/styles/)
3535
csl: https://www.zotero.org/styles/chicago-author-date-16th-edition

_extensions/arxiv/arxiv.sty

-7
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@
3232
\rhead{\scshape A preprint - \today}
3333
\cfoot{\thepage}
3434

35-
36-
%Handling Keywords
37-
\def\keywordname{{\bfseries \emph Keywords}}%
38-
\def\keywords#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm
39-
\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$
40-
}\noindent\keywordname\enspace\ignorespaces#1\par}}
41-
4235
% font sizes with reduced leading
4336
\renewcommand{\normalsize}{%
4437
\@setfontsize\normalsize\@xpt\@xipt
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
10+
$it.name.literal$$if(it.orcid)$~\orcidlink{$it.orcid$}$endif$$for(it.affiliations/first)$\\$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$
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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$

_extensions/arxiv/partials/title.tex

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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(title)$
9+
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
10+
$endif$
11+
$if(subtitle)$
12+
\usepackage{etoolbox}
13+
\makeatletter
14+
\providecommand{\subtitle}[1]{% add subtitle to \maketitle
15+
\apptocmd{\@title}{\par {\large #1 \par}}{}{}
16+
}
17+
\makeatother
18+
\subtitle{$subtitle$}
19+
$endif$
20+
\author{${ by-author:_authors.tex()[\and \\] }}
21+
\date{$date$}

template.qmd

+25-13
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,37 @@ format:
44
arxiv-pdf:
55
keep-tex: true
66
arxiv-html: default
7-
institute:
8-
- gpes: Graduate Program in Environmental Science, State University of New York College of Environmental Science and Forestry, 1 Forestry Drive, Syracuse, NY, 13210
9-
- srm: Department of Sustainable Resources Management, State University of New York College of Environmental Science and Forestry, 1 Forestry Drive, Syracuse, NY, 13210
107
author:
11-
- Michael J Mahoney:
12-
institute: [gpes]
13-
14-
correspondence: "yes"
15-
- Some One Else:
16-
institute: [srm]
8+
- name: Michael J Mahoney
9+
affiliations:
10+
- name: State University of New York College of Environmental Science and Forestry
11+
department: Graduate Program in Environmental Science
12+
address: 1 Forestry Drive
13+
city: Syracuse, NY
14+
country: USA
15+
postal-code: 13210
16+
orcid: 0000-0003-2402-304X
17+
18+
url: https://mm218.dev
19+
- name: Someone Else
20+
affiliations:
21+
- name: State University of New York College of Environmental Science and Forestry
22+
department: Department of Sustainable Resources Management
23+
address: 1 Forestry Drive
24+
city: Syracuse, NY
25+
country: USA
26+
postal-code: 13210
1727
abstract: |
1828
This document is only a demo explaining how to use the template.
19-
keywords: [template, demo]
29+
keywords:
30+
- template
31+
- demo
2032
bibliography: bibliography.bib
2133
---
2234

2335
# Introduction {#sec-intro}
2436

25-
This is an example of how to use this template to render articles in the standard arXiv format. Please note that this template is still in alpha as I work out some of the mismatches between PDF output and the arXiv style.
37+
This is an example of how to use this template to render articles in the standard arXiv format.
2638

2739
This quarto extension format supports PDF and HTML outputs. `quarto-journals` is aiming at porting existing {{< latex >}} template from journals to be used with quarto. PDF format is what require the most work to fit the journals guideline, but Quarto offer a nice rendering for HTML output too. This template only uses basic HTML format without any customization for now.
2840

@@ -56,9 +68,9 @@ m_pois <- glm(Days ~ (Eth + Sex + Age + Lrn)^2, data = quine, family = poisson)
5668
kableExtra::kbl(broom::tidy(m_pois))
5769
```
5870

59-
## Using references {.unnumbered}
71+
## Using references
6072

61-
I did not read this book [@CameronTrivedi2013] but it must be interesting
73+
I did not read this book [@CameronTrivedi2013] but it must be interesting.
6274

6375
{{< pagebreak >}}
6476

0 commit comments

Comments
 (0)