generator-latex-template 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -23
- package/generators/app/index.js +222 -577
- package/generators/app/options.js +375 -0
- package/generators/app/templates/.github/workflows/check.yml +3 -3
- package/generators/app/templates/Dockerfile.dante +3 -1
- package/generators/app/templates/Dockerfile.iot +14 -0
- package/generators/app/templates/Dockerfile.reitzig +12 -11
- package/generators/app/templates/README.en.md +8 -21
- package/generators/app/templates/Texlivefile +28 -3
- package/generators/app/templates/babel.preamble.de.tex +3 -1
- package/generators/app/templates/babel.preamble.en.tex +1 -1
- package/generators/app/templates/csquotes.example.de.tex +1 -1
- package/generators/app/templates/csquotes.example.en.tex +1 -1
- package/generators/app/templates/csquotes.preamble.en.tex +1 -1
- package/generators/app/templates/figure.example.de.tex +18 -4
- package/generators/app/templates/figure.example.en.tex +2 -6
- package/generators/app/templates/hyphenation.example.en.tex +1 -1
- package/generators/app/templates/latexmkrc +1 -3
- package/generators/app/templates/listings.example.de.tex +0 -17
- package/generators/app/templates/listings.example.en.tex +6 -6
- package/generators/app/templates/main.de.tex +586 -141
- package/generators/app/templates/main.en.tex +57 -61
- package/generators/app/templates/microtype.preamble.de.tex +5 -0
- package/generators/app/templates/minted.example.en.tex +5 -5
- package/generators/app/templates/minted.preamble.en.tex +13 -2
- package/generators/app/templates/natbib.preamble.en.tex +1 -1
- package/generators/app/templates/siunitx.example.en.tex +1 -1
- package/generators/app/templates/siunitx.preamble.de.tex +2 -0
- package/generators/app/templates/siunitx.preamble.en.tex +0 -1
- package/generators/app/templates/subfig.preamble.en.tex +1 -1
- package/generators/app/templates/subfloat.example.en.tex +2 -2
- package/generators/app/templates/url.preamble.de.tex +2 -0
- package/package.json +16 -17
package/generators/app/index.js
CHANGED
|
@@ -1,647 +1,292 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
import { options } from "./options.js";
|
|
3
|
+
import Generator from "yeoman-generator";
|
|
4
|
+
import optionOrPrompt from "yeoman-option-or-prompt";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import yosay from "yosay";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export default class extends Generator {
|
|
9
|
+
_optionOrPrompt = optionOrPrompt;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this.log(
|
|
14
|
-
yosay(`Welcome to the ${chalk.red('latex-template')} generator!`)
|
|
15
|
-
);
|
|
11
|
+
async prompting() {
|
|
12
|
+
this.log(yosay(`Welcome to the ${chalk.red("latex-template")} generator!`));
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// this here was the quickest to integrate to yeoman-option-or-prompt
|
|
20
|
-
// we accept that we currently cannot offer --help
|
|
21
|
-
// for that, command-line-args lib (https://github.com/75lb/command-line-args/) seems to be best: because, it supports multiple values for a key (which might be required at choices below)
|
|
22
|
-
// https://github.com/tj/commander.js could also be OK, but requires comma separated list for muliple values (is uncommon for command line lists, isn't it?)
|
|
23
|
-
// yargs supports choices: http://yargs.js.org/docs/
|
|
24
|
-
// stdio (https://github.com/sgmonda/stdio) does not support choices
|
|
25
|
-
options: require('minimist')(process.argv.slice(2)),
|
|
26
|
-
filteredProps: {},
|
|
27
|
-
prompt: function(filteredProps) {
|
|
28
|
-
this.filteredProps = filteredProps
|
|
29
|
-
return {
|
|
30
|
-
then: function(f) {
|
|
31
|
-
return f;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// see "Development hints" in README.md for help on Inquirer.js
|
|
38
|
-
var mapper = optionOrPrompt.call(params, [
|
|
39
|
-
{
|
|
40
|
-
type: 'list',
|
|
41
|
-
name: 'documentclass',
|
|
42
|
-
message: 'Which template should be generated?',
|
|
43
|
-
choices: [
|
|
44
|
-
{
|
|
45
|
-
name: "Scientic Thesis",
|
|
46
|
-
value: "scientific-thesis"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: "Association for Computing Machinery (ACM)",
|
|
50
|
-
value: "acmart"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "Institute of Electrical and Electronics Engineers (IEEE)",
|
|
54
|
-
value: "ieee"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "Springer's Lecture Notes in Computer Science (LNCS)",
|
|
58
|
-
value: "lncs"
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
default: "scientific-thesis"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
type: 'list',
|
|
65
|
-
name: 'acm_format',
|
|
66
|
-
when: function(response) {
|
|
67
|
-
return response.documentclass === 'acm';
|
|
68
|
-
},
|
|
69
|
-
message: 'Which format of ACM?',
|
|
70
|
-
choices: [
|
|
71
|
-
{
|
|
72
|
-
value: "manuscript",
|
|
73
|
-
name: "A manuscript. This is the default.",
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
value: "acmsmall",
|
|
77
|
-
name: "Small single-column format. Used for CIE, CSUR, JACM, JDIQ, JEA, JERIC, JETC, PACMCGIT, PACMHCI, PACMPL, TAAS, TACCESS, TACO, TALG, TALLIP (formerly TALIP), TCPS, TDS, TEAC, TECS, TELO, THRI, TIIS, TIOT, TISSEC, TIST, TKDD, TMIS, TOCE, TOCHI, TOCL, TOCS, TOCT, TODAES, TODS, TOIS, TOIT, TOMACS, TOMM (formerly TOMCCAP), TOMPECS, TOMS, TOPC, TOPLAS, TOPS, TOS, TOSEM, TOSN, TQC, TRETS, TSAS, TSC, TSLP and TWEB, including special issues.",
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
value: "acmlarge",
|
|
81
|
-
name: "Large single-column format. Used for DTRAP, HEALTH, IMWUT, JOCCH, POMACS and TAP, including special issues.",
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
value: "acmtog",
|
|
85
|
-
name: "Large double-column format. Used for TOG, including annual conference Technical Papers.",
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
value: "sigconf",
|
|
89
|
-
name: "Proceedings format for most ACM conferences (with the exceptionslisted below) and all ICPS volumes.",
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
value: "sigplan",
|
|
93
|
-
name: "Proceedings format for SIGPLAN conferences",
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
default: "sigconf"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
type: 'confirm',
|
|
100
|
-
name: 'acm_review',
|
|
101
|
-
when: function(response) {
|
|
102
|
-
return response.documentclass === 'acm';
|
|
103
|
-
},
|
|
104
|
-
message: 'Format as document to review?',
|
|
105
|
-
default: true
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
type: 'list',
|
|
109
|
-
name: 'ieee_variant',
|
|
110
|
-
when: function(response) {
|
|
111
|
-
return response.documentclass === 'ieee';
|
|
112
|
-
},
|
|
113
|
-
message: 'Which variant of IEEE paper?',
|
|
114
|
-
choices: [
|
|
115
|
-
{
|
|
116
|
-
name: "conference paper",
|
|
117
|
-
value: "conference"
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: "journal paper",
|
|
121
|
-
value: "journal"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
name: "peerreview paper - similar to journal paper, but additional cover page and on first \"real\" paper page title without authors",
|
|
125
|
-
value: "peerreview"
|
|
126
|
-
}
|
|
127
|
-
],
|
|
128
|
-
default: "conference"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
type: 'list',
|
|
132
|
-
name: 'papersize',
|
|
133
|
-
when: function(response) {
|
|
134
|
-
return response.documentclass === 'ieee';
|
|
135
|
-
},
|
|
136
|
-
message: 'Which paper size to use?',
|
|
137
|
-
choices: [
|
|
138
|
-
{
|
|
139
|
-
name: "A4",
|
|
140
|
-
value: "a4"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
name: "US letter",
|
|
144
|
-
value: "letter"
|
|
145
|
-
}
|
|
146
|
-
],
|
|
147
|
-
default: "a4paper"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
type: 'list',
|
|
151
|
-
name: 'overleaf',
|
|
152
|
-
message: 'Overleaf compatibility?',
|
|
153
|
-
choices: [
|
|
154
|
-
{
|
|
155
|
-
name: "yes",
|
|
156
|
-
value: true
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
name: "no",
|
|
160
|
-
value: false
|
|
161
|
-
}
|
|
162
|
-
],
|
|
163
|
-
default: true
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
type: 'list',
|
|
167
|
-
name: 'texlive',
|
|
168
|
-
when: function(response) {
|
|
169
|
-
return (!response.overleaf || (response.overleaf == "false"));
|
|
170
|
-
},
|
|
171
|
-
message: 'Which TeXLive compatibility?',
|
|
172
|
-
choices: [
|
|
173
|
-
{
|
|
174
|
-
name: "TeXLive 2021",
|
|
175
|
-
value: 2021
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
name: "TeXLive 2022",
|
|
179
|
-
value: 2022
|
|
180
|
-
}
|
|
181
|
-
],
|
|
182
|
-
default: 2022
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
type: 'list',
|
|
186
|
-
name: 'latexcompiler',
|
|
187
|
-
message: 'Which latex compiler should be used?',
|
|
188
|
-
choices: ["pdflatex", "lualatex"],
|
|
189
|
-
default: "pdflatex",
|
|
190
|
-
when: function(response) {
|
|
191
|
-
return !(response.documentclass === 'ieee');
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
when: function(response) {
|
|
196
|
-
return ((response.documentclass !== 'acmart') && (response.documentclass !== 'ieee'));
|
|
197
|
-
},
|
|
198
|
-
type: 'list',
|
|
199
|
-
name: 'bibtextool',
|
|
200
|
-
message: 'Which BibTeX tool should be used?',
|
|
201
|
-
choices: [
|
|
202
|
-
{
|
|
203
|
-
name: "BibTeX",
|
|
204
|
-
value: "bibtex"
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
name: "BibLaTeX + biber",
|
|
208
|
-
value: "biblatex"
|
|
209
|
-
}
|
|
210
|
-
],
|
|
211
|
-
default: function(response) {
|
|
212
|
-
switch (response.documentclass) {
|
|
213
|
-
case 'acmart':
|
|
214
|
-
case 'ieee':
|
|
215
|
-
case 'lncs':
|
|
216
|
-
return 'bibtex'
|
|
217
|
-
default:
|
|
218
|
-
return 'biblatex'
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
type: 'list',
|
|
224
|
-
name: 'docker',
|
|
225
|
-
message: 'Should a Dockerfile be generated?',
|
|
226
|
-
choices: [
|
|
227
|
-
{
|
|
228
|
-
name: "no",
|
|
229
|
-
value: false
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
name: "yes (Reiztig)",
|
|
233
|
-
value: "reitzig"
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
name: "yes (DANTE e.V.)",
|
|
237
|
-
value: "dante"
|
|
238
|
-
}
|
|
239
|
-
],
|
|
240
|
-
default: false,
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
type: 'list',
|
|
244
|
-
name: 'language',
|
|
245
|
-
when: function(response) {
|
|
246
|
-
return ((response.documentclass !== 'acmart') && (response.documentclass !== 'ieee'));
|
|
247
|
-
},
|
|
248
|
-
message: 'Which language should the document be?',
|
|
249
|
-
choices: [
|
|
250
|
-
{
|
|
251
|
-
name: "English",
|
|
252
|
-
value: "en"
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
name: "German",
|
|
256
|
-
value: "de"
|
|
257
|
-
}
|
|
258
|
-
],
|
|
259
|
-
default: "en"
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
type: 'list',
|
|
263
|
-
name: 'font',
|
|
264
|
-
message: 'Which font should be used?',
|
|
265
|
-
choices: function(state) {
|
|
266
|
-
var res = [];
|
|
267
|
-
if (state.documentclass === "acmart") {
|
|
268
|
-
res.push({
|
|
269
|
-
name: "ACM Default",
|
|
270
|
-
value: "default"
|
|
271
|
-
})
|
|
272
|
-
} else if (state.documentclass === "ieee") {
|
|
273
|
-
res.push({
|
|
274
|
-
name: "IEEE Default",
|
|
275
|
-
value: "default"
|
|
276
|
-
})
|
|
277
|
-
} else {
|
|
278
|
-
res.push({
|
|
279
|
-
name: "Computer Modern (Default LaTeX font)",
|
|
280
|
-
value: "default"
|
|
281
|
-
})
|
|
282
|
-
if (state.documentclass === "scientific-thesis") {
|
|
283
|
-
res.push({
|
|
284
|
-
name: "Arial",
|
|
285
|
-
value: "arial"
|
|
286
|
-
})
|
|
287
|
-
}
|
|
288
|
-
res.push({
|
|
289
|
-
name: "Times New Roman",
|
|
290
|
-
value: "times"
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
return res;
|
|
294
|
-
},
|
|
295
|
-
default: "default",
|
|
296
|
-
when: function(response) {
|
|
297
|
-
return response.documentclass !== 'ieee';
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
type: 'list',
|
|
302
|
-
name: 'listings',
|
|
303
|
-
message: 'Which package to typeset listings?',
|
|
304
|
-
choices: [
|
|
305
|
-
{
|
|
306
|
-
name: "listings",
|
|
307
|
-
value: "listings"
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
name: "minted (requires a working Python installation)",
|
|
311
|
-
value: "minted"
|
|
312
|
-
}
|
|
313
|
-
],
|
|
314
|
-
default: "listings"
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
type: 'confirm',
|
|
318
|
-
name: 'cleveref',
|
|
319
|
-
message: 'Use cleveref?',
|
|
320
|
-
default: true
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
type: 'list',
|
|
324
|
-
name: 'enquotes',
|
|
325
|
-
message: 'Which package to use to "enquote" text?',
|
|
326
|
-
choices: function(state) {
|
|
327
|
-
var res = [];
|
|
328
|
-
res.push({
|
|
329
|
-
name: "csquotes (\\enquote{...} command)",
|
|
330
|
-
value: "csquotes"
|
|
331
|
-
});
|
|
332
|
-
if (state.language === "en") {
|
|
333
|
-
res.push({
|
|
334
|
-
name: "textcmds (\\qq{...} command)",
|
|
335
|
-
value: "textcmds"
|
|
336
|
-
})
|
|
337
|
-
}
|
|
338
|
-
if (state.language === "de") {
|
|
339
|
-
res.push({
|
|
340
|
-
name: "Plain LaTeX (\\glqq{}text\\grqq{} - not recommended)",
|
|
341
|
-
value: "plainlatex"
|
|
342
|
-
});
|
|
343
|
-
} else {
|
|
344
|
-
res.push({
|
|
345
|
-
name: "Plain LaTeX (``text'' - not recommended)",
|
|
346
|
-
value: "plainlatex"
|
|
347
|
-
})
|
|
348
|
-
};
|
|
349
|
-
return res;
|
|
350
|
-
},
|
|
351
|
-
default: "csquotes"
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
type: 'list',
|
|
355
|
-
name: 'tweak_outerquote',
|
|
356
|
-
message: 'Enable hyphenation tweak (e.g., application"=specific for app-lication-specific at a linebreak) or enable easy quotation (e.g., "application"; not common in default latex setups)?',
|
|
357
|
-
choices: [
|
|
358
|
-
{
|
|
359
|
-
name: "Hyphenation tweak",
|
|
360
|
-
value: "babel"
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
name: "Easy quotation",
|
|
364
|
-
value: "outerquote"
|
|
365
|
-
}
|
|
366
|
-
],
|
|
367
|
-
default: "babel"
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
type: 'list',
|
|
371
|
-
name: 'todo',
|
|
372
|
-
message: 'Which package to mark TODOs?',
|
|
373
|
-
choices: [
|
|
374
|
-
{
|
|
375
|
-
name: "pdfcomment",
|
|
376
|
-
value: "pdfcomment"
|
|
377
|
-
},/*
|
|
378
|
-
{
|
|
379
|
-
name: "Plain LaTeX (simple \\commentontext and \\commentatside are defined)",
|
|
380
|
-
value: "plainlatex"
|
|
381
|
-
},*/
|
|
382
|
-
{
|
|
383
|
-
name: "None (no support)",
|
|
384
|
-
value: "none"
|
|
385
|
-
}
|
|
386
|
-
],
|
|
387
|
-
default: "pdfcomment"
|
|
388
|
-
},
|
|
389
|
-
{
|
|
390
|
-
type: 'confirm',
|
|
391
|
-
name: 'howtotext',
|
|
392
|
-
message: 'Include hints on text (e.g., how to write an abstract)?',
|
|
393
|
-
default: true
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
type: 'confirm',
|
|
397
|
-
name: 'examples',
|
|
398
|
-
message: 'Include minimal LaTeX examples?',
|
|
399
|
-
default: true
|
|
400
|
-
}
|
|
401
|
-
]);
|
|
14
|
+
// See "Development hints" in README.md for help on Inquirer.js
|
|
15
|
+
const props = await this._optionOrPrompt(options);
|
|
402
16
|
|
|
403
|
-
this.
|
|
404
|
-
this.
|
|
17
|
+
// To access props later use this.props.someAnswer;
|
|
18
|
+
this.props = props;
|
|
405
19
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
if (
|
|
409
|
-
|
|
410
|
-
resolve(this.params.options)
|
|
411
|
-
})
|
|
412
|
-
} else {
|
|
413
|
-
prompt = this.prompt(params.filteredProps).then(props => this.mapper(props));
|
|
20
|
+
// Somehow texlive is not routed through
|
|
21
|
+
// special handling
|
|
22
|
+
if (this.options.texlive) {
|
|
23
|
+
this.props.texlive = parseInt(this.options.texlive, 10);
|
|
414
24
|
}
|
|
415
25
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
if (this.props.overleaf) {
|
|
421
|
-
// we do not prompt for texlive version in case of overleaf
|
|
422
|
-
this.props.texlive = 2021;
|
|
423
|
-
}
|
|
26
|
+
// Command line argument "--githubpublish" switches the generator to generate a template deployable on a GitHub repository (causing e.g., a refined README.md)
|
|
27
|
+
this.props.githubpublish = this.options.githubpublish;
|
|
28
|
+
this.props.githubpublish =
|
|
29
|
+
this.props.githubpublish === true || this.props.githubpublish === "true";
|
|
424
30
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
31
|
+
// Command line argument "--preparereitzig" switches the generator to generate a template to be used to generate Texlivefile required by https://github.com/reitzig/texlive-docker
|
|
32
|
+
this.props.preparereitzig = this.options.preparereitzig;
|
|
33
|
+
this.props.preparereitzig =
|
|
34
|
+
this.props.preparereitzig === true ||
|
|
35
|
+
this.props.preparereitzig === "true";
|
|
430
36
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
this.props.
|
|
37
|
+
// Ensure all values are set - even if the user was not asked
|
|
38
|
+
if (
|
|
39
|
+
this.props.documentclass === "acmart" ||
|
|
40
|
+
this.props.documentclass === "ieee"
|
|
41
|
+
) {
|
|
42
|
+
this.props.bibtextool = "bibtex";
|
|
43
|
+
this.props.font = "default";
|
|
44
|
+
}
|
|
434
45
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
this.props.preparereitzig = (this.props.preparereitzig === true) || (this.props.preparereitzig === 'true')
|
|
46
|
+
// --language does not work properly, therefore, we used "lang" above. The templates still use "language"
|
|
47
|
+
this.props.language = this.props.lang;
|
|
438
48
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
this.props.font = 'default';
|
|
443
|
-
this.props.language = 'en';
|
|
444
|
-
}
|
|
49
|
+
// IEEE class offers "compsoc"
|
|
50
|
+
// In 2021 this is not used any more, all papers are the "normal" IEEE format
|
|
51
|
+
this.props.ieeecompsoc = false;
|
|
445
52
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
this.props.
|
|
53
|
+
// As of 2021-12-24 the IEEE setup does not work on TeXLive 2021 and lualatex
|
|
54
|
+
if (this.props.documentclass === "ieee") {
|
|
55
|
+
this.props.latexcompiler = "pdflatex";
|
|
56
|
+
}
|
|
449
57
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
58
|
+
// Convert "String" Boolean command line options
|
|
59
|
+
this.props.examples =
|
|
60
|
+
this.props.examples === true || this.props.examples === "true";
|
|
61
|
+
this.props.howtotext =
|
|
62
|
+
this.props.howtotext === true || this.props.howtotext === "true";
|
|
63
|
+
this.props.overleaf =
|
|
64
|
+
this.props.overleaf === true || this.props.overleaf === "true";
|
|
454
65
|
|
|
455
|
-
|
|
456
|
-
this.props.
|
|
457
|
-
this.props.
|
|
458
|
-
this.props.
|
|
459
|
-
|
|
66
|
+
if (this.props.examples) {
|
|
67
|
+
this.props.useExampleEnvironment = true;
|
|
68
|
+
this.props.bexample = "\\begin{ltgexample}";
|
|
69
|
+
this.props.eexample = "\\end{ltgexample}";
|
|
70
|
+
} else {
|
|
71
|
+
this.props.useExampleEnvironment = false;
|
|
72
|
+
this.props.bexample = "";
|
|
73
|
+
this.props.eexample = "";
|
|
74
|
+
}
|
|
460
75
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}
|
|
76
|
+
if (this.props.tweakouterquote === "outerquote") {
|
|
77
|
+
this.props.bquote = '"';
|
|
78
|
+
this.props.equote = '"';
|
|
79
|
+
} else if (this.props.enquotes === "csquotes") {
|
|
80
|
+
this.props.bquote = "\\enquote{";
|
|
81
|
+
this.props.equote = "}";
|
|
82
|
+
} else if (this.props.enquotes === "textcmds") {
|
|
83
|
+
this.props.bquote = "\\qq{";
|
|
84
|
+
this.props.equote = "}";
|
|
85
|
+
} else {
|
|
86
|
+
this.props.bquote = '"`';
|
|
87
|
+
this.props.equote = "\"'";
|
|
88
|
+
}
|
|
470
89
|
|
|
471
|
-
|
|
472
|
-
this.props.bquote = "\"";
|
|
473
|
-
this.props.equote = "\"";
|
|
474
|
-
} else if (this.props.enquotes == 'csquotes') {
|
|
475
|
-
this.props.bquote = "\\enquote{";
|
|
476
|
-
this.props.equote = "}";
|
|
477
|
-
} else if (this.props.enquotes == 'textcmds') {
|
|
478
|
-
this.props.bquote = "\\qq{";
|
|
479
|
-
this.props.equote = "}";
|
|
480
|
-
} else {
|
|
481
|
-
this.props.bquote = "\"`";
|
|
482
|
-
this.props.equote = "\"'";
|
|
483
|
-
}
|
|
90
|
+
this.props.requiresShellEscape = this.props.listings === "minted";
|
|
484
91
|
|
|
485
|
-
|
|
92
|
+
createFeatures(props);
|
|
93
|
+
isPaperHandling(props);
|
|
94
|
+
createHeadingCommands(props);
|
|
95
|
+
createAvailable(props);
|
|
486
96
|
|
|
487
|
-
|
|
488
|
-
|
|
97
|
+
function createFeatures(props) {
|
|
98
|
+
props.feature = {};
|
|
99
|
+
props.feature.acronyms = props.documentclass === "scientific-thesis";
|
|
100
|
+
}
|
|
489
101
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
102
|
+
function isPaperHandling(props) {
|
|
103
|
+
props.isPaper =
|
|
104
|
+
props.documentclass === "acmart" ||
|
|
105
|
+
props.documentclass === "ieee" ||
|
|
106
|
+
props.documentclass === "lncs";
|
|
107
|
+
if (props.isPaper) {
|
|
108
|
+
// This sets filenames.main and filenames.bib
|
|
109
|
+
props.filenames = {
|
|
110
|
+
main: "paper",
|
|
111
|
+
bib: "paper",
|
|
496
112
|
};
|
|
497
113
|
} else {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
114
|
+
props.filenames = {
|
|
115
|
+
main: "main",
|
|
116
|
+
bib: "bibliography",
|
|
501
117
|
};
|
|
502
118
|
}
|
|
119
|
+
}
|
|
503
120
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
121
|
+
function createHeadingCommands(props) {
|
|
122
|
+
if (props.documentclass === "scientific-thesis") {
|
|
123
|
+
props.heading1 = "\\chapter";
|
|
124
|
+
props.heading2 = "\\section";
|
|
507
125
|
} else {
|
|
508
|
-
|
|
509
|
-
|
|
126
|
+
props.heading1 = "\\section";
|
|
127
|
+
props.heading2 = "\\subsection";
|
|
510
128
|
}
|
|
129
|
+
}
|
|
511
130
|
|
|
512
|
-
|
|
131
|
+
function createAvailable(props) {
|
|
132
|
+
props.available = {};
|
|
513
133
|
|
|
514
|
-
if (
|
|
515
|
-
|
|
134
|
+
if (
|
|
135
|
+
props.bibtextool === "bibtex" &&
|
|
136
|
+
props.documentclass !== "acmart" &&
|
|
137
|
+
props.documentclass !== "ieee" &&
|
|
138
|
+
props.documentclass !== "lncs"
|
|
139
|
+
) {
|
|
140
|
+
// Acmart uses natbib
|
|
516
141
|
// in lncs, we patched-in natbib
|
|
517
|
-
|
|
142
|
+
props.available.citet = false;
|
|
518
143
|
} else {
|
|
519
|
-
|
|
144
|
+
props.available.citet = true;
|
|
520
145
|
}
|
|
521
|
-
}
|
|
146
|
+
}
|
|
522
147
|
}
|
|
523
148
|
|
|
524
149
|
writing() {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
global.fs.copy(
|
|
150
|
+
this.props.config = this.props;
|
|
151
|
+
this.fs.copy(
|
|
528
152
|
// .gitignore is not uploaded by npm publish
|
|
529
153
|
// Thus, we prefix it with `dot`.
|
|
530
|
-
|
|
531
|
-
|
|
154
|
+
this.templatePath("dot.gitignore"),
|
|
155
|
+
this.destinationPath(".gitignore")
|
|
532
156
|
);
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
157
|
+
this.fs.copyTpl(
|
|
158
|
+
this.templatePath("dot.editorconfig"),
|
|
159
|
+
this.destinationPath(".editorconfig"),
|
|
160
|
+
this.props
|
|
537
161
|
);
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
162
|
+
this.fs.copyTpl(
|
|
163
|
+
this.templatePath("bibliography.bib"),
|
|
164
|
+
this.destinationPath(this.props.filenames.bib + ".bib"),
|
|
165
|
+
this.props
|
|
542
166
|
);
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
167
|
+
this.fs.copyTpl(
|
|
168
|
+
this.templatePath("latexmkrc"),
|
|
169
|
+
this.destinationPath(this.props.overleaf ? "_latexmkrc" : "latexmkrc"),
|
|
170
|
+
this.props
|
|
547
171
|
);
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
172
|
+
this.fs.copyTpl(
|
|
173
|
+
this.templatePath("localSettings.yaml"),
|
|
174
|
+
this.destinationPath("localSettings.yaml"),
|
|
175
|
+
this.props
|
|
552
176
|
);
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
177
|
+
this.fs.copyTpl(
|
|
178
|
+
this.templatePath("LICENSE"),
|
|
179
|
+
this.destinationPath("LICENSE"),
|
|
180
|
+
this.props
|
|
557
181
|
);
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
182
|
+
this.fs.copyTpl(
|
|
183
|
+
this.templatePath("Makefile"),
|
|
184
|
+
this.destinationPath("Makefile"),
|
|
185
|
+
this.props
|
|
562
186
|
);
|
|
563
|
-
if (
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
187
|
+
if (this.props.documentclass === "lncs") {
|
|
188
|
+
this.fs.copy(
|
|
189
|
+
this.templatePath("splncs04nat.bst"),
|
|
190
|
+
this.destinationPath("splncs04nat.bst")
|
|
567
191
|
);
|
|
568
192
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
193
|
+
|
|
194
|
+
if (this.props.language === "de") {
|
|
195
|
+
this.fs.copyTpl(
|
|
196
|
+
this.templatePath("main.de.tex"),
|
|
197
|
+
this.destinationPath(this.props.filenames.main + ".tex"),
|
|
198
|
+
this.props
|
|
574
199
|
);
|
|
575
|
-
if (
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
200
|
+
if (this.props.documentclass === "scientific-thesis") {
|
|
201
|
+
this.fs.copy(
|
|
202
|
+
this.templatePath("acronyms.de.tex"),
|
|
203
|
+
this.destinationPath("acronyms.tex")
|
|
579
204
|
);
|
|
580
205
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
206
|
+
|
|
207
|
+
if (!this.props.githubpublish) {
|
|
208
|
+
// We keep the English README.md in case of GitHub publish
|
|
209
|
+
this.fs.copyTpl(
|
|
210
|
+
this.templatePath("README.de.md"),
|
|
211
|
+
this.destinationPath("README.md"),
|
|
212
|
+
this.props
|
|
587
213
|
);
|
|
588
214
|
}
|
|
589
215
|
} else {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
216
|
+
this.fs.copyTpl(
|
|
217
|
+
this.templatePath("main.en.tex"),
|
|
218
|
+
this.destinationPath(this.props.filenames.main + ".tex"),
|
|
219
|
+
this.props
|
|
594
220
|
);
|
|
595
|
-
if (
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
221
|
+
if (this.props.documentclass === "scientific-thesis") {
|
|
222
|
+
this.fs.copy(
|
|
223
|
+
this.templatePath("acronyms.en.tex"),
|
|
224
|
+
this.destinationPath("acronyms.tex")
|
|
599
225
|
);
|
|
600
226
|
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
227
|
+
|
|
228
|
+
this.fs.copyTpl(
|
|
229
|
+
this.templatePath("README.en.md"),
|
|
230
|
+
this.destinationPath("README.md"),
|
|
231
|
+
this.props
|
|
605
232
|
);
|
|
606
233
|
}
|
|
607
|
-
|
|
234
|
+
|
|
235
|
+
// eslint-disable-next-line default-case
|
|
236
|
+
switch (this.props.docker) {
|
|
237
|
+
case "iot":
|
|
238
|
+
this.fs.copy(
|
|
239
|
+
this.templatePath("dot.dockerignore"),
|
|
240
|
+
this.destinationPath(".dockerignore")
|
|
241
|
+
);
|
|
242
|
+
this.fs.copyTpl(
|
|
243
|
+
this.templatePath("Dockerfile.iot"),
|
|
244
|
+
this.destinationPath("Dockerfile"),
|
|
245
|
+
this.props
|
|
246
|
+
);
|
|
247
|
+
this.fs.copyTpl(
|
|
248
|
+
this.templatePath("Texlivefile"),
|
|
249
|
+
this.destinationPath("Texlivefile"),
|
|
250
|
+
this.props
|
|
251
|
+
);
|
|
252
|
+
break;
|
|
608
253
|
case "reitzig":
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
254
|
+
this.fs.copy(
|
|
255
|
+
this.templatePath("dot.dockerignore"),
|
|
256
|
+
this.destinationPath(".dockerignore")
|
|
612
257
|
);
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
258
|
+
this.fs.copyTpl(
|
|
259
|
+
this.templatePath("Dockerfile.reitzig"),
|
|
260
|
+
this.destinationPath("Dockerfile"),
|
|
261
|
+
this.props
|
|
617
262
|
);
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
263
|
+
this.fs.copyTpl(
|
|
264
|
+
this.templatePath("Texlivefile"),
|
|
265
|
+
this.destinationPath("Texlivefile"),
|
|
266
|
+
this.props
|
|
622
267
|
);
|
|
623
268
|
break;
|
|
624
269
|
case "dante":
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
270
|
+
this.fs.copy(
|
|
271
|
+
this.templatePath("dot.dockerignore"),
|
|
272
|
+
this.destinationPath(".dockerignore")
|
|
628
273
|
);
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
274
|
+
this.fs.copyTpl(
|
|
275
|
+
this.templatePath("Dockerfile.dante"),
|
|
276
|
+
this.destinationPath("Dockerfile"),
|
|
277
|
+
this.props
|
|
633
278
|
);
|
|
634
279
|
break;
|
|
635
280
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
281
|
+
|
|
282
|
+
if (this.props.docker) {
|
|
283
|
+
this.fs.copyTpl(
|
|
284
|
+
this.templatePath(".github/workflows/check.yml"),
|
|
285
|
+
this.destinationPath(".github/workflows/check.yml"),
|
|
286
|
+
this.props
|
|
641
287
|
);
|
|
642
288
|
}
|
|
643
289
|
}
|
|
644
290
|
|
|
645
|
-
install() {
|
|
646
|
-
|
|
647
|
-
};
|
|
291
|
+
install() {}
|
|
292
|
+
}
|