generator-latex-template 0.7.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 +19 -17
- package/generators/app/index.js +222 -568
- package/generators/app/options.js +375 -0
- 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 +4 -10
- 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 -0
- package/generators/app/templates/hyphenation.example.en.tex +1 -1
- package/generators/app/templates/latexmkrc +1 -3
- package/generators/app/templates/main.de.tex +581 -139
- package/generators/app/templates/main.en.tex +11 -17
- package/generators/app/templates/microtype.preamble.de.tex +5 -0
- 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/url.preamble.de.tex +2 -0
- package/package.json +15 -16
- package/generators/app/templates/refcheck.example.en.tex +0 -36
- package/generators/app/templates/refcheck.preamble.en.tex +0 -4
package/generators/app/index.js
CHANGED
|
@@ -1,638 +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
|
-
message: 'Which paper size to use?',
|
|
134
|
-
choices: [
|
|
135
|
-
{
|
|
136
|
-
name: "A4",
|
|
137
|
-
value: "a4"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: "US letter",
|
|
141
|
-
value: "letter"
|
|
142
|
-
}
|
|
143
|
-
],
|
|
144
|
-
default: "a4"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
type: 'list',
|
|
148
|
-
name: 'overleaf',
|
|
149
|
-
message: 'Overleaf compatibility?',
|
|
150
|
-
choices: [
|
|
151
|
-
{
|
|
152
|
-
name: "yes",
|
|
153
|
-
value: true
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
name: "no",
|
|
157
|
-
value: false
|
|
158
|
-
}
|
|
159
|
-
],
|
|
160
|
-
default: true
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
type: 'list',
|
|
164
|
-
name: 'texlive',
|
|
165
|
-
when: function(response) {
|
|
166
|
-
return (!response.overleaf || (response.overleaf == "false"));
|
|
167
|
-
},
|
|
168
|
-
message: 'Which TeXLive compatibility?',
|
|
169
|
-
choices: [
|
|
170
|
-
{
|
|
171
|
-
name: "TeXLive 2021",
|
|
172
|
-
value: 2021
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
name: "TeXLive 2022",
|
|
176
|
-
value: 2022
|
|
177
|
-
}
|
|
178
|
-
],
|
|
179
|
-
default: 2022
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
type: 'list',
|
|
183
|
-
name: 'latexcompiler',
|
|
184
|
-
message: 'Which latex compiler should be used?',
|
|
185
|
-
choices: ["pdflatex", "lualatex"],
|
|
186
|
-
default: "pdflatex",
|
|
187
|
-
when: function(response) {
|
|
188
|
-
return !(response.documentclass === 'ieee');
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
when: function(response) {
|
|
193
|
-
return ((response.documentclass !== 'acmart') && (response.documentclass !== 'ieee'));
|
|
194
|
-
},
|
|
195
|
-
type: 'list',
|
|
196
|
-
name: 'bibtextool',
|
|
197
|
-
message: 'Which BibTeX tool should be used?',
|
|
198
|
-
choices: [
|
|
199
|
-
{
|
|
200
|
-
name: "BibTeX",
|
|
201
|
-
value: "bibtex"
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
name: "BibLaTeX + biber",
|
|
205
|
-
value: "biblatex"
|
|
206
|
-
}
|
|
207
|
-
],
|
|
208
|
-
default: function(response) {
|
|
209
|
-
switch (response.documentclass) {
|
|
210
|
-
case 'acmart':
|
|
211
|
-
case 'ieee':
|
|
212
|
-
case 'lncs':
|
|
213
|
-
return 'bibtex'
|
|
214
|
-
default:
|
|
215
|
-
return 'biblatex'
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
type: 'list',
|
|
221
|
-
name: 'docker',
|
|
222
|
-
message: 'Should a Dockerfile be generated?',
|
|
223
|
-
choices: [
|
|
224
|
-
{
|
|
225
|
-
name: "no",
|
|
226
|
-
value: false
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
name: "yes (Reiztig)",
|
|
230
|
-
value: "reitzig"
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
name: "yes (DANTE e.V.)",
|
|
234
|
-
value: "dante"
|
|
235
|
-
}
|
|
236
|
-
],
|
|
237
|
-
default: false,
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
type: 'list',
|
|
241
|
-
name: 'language',
|
|
242
|
-
when: function(response) {
|
|
243
|
-
return ((response.documentclass !== 'acmart') && (response.documentclass !== 'ieee'));
|
|
244
|
-
},
|
|
245
|
-
message: 'Which language should the document be?',
|
|
246
|
-
choices: [
|
|
247
|
-
{
|
|
248
|
-
name: "English",
|
|
249
|
-
value: "en"
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
name: "German",
|
|
253
|
-
value: "de"
|
|
254
|
-
}
|
|
255
|
-
],
|
|
256
|
-
default: "en"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
type: 'list',
|
|
260
|
-
name: 'font',
|
|
261
|
-
message: 'Which font should be used?',
|
|
262
|
-
choices: function(state) {
|
|
263
|
-
var res = [];
|
|
264
|
-
if (state.documentclass === "acmart") {
|
|
265
|
-
res.push({
|
|
266
|
-
name: "ACM Default",
|
|
267
|
-
value: "default"
|
|
268
|
-
})
|
|
269
|
-
} else if (state.documentclass === "ieee") {
|
|
270
|
-
res.push({
|
|
271
|
-
name: "IEEE Default",
|
|
272
|
-
value: "default"
|
|
273
|
-
})
|
|
274
|
-
} else {
|
|
275
|
-
res.push({
|
|
276
|
-
name: "Computer Modern (Default LaTeX font)",
|
|
277
|
-
value: "default"
|
|
278
|
-
})
|
|
279
|
-
if (state.documentclass === "scientific-thesis") {
|
|
280
|
-
res.push({
|
|
281
|
-
name: "Arial",
|
|
282
|
-
value: "arial"
|
|
283
|
-
})
|
|
284
|
-
}
|
|
285
|
-
res.push({
|
|
286
|
-
name: "Times New Roman",
|
|
287
|
-
value: "times"
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
return res;
|
|
291
|
-
},
|
|
292
|
-
default: "default",
|
|
293
|
-
when: function(response) {
|
|
294
|
-
return response.documentclass !== 'ieee';
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
type: 'list',
|
|
299
|
-
name: 'listings',
|
|
300
|
-
message: 'Which package to typeset listings?',
|
|
301
|
-
choices: [
|
|
302
|
-
{
|
|
303
|
-
name: "listings",
|
|
304
|
-
value: "listings"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
name: "minted (requires a working Python installation)",
|
|
308
|
-
value: "minted"
|
|
309
|
-
}
|
|
310
|
-
],
|
|
311
|
-
default: "listings"
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
type: 'list',
|
|
315
|
-
name: 'enquotes',
|
|
316
|
-
message: 'Which package to use to "enquote" text?',
|
|
317
|
-
choices: function(state) {
|
|
318
|
-
var res = [];
|
|
319
|
-
res.push({
|
|
320
|
-
name: "csquotes (\\enquote{...} command)",
|
|
321
|
-
value: "csquotes"
|
|
322
|
-
});
|
|
323
|
-
if (state.language === "en") {
|
|
324
|
-
res.push({
|
|
325
|
-
name: "textcmds (\\qq{...} command)",
|
|
326
|
-
value: "textcmds"
|
|
327
|
-
})
|
|
328
|
-
}
|
|
329
|
-
if (state.language === "de") {
|
|
330
|
-
res.push({
|
|
331
|
-
name: "Plain LaTeX (\\glqq{}text\\grqq{} - not recommended)",
|
|
332
|
-
value: "plainlatex"
|
|
333
|
-
});
|
|
334
|
-
} else {
|
|
335
|
-
res.push({
|
|
336
|
-
name: "Plain LaTeX (``text'' - not recommended)",
|
|
337
|
-
value: "plainlatex"
|
|
338
|
-
})
|
|
339
|
-
};
|
|
340
|
-
return res;
|
|
341
|
-
},
|
|
342
|
-
default: "csquotes"
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
type: 'list',
|
|
346
|
-
name: 'tweak_outerquote',
|
|
347
|
-
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)?',
|
|
348
|
-
choices: [
|
|
349
|
-
{
|
|
350
|
-
name: "Hyphenation tweak",
|
|
351
|
-
value: "babel"
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
name: "Easy quotation",
|
|
355
|
-
value: "outerquote"
|
|
356
|
-
}
|
|
357
|
-
],
|
|
358
|
-
default: "babel"
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
type: 'list',
|
|
362
|
-
name: 'todo',
|
|
363
|
-
message: 'Which package to mark TODOs?',
|
|
364
|
-
choices: [
|
|
365
|
-
{
|
|
366
|
-
name: "pdfcomment",
|
|
367
|
-
value: "pdfcomment"
|
|
368
|
-
},/*
|
|
369
|
-
{
|
|
370
|
-
name: "Plain LaTeX (simple \\commentontext and \\commentatside are defined)",
|
|
371
|
-
value: "plainlatex"
|
|
372
|
-
},*/
|
|
373
|
-
{
|
|
374
|
-
name: "None (no support)",
|
|
375
|
-
value: "none"
|
|
376
|
-
}
|
|
377
|
-
],
|
|
378
|
-
default: "pdfcomment"
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
type: 'confirm',
|
|
382
|
-
name: 'howtotext',
|
|
383
|
-
message: 'Include hints on text (e.g., how to write an abstract)?',
|
|
384
|
-
default: true
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
type: 'confirm',
|
|
388
|
-
name: 'examples',
|
|
389
|
-
message: 'Include minimal LaTeX examples?',
|
|
390
|
-
default: true
|
|
391
|
-
}
|
|
392
|
-
]);
|
|
14
|
+
// See "Development hints" in README.md for help on Inquirer.js
|
|
15
|
+
const props = await this._optionOrPrompt(options);
|
|
393
16
|
|
|
394
|
-
this.
|
|
395
|
-
this.
|
|
17
|
+
// To access props later use this.props.someAnswer;
|
|
18
|
+
this.props = props;
|
|
396
19
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
if (
|
|
400
|
-
|
|
401
|
-
resolve(this.params.options)
|
|
402
|
-
})
|
|
403
|
-
} else {
|
|
404
|
-
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);
|
|
405
24
|
}
|
|
406
25
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
if (this.props.overleaf) {
|
|
412
|
-
// we do not prompt for texlive version in case of overleaf
|
|
413
|
-
this.props.texlive = 2021;
|
|
414
|
-
}
|
|
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";
|
|
415
30
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
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";
|
|
421
36
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
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
|
+
}
|
|
425
45
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
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;
|
|
429
48
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
this.props.font = 'default';
|
|
434
|
-
this.props.language = 'en';
|
|
435
|
-
}
|
|
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;
|
|
436
52
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
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
|
+
}
|
|
440
57
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
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";
|
|
445
65
|
|
|
446
|
-
|
|
447
|
-
this.props.
|
|
448
|
-
this.props.
|
|
449
|
-
this.props.
|
|
450
|
-
|
|
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
|
+
}
|
|
451
75
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
}
|
|
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
|
+
}
|
|
461
89
|
|
|
462
|
-
|
|
463
|
-
this.props.bquote = "\"";
|
|
464
|
-
this.props.equote = "\"";
|
|
465
|
-
} else if (this.props.enquotes == 'csquotes') {
|
|
466
|
-
this.props.bquote = "\\enquote{";
|
|
467
|
-
this.props.equote = "}";
|
|
468
|
-
} else if (this.props.enquotes == 'textcmds') {
|
|
469
|
-
this.props.bquote = "\\qq{";
|
|
470
|
-
this.props.equote = "}";
|
|
471
|
-
} else {
|
|
472
|
-
this.props.bquote = "\"`";
|
|
473
|
-
this.props.equote = "\"'";
|
|
474
|
-
}
|
|
90
|
+
this.props.requiresShellEscape = this.props.listings === "minted";
|
|
475
91
|
|
|
476
|
-
|
|
92
|
+
createFeatures(props);
|
|
93
|
+
isPaperHandling(props);
|
|
94
|
+
createHeadingCommands(props);
|
|
95
|
+
createAvailable(props);
|
|
477
96
|
|
|
478
|
-
|
|
479
|
-
|
|
97
|
+
function createFeatures(props) {
|
|
98
|
+
props.feature = {};
|
|
99
|
+
props.feature.acronyms = props.documentclass === "scientific-thesis";
|
|
100
|
+
}
|
|
480
101
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
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",
|
|
487
112
|
};
|
|
488
113
|
} else {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
114
|
+
props.filenames = {
|
|
115
|
+
main: "main",
|
|
116
|
+
bib: "bibliography",
|
|
492
117
|
};
|
|
493
118
|
}
|
|
119
|
+
}
|
|
494
120
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
121
|
+
function createHeadingCommands(props) {
|
|
122
|
+
if (props.documentclass === "scientific-thesis") {
|
|
123
|
+
props.heading1 = "\\chapter";
|
|
124
|
+
props.heading2 = "\\section";
|
|
498
125
|
} else {
|
|
499
|
-
|
|
500
|
-
|
|
126
|
+
props.heading1 = "\\section";
|
|
127
|
+
props.heading2 = "\\subsection";
|
|
501
128
|
}
|
|
129
|
+
}
|
|
502
130
|
|
|
503
|
-
|
|
131
|
+
function createAvailable(props) {
|
|
132
|
+
props.available = {};
|
|
504
133
|
|
|
505
|
-
if (
|
|
506
|
-
|
|
134
|
+
if (
|
|
135
|
+
props.bibtextool === "bibtex" &&
|
|
136
|
+
props.documentclass !== "acmart" &&
|
|
137
|
+
props.documentclass !== "ieee" &&
|
|
138
|
+
props.documentclass !== "lncs"
|
|
139
|
+
) {
|
|
140
|
+
// Acmart uses natbib
|
|
507
141
|
// in lncs, we patched-in natbib
|
|
508
|
-
|
|
142
|
+
props.available.citet = false;
|
|
509
143
|
} else {
|
|
510
|
-
|
|
144
|
+
props.available.citet = true;
|
|
511
145
|
}
|
|
512
|
-
}
|
|
146
|
+
}
|
|
513
147
|
}
|
|
514
148
|
|
|
515
149
|
writing() {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
global.fs.copy(
|
|
150
|
+
this.props.config = this.props;
|
|
151
|
+
this.fs.copy(
|
|
519
152
|
// .gitignore is not uploaded by npm publish
|
|
520
153
|
// Thus, we prefix it with `dot`.
|
|
521
|
-
|
|
522
|
-
|
|
154
|
+
this.templatePath("dot.gitignore"),
|
|
155
|
+
this.destinationPath(".gitignore")
|
|
523
156
|
);
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
157
|
+
this.fs.copyTpl(
|
|
158
|
+
this.templatePath("dot.editorconfig"),
|
|
159
|
+
this.destinationPath(".editorconfig"),
|
|
160
|
+
this.props
|
|
528
161
|
);
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
162
|
+
this.fs.copyTpl(
|
|
163
|
+
this.templatePath("bibliography.bib"),
|
|
164
|
+
this.destinationPath(this.props.filenames.bib + ".bib"),
|
|
165
|
+
this.props
|
|
533
166
|
);
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
167
|
+
this.fs.copyTpl(
|
|
168
|
+
this.templatePath("latexmkrc"),
|
|
169
|
+
this.destinationPath(this.props.overleaf ? "_latexmkrc" : "latexmkrc"),
|
|
170
|
+
this.props
|
|
538
171
|
);
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
172
|
+
this.fs.copyTpl(
|
|
173
|
+
this.templatePath("localSettings.yaml"),
|
|
174
|
+
this.destinationPath("localSettings.yaml"),
|
|
175
|
+
this.props
|
|
543
176
|
);
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
177
|
+
this.fs.copyTpl(
|
|
178
|
+
this.templatePath("LICENSE"),
|
|
179
|
+
this.destinationPath("LICENSE"),
|
|
180
|
+
this.props
|
|
548
181
|
);
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
182
|
+
this.fs.copyTpl(
|
|
183
|
+
this.templatePath("Makefile"),
|
|
184
|
+
this.destinationPath("Makefile"),
|
|
185
|
+
this.props
|
|
553
186
|
);
|
|
554
|
-
if (
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
187
|
+
if (this.props.documentclass === "lncs") {
|
|
188
|
+
this.fs.copy(
|
|
189
|
+
this.templatePath("splncs04nat.bst"),
|
|
190
|
+
this.destinationPath("splncs04nat.bst")
|
|
558
191
|
);
|
|
559
192
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
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
|
|
565
199
|
);
|
|
566
|
-
if (
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
200
|
+
if (this.props.documentclass === "scientific-thesis") {
|
|
201
|
+
this.fs.copy(
|
|
202
|
+
this.templatePath("acronyms.de.tex"),
|
|
203
|
+
this.destinationPath("acronyms.tex")
|
|
570
204
|
);
|
|
571
205
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
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
|
|
578
213
|
);
|
|
579
214
|
}
|
|
580
215
|
} else {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
216
|
+
this.fs.copyTpl(
|
|
217
|
+
this.templatePath("main.en.tex"),
|
|
218
|
+
this.destinationPath(this.props.filenames.main + ".tex"),
|
|
219
|
+
this.props
|
|
585
220
|
);
|
|
586
|
-
if (
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
221
|
+
if (this.props.documentclass === "scientific-thesis") {
|
|
222
|
+
this.fs.copy(
|
|
223
|
+
this.templatePath("acronyms.en.tex"),
|
|
224
|
+
this.destinationPath("acronyms.tex")
|
|
590
225
|
);
|
|
591
226
|
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
227
|
+
|
|
228
|
+
this.fs.copyTpl(
|
|
229
|
+
this.templatePath("README.en.md"),
|
|
230
|
+
this.destinationPath("README.md"),
|
|
231
|
+
this.props
|
|
596
232
|
);
|
|
597
233
|
}
|
|
598
|
-
|
|
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;
|
|
599
253
|
case "reitzig":
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
254
|
+
this.fs.copy(
|
|
255
|
+
this.templatePath("dot.dockerignore"),
|
|
256
|
+
this.destinationPath(".dockerignore")
|
|
603
257
|
);
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
258
|
+
this.fs.copyTpl(
|
|
259
|
+
this.templatePath("Dockerfile.reitzig"),
|
|
260
|
+
this.destinationPath("Dockerfile"),
|
|
261
|
+
this.props
|
|
608
262
|
);
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
263
|
+
this.fs.copyTpl(
|
|
264
|
+
this.templatePath("Texlivefile"),
|
|
265
|
+
this.destinationPath("Texlivefile"),
|
|
266
|
+
this.props
|
|
613
267
|
);
|
|
614
268
|
break;
|
|
615
269
|
case "dante":
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
270
|
+
this.fs.copy(
|
|
271
|
+
this.templatePath("dot.dockerignore"),
|
|
272
|
+
this.destinationPath(".dockerignore")
|
|
619
273
|
);
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
274
|
+
this.fs.copyTpl(
|
|
275
|
+
this.templatePath("Dockerfile.dante"),
|
|
276
|
+
this.destinationPath("Dockerfile"),
|
|
277
|
+
this.props
|
|
624
278
|
);
|
|
625
279
|
break;
|
|
626
280
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
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
|
|
632
287
|
);
|
|
633
288
|
}
|
|
634
289
|
}
|
|
635
290
|
|
|
636
|
-
install() {
|
|
637
|
-
|
|
638
|
-
};
|
|
291
|
+
install() {}
|
|
292
|
+
}
|