-
Notifications
You must be signed in to change notification settings - Fork 27
/
p2r.1
263 lines (263 loc) · 7.99 KB
/
p2r.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "P2R" "1" "Sep 13, 2024" "" "paper2remarkable"
.SH NAME
p2r \- Fetch an academic paper or web article and send it to the reMarkable tablet
.SH SYNOPSIS
.INDENT 0.0
.INDENT 3.5
.sp
.EX
p2r [OPTION]... [INPUT]...
.EE
.UNINDENT
.UNINDENT
.SH DESCRIPTION
.sp
Fetch an academic paper, local pdf file, or any web article and send it to the
reMarkable tablet. The input to the script can be a URL to a PDF file or
article on a website, or a local file. For supported scientific outlets, the
program will collect the metadata for the paper and create a nice filename
(unless \fB\-\-filename\fP is specified). See \fI\%SUPPORTED
SOURCES\fP for an overview of supported scientific paper
sources.
.sp
By default, paper2remarkable crops the unnecessary whitespace from a PDF file
to make the paper fit better on the reMarkable. The default setting yields a
left\-aligned document on the reMarkable which can be useful for taking margin
notes. Alternatively, the program supports the \fB\-\-center\fP, \fB\-\-right\fP, and
\fB\-\-no\-crop\fP options to change this crop setting.
.SH OPTIONS
.sp
Basic options:
.INDENT 0.0
.TP
.B \-b\fP,\fB \-\-blank
Add a blank page after every page of the PDF document. This can be
useful for taking notes on papers.
.TP
.BI \-C\fP,\fB \-\-config\fB= FILENAME
Read options from a configuration file. A YAML file is supported, see
\fI\%CONFIGURATION FILE\fP for further details. By default the
file at \fB~/.paper2remarkable.yml\fP is used if it exists.
.TP
.B \-e\fP,\fB \-\-experimental
Enable the experimental features of paper2remarkable. See below under
\fI\%EXPERIMENTAL FEATURES\fP for an overview.
.TP
.BI \-f\fP,\fB \-\-filename\fB= FILENAME
Filename to use for the file on reMarkable. If you specify multiple
\fBINPUT\fP files and want to use a specific filename for each, you can
specify \fB\-\-filename\fP for each \fBINPUT\fP source by repeating it.
.TP
.B \-h\fP,\fB \-\-help
Show help message and exit.
.TP
.B \-v\fP,\fB \-\-verbose
Enable verbose mode of paper2remarkable. By default the program prints
no output.
.TP
.B \-V\fP,\fB \-\-version
Show the version and exit.
.UNINDENT
.sp
Crop options:
.INDENT 0.0
.TP
.B \-c\fP,\fB \-\-center
Center the PDF on the page.
.TP
.B \-k\fP,\fB \-\-no\-crop
Don\(aqt crop the document at all.
.TP
.B \-r\fP,\fB \-\-right
Right\-align the document on the reMarkable so the menu doesn\(aqt cover it.
.UNINDENT
.sp
reMarkable options:
.INDENT 0.0
.TP
.B \-n\fP,\fB \-\-no\-upload
Don\(aqt upload the document to the reMarkable, save the output in the
current working directory.
.TP
.BI \-p\fP,\fB \-\-remarkable\-path\fB= DIR
The directory on the reMarkable where the document will be uploaded to.
If the target directory does not exist it will be created. If not
specified, the root directory will be used.
.UNINDENT
.sp
Output customization:
.INDENT 0.0
.TP
.BI \-\-css\fB= FILENAME
Path to a CSS file with custom styling for the HTML output. This option
is ignored for any of the other providers. The code for the HTML
provider contains the default CSS style, which can be used as a starting
point.
.TP
.BI \-\-font\-urls\fB= FILENAME
Path to a file with font urls (one per line) for the HTML output. This
will generally be used in combination with the \fB\-\-css\fP option.
.UNINDENT
.sp
System settings:
.sp
You\(aqll only need to specify these options if the programs are not available on
the PATH variable.
.INDENT 0.0
.TP
.BI \-\-gs\fB= GS
Path to the GhostScript executable.
.TP
.BI \-\-pdftoppm\fB= PDFTOPPM
Path to pdftoppm executable (default: pdftoppm). Note that pdftoppm is
optional.
.TP
.BI \-\-pdftk\fB= PDFTK
Path to PDFtk executable (default: pdftk). Either pdftk or qpdf is
needed.
.TP
.BI \-\-qpdf\fB= QPDF
Path to qpdf executable (default: qpdf). Either pdftk or qpdf is needed.
.TP
.BI \-\-rmapi\fB= RMAPI
Path to rmapi executable (default: rmapi).
.UNINDENT
.sp
Developer options:
.INDENT 0.0
.TP
.B \-d\fP,\fB \-\-debug
Debug mode, when used the program doesn\(aqt upload the document to the
reMarkable by default and leaves the temporary directory with
intermediate files.
.UNINDENT
.SH SUPPORTED SOURCES
.sp
The following scientific sources are currently supported and paper2remarkable
will create a filename based on the authors, title, and publication year of
the work. For the sources below the program is generally flexible with regards
to whether a URL to the PDF or to the abstract page is provided.
.INDENT 0.0
.IP \(bu 2
arXiv
.IP \(bu 2
ACL Web
.IP \(bu 2
ACM Digital Library
.IP \(bu 2
CVF
.IP \(bu 2
DiVA
.IP \(bu 2
ECCC
.IP \(bu 2
IACR
.IP \(bu 2
JMLR
.IP \(bu 2
Nature
.IP \(bu 2
NBER
.IP \(bu 2
NeurIPS
.IP \(bu 2
OpenReview
.IP \(bu 2
PMLR
.IP \(bu 2
PubMed Central
.IP \(bu 2
SpringerLink
.IP \(bu 2
SemanticScholar
.UNINDENT
.sp
paper2remarkable also supports a generic URL to a PDF file or a local file, in
which case no \(dqnice\(dq filename will be generated.
.INDENT 0.0
.IP \(bu 2
A generic URL to a PDF file. This can be considered a fallback option for
when a PDF source is not supported (yet).
.IP \(bu 2
A local PDF file.
.UNINDENT
.sp
Finally, paper2remarkable supports extracting articles from websites. In this
case an effort is done to detect the main content of the article and clean up
the HTML before sending the file to the reMarkable.
.SH CONFIGURATION FILE
.sp
To avoid having to provide frequently\-used command line flags, a configuration
file can be created for paper2remarkable. By default it is a YAML file located
at \fB~/.paper2remarkable.yml\fP, but an alternative location can be provided
with the \fB\-\-config\fP option to the script.
.sp
The configuration file consists of three sections: \fBcore\fP, \fBsystem\fP, and
\fBhtml\fP\&. In the \fBcore\fP section options for cropping, verbosity, and blank
pages can be added, among others. The \fBsystem\fP section allows setting paths
to executables such as \fBrmapi\fP, \fBpdftk\fP, etc. Finally, the \fBhtml\fP
section allows you to provide custom CSS and font urls for formatting the
output of web articles.
.sp
Options provided on the command line overwrite those in the configuration
file. So, for instance, if the configuration file has the setting \fBcrop:
\(aqleft\(aq\fP in the \fBcore\fP section and the command line flag \fB\-c\fP is provided,
the PDF will be centered.
.sp
An example file is provided in the repository on
\X'tty: link https://www.github.com/GjjvdBurg/paper2remarkable'\fI\%GitHub\fP\X'tty: link', which also
contains more information on the available options and their values.
.SH EXPERIMENTAL FEATURES
.sp
Occassionally, experimental (beta) features will be included in
paper2remarkable and they will be listed here. You can enable the experimental
features by using the \fB\-e\fP flag to paper2remarkable.
.INDENT 0.0
.IP \(bu 2
The HTML provider currently has an experimental feature to handle lazy
loading of images. Certain websites use a small placeholder image and load
the main image using Javascript, with the actual image source stored in a
\fBdata\-src\fP attribute in the \fBimg\fP tag. The experimental feature uses the
\fBdata\-src\fP attribute as the image source instead of that in the \fBsrc\fP
attribute.
.UNINDENT
.SH BUGS
.sp
Please report bugs to:
.sp
\X'tty: link https://www.github.com/GjjvdBurg/paper2remarkable'\fI\%https://www.github.com/GjjvdBurg/paper2remarkable\fP\X'tty: link'
.SH AUTHOR
Gertjan van den Burg & other helpful contributors.
.SH COPYRIGHT
2020, G.J.J. van den Burg
.\" Generated by docutils manpage writer.
.