Skip to content

Commit 4f9fcb5

Browse files
committed
Add arxiv target
The `preprint` target outputs a very plain file, missing any journal-specific styling. It's nice when the arxiv version of a paper has similar formatting to the published version. There have been requests and discussions concerning a smooth way to do this. Some issues were raised, the biggest one being possible confusion about the publication status of a preprint. Configure pandoc to output a LaTeX file somewhat closer to that which would generate the official PDFs. In order to distinguish it from a published article, this style: - Removes the journal logo from the header. - Replaces the DOI and review details in the sidebar with "Preprint: Prepared for submission to $journal.title$". This is borrowed from JCAP's LaTeX style. - Removes the self-citation in the footer. There are other minor differences in fonts and PDF tags because arxiv.org only supports `pdflatex`, not `lualatex`.
1 parent dc6adfd commit 4f9fcb5

File tree

4 files changed

+52
-6
lines changed

4 files changed

+52
-6
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ TARGET_FOLDER = publishing-artifacts
1616
ARTICLE_INFO_FILE = $(OPENJOURNALS_PATH)/default-article-info.yaml
1717

1818
.PHONY: all
19-
all: cff pdf html jats crossref native preprint
19+
all: cff pdf html jats crossref native preprint arxiv
2020

21-
.PHONY: cff pdf html jats crossref native preprint
21+
.PHONY: cff pdf html jats crossref native preprint arxiv
2222
cff: $(TARGET_FOLDER)/paper.cff
2323
pdf: $(TARGET_FOLDER)/paper.pdf
2424
html: $(TARGET_FOLDER)/paper.html
2525
jats: $(TARGET_FOLDER)/paper.jats
2626
native: $(TARGET_FOLDER)/paper.native
2727
crossref: $(TARGET_FOLDER)/paper.crossref
2828
preprint: $(TARGET_FOLDER)/paper.preprint
29+
arxiv: $(TARGET_FOLDER)/paper.arxiv.tex
2930

3031
$(TARGET_FOLDER)/paper.%: $(ARTICLE) \
3132
$(INARA_DATA_PATH)/defaults/%.yaml \
@@ -68,3 +69,4 @@ clean:
6869
rm -rf $(TARGET_FOLDER)/paper.native
6970
rm -rf $(TARGET_FOLDER)/paper.pdf
7071
rm -rf $(TARGET_FOLDER)/paper.preprint
72+
rm -rd $(TARGET_FOLDER)/paper.arxiv.tex

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ the mounted folder, is expected as the only argument.
1515

1616
- The Docker image will generate PDF and JATS files by default. To
1717
select specific output formats to be generated use the `-o` flag.
18-
Supported options are: `pdf`, `jats`, `html`, `crossref`, `cff`, and `preprint`. To get multiple outputs
18+
Supported options are: `pdf`, `jats`, `html`, `crossref`, `cff`, `preprint`, and `arxiv`. To get multiple outputs
1919
use a comma separated list.
2020
- By default PDF files will be compiled in _draft mode_ to include a draft
2121
watermark and linenumbers. To create a _production_ PDF add the `-p` flag.
@@ -45,7 +45,7 @@ variable. So if the paper Markdown source is in file
4545

4646
All supported publishing formats are generated by default, but you
4747
can select a specific format to be generated by passing it as an
48-
argument. Available options: `html`, `pdf`, `jats`, `crossref`, `cff`, and `preprint`.
48+
argument. Available options: `html`, `pdf`, `jats`, `crossref`, `cff`, `preprint`, and `arxiv`.
4949

5050
E.g., to generate only a PDF file, the command would be
5151

data/defaults/arxiv.tex.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
to: latex
2+
output-file: paper.arxiv.tex
3+
filters:
4+
- type: lua
5+
path: add-images.lua
6+
- type: lua
7+
path: draft.lua
8+
variables:
9+
arxiv: true
10+
# styling options
11+
colorlinks: true
12+
linkcolor: '[rgb]{0.0, 0.5, 1.0}'
13+
urlcolor: '[rgb]{0.0, 0.5, 1.0}'
14+

data/templates/default.latex

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ $endif$
5858
>>
5959
]
6060
}
61+
62+
$if(arxiv)$
63+
$-- \pdfvariable omitcidset=* requires lualatex but arxiv.org only does pdflatex.
64+
$else$
6165
\pdfvariable omitcidset=1
66+
$endif$
6267
\usepackage{caption}
6368
\usepackage{orcidlink}
6469
\usepackage{tcolorbox}
@@ -134,7 +139,11 @@ $endif$
134139
\fancyhf{}
135140
%\renewcommand{\headrulewidth}{0.50pt}
136141
\renewcommand{\headrulewidth}{0pt}
142+
$if(arxiv)$
143+
$-- arxiv submissions don't get journal's logo
144+
$else$
137145
\fancyhead[L]{\hspace{-0.75cm}\includegraphics[width=5.5cm]{$logo_path$}}
146+
$endif$
138147
\fancyhead[C]{}
139148
\fancyhead[R]{}
140149
\renewcommand{\footrulewidth}{0.25pt}
@@ -246,8 +255,12 @@ $endif$
246255
%% Font settings
247256
\usepackage{fontsetup} % Lazy way to get proper Greek lowercase glyphs
248257

258+
$if(arxiv)$
259+
$-- \setmonofont requires lualatex but arxiv.org only does pdflatex.
260+
$else$
249261
% Use Hack https://sourcefoundry.org/hack/
250262
\setmonofont{Hack}
263+
$endif$
251264

252265
$if(colorlinks)$
253266
\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
@@ -426,11 +439,23 @@ $endif$
426439
%\hrule
427440
\sffamily\small
428441

442+
$if(arxiv)$
443+
{\bfseries Preprint:} Prepared for submission to $journal.title$
444+
$else$
429445
{\bfseries DOI:} \href{https://doi.org/$article.doi$}{\color{linky}{$article.doi$}}
446+
$endif$
430447

431448
\vspace{2mm}
432449
$if(retraction)$
433450
$-- Retraction notices don't show Software info
451+
$elseif(arxiv)$
452+
{\bfseries Software}
453+
\begin{itemize}
454+
\setlength\itemsep{0em}
455+
\item \href{$software_repository_url$}{\color{linky}{Repository}} \ExternalLink
456+
\end{itemize}
457+
458+
\vspace{2mm}
434459
$else$
435460
{\bfseries Software}
436461
\begin{itemize}
@@ -443,7 +468,9 @@ $endif$
443468
\vspace{2mm}
444469
$endif$
445470

446-
$if(joss)$
471+
$if(arxiv)$
472+
$-- arxiv submissions don't get Editor, Reviewer, etc
473+
$elseif(joss)$
447474
$if(retraction)$
448475
$-- Retraction notices don't show Editor/Reviewers info
449476
$else$
@@ -469,10 +496,13 @@ $endif$
469496

470497
$if(retraction)$
471498
$-- Retraction notices don't have submission date
499+
{\bfseries Published:} $published$
500+
$elseif(arxiv)$
501+
$-- arxiv submissions won't necessarily have journal submission date
472502
$else$
473503
{\bfseries Submitted:} $submitted$\\
474-
$endif$
475504
{\bfseries Published:} $published$
505+
$endif$
476506

477507
\vspace{2mm}
478508
{\bfseries License}\\

0 commit comments

Comments
 (0)