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.
Files changed (28) hide show
  1. package/README.md +19 -17
  2. package/generators/app/index.js +222 -568
  3. package/generators/app/options.js +375 -0
  4. package/generators/app/templates/Dockerfile.dante +3 -1
  5. package/generators/app/templates/Dockerfile.iot +14 -0
  6. package/generators/app/templates/Dockerfile.reitzig +12 -11
  7. package/generators/app/templates/README.en.md +4 -10
  8. package/generators/app/templates/Texlivefile +28 -3
  9. package/generators/app/templates/babel.preamble.de.tex +3 -1
  10. package/generators/app/templates/babel.preamble.en.tex +1 -1
  11. package/generators/app/templates/csquotes.example.de.tex +1 -1
  12. package/generators/app/templates/csquotes.example.en.tex +1 -1
  13. package/generators/app/templates/csquotes.preamble.en.tex +1 -1
  14. package/generators/app/templates/figure.example.de.tex +18 -0
  15. package/generators/app/templates/hyphenation.example.en.tex +1 -1
  16. package/generators/app/templates/latexmkrc +1 -3
  17. package/generators/app/templates/main.de.tex +581 -139
  18. package/generators/app/templates/main.en.tex +11 -17
  19. package/generators/app/templates/microtype.preamble.de.tex +5 -0
  20. package/generators/app/templates/natbib.preamble.en.tex +1 -1
  21. package/generators/app/templates/siunitx.example.en.tex +1 -1
  22. package/generators/app/templates/siunitx.preamble.de.tex +2 -0
  23. package/generators/app/templates/siunitx.preamble.en.tex +0 -1
  24. package/generators/app/templates/subfig.preamble.en.tex +1 -1
  25. package/generators/app/templates/url.preamble.de.tex +2 -0
  26. package/package.json +15 -16
  27. package/generators/app/templates/refcheck.example.en.tex +0 -36
  28. package/generators/app/templates/refcheck.preamble.en.tex +0 -4
@@ -1,638 +1,292 @@
1
- 'use strict';
2
- const Generator = require('yeoman-generator');
3
- const optionOrPrompt = require('yeoman-option-or-prompt');
4
- const chalk = require('chalk');
5
- const yosay = require('yosay');
6
- const fs = require('fs');
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
- // unzipper instead of extract-zip, because we want to excact a subset of the archive
9
- const unzipper = require('unzipper');
8
+ export default class extends Generator {
9
+ _optionOrPrompt = optionOrPrompt;
10
10
 
11
- module.exports = class extends Generator {
12
- prompting() {
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
- var params = {
18
- // alternative libraries: https://stackoverflow.com/a/34782300/873282
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.mapper = mapper;
395
- this.params = params;
17
+ // To access props later use this.props.someAnswer;
18
+ this.props = props;
396
19
 
397
- var prompt;
398
-
399
- if (Object.keys(params.filteredProps).length === 0) {
400
- prompt = new Promise(resolve => {
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
- return prompt.then(props => {
408
- // To access props later use this.props.someAnswer;
409
- this.props = props;
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
- // somehow texlive is not routed through
417
- // special handling
418
- if (this.params.options.texlive) {
419
- this.props.texlive = parseInt(this.params.options.texlive)
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
- // Command line argument "--githubpublish" switches the generator to generate a template deployable on a GitHub repository (causing e.g., a refined README.md)
423
- this.props.githubpublish = this.params.options.githubpublish;
424
- this.props.githubpublish = (this.props.githubpublish === true) || (this.props.githubpublish === 'true')
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
- // 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
427
- this.props.preparereitzig = this.params.options.preparereitzig;
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
- // Ensure all values are set - even if the user was not asked
431
- if ((this.props.documentclass === 'acmart') || (this.props.documentclass === 'ieee')) {
432
- this.props.bibtextool = 'bibtex';
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
- // IEEE class offers "compsoc"
438
- // In 2021 this is not used any more, all papers are the "normal" IEEE format
439
- this.props.ieee_compsoc = false;
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
- // As of 2021-12-24 the IEEE setup does not work on TeXLive 2021 and lualatex (TeXLive 2019 and 2020 work)
442
- if ((this.props.documentclass === 'ieee') && (this.props.texlive == 2021)) {
443
- this.props.latexcompiler = 'pdflatex';
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
- // convert "String" Boolean command line options
447
- this.props.cleveref = (this.props.cleveref === true) || (this.props.cleveref === 'true')
448
- this.props.examples = (this.props.examples === true) || (this.props.examples === 'true')
449
- this.props.howtotext = (this.props.howtotext === true) || (this.props.howtotext === 'true')
450
- this.props.overleaf = (this.props.overleaf === true) || (this.props.overleaf === 'true')
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
- if (this.props.examples) {
453
- this.props.useExampleEnvironment = true;
454
- this.props.bexample = "\\begin{ltgexample}"
455
- this.props.eexample = "\\end{ltgexample}"
456
- } else {
457
- this.props.useExampleEnvironment = false;
458
- this.props.bexample = "";
459
- this.props.eexample = "";
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
- if (this.props.tweak_outerquote == 'outerquote') {
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
- this.props.requiresShellEscape = (this.props.listings === 'minted');
92
+ createFeatures(props);
93
+ isPaperHandling(props);
94
+ createHeadingCommands(props);
95
+ createAvailable(props);
477
96
 
478
- this.props.feature = {};
479
- this.props.feature.acronyms = (this.props.documentclass === 'scientific-thesis');
97
+ function createFeatures(props) {
98
+ props.feature = {};
99
+ props.feature.acronyms = props.documentclass === "scientific-thesis";
100
+ }
480
101
 
481
- this.props.isPaper = (this.props.documentclass === 'acmart') || (this.props.documentclass === 'ieee') || (this.props.documentclass === 'lncs');
482
- if (this.props.isPaper) {
483
- // this sets filenames.main and filenames.bib
484
- this.props.filenames = {
485
- "main": "paper",
486
- "bib": "paper"
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
- this.props.filenames = {
490
- "main": "main",
491
- "bib": "bibliography"
114
+ props.filenames = {
115
+ main: "main",
116
+ bib: "bibliography",
492
117
  };
493
118
  }
119
+ }
494
120
 
495
- if (props.documentclass === 'scientific-thesis') {
496
- this.props.heading1 = '\\chapter';
497
- this.props.heading2 = '\\section';
121
+ function createHeadingCommands(props) {
122
+ if (props.documentclass === "scientific-thesis") {
123
+ props.heading1 = "\\chapter";
124
+ props.heading2 = "\\section";
498
125
  } else {
499
- this.props.heading1 = '\\section';
500
- this.props.heading2 = '\\subsection';
126
+ props.heading1 = "\\section";
127
+ props.heading2 = "\\subsection";
501
128
  }
129
+ }
502
130
 
503
- this.props.available = {};
131
+ function createAvailable(props) {
132
+ props.available = {};
504
133
 
505
- if (props.bibtextool == 'bibtex' && props.documentclass !== 'acmart' && props.documentclass !== 'ieee' && props.documentclass !== 'lncs') {
506
- // acmart uses natbib
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
- this.props.available.citet = false;
142
+ props.available.citet = false;
509
143
  } else {
510
- this.props.available.citet = true;
144
+ props.available.citet = true;
511
145
  }
512
- });
146
+ }
513
147
  }
514
148
 
515
149
  writing() {
516
- let global = this;
517
- global.props.config = global.props;
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
- global.templatePath('dot.gitignore'),
522
- global.destinationPath('.gitignore')
154
+ this.templatePath("dot.gitignore"),
155
+ this.destinationPath(".gitignore")
523
156
  );
524
- global.fs.copyTpl(
525
- global.templatePath('dot.editorconfig'),
526
- global.destinationPath('.editorconfig'),
527
- global.props
157
+ this.fs.copyTpl(
158
+ this.templatePath("dot.editorconfig"),
159
+ this.destinationPath(".editorconfig"),
160
+ this.props
528
161
  );
529
- global.fs.copyTpl(
530
- global.templatePath('bibliography.bib'),
531
- global.destinationPath(global.props.filenames.bib + ".bib"),
532
- global.props
162
+ this.fs.copyTpl(
163
+ this.templatePath("bibliography.bib"),
164
+ this.destinationPath(this.props.filenames.bib + ".bib"),
165
+ this.props
533
166
  );
534
- global.fs.copyTpl(
535
- global.templatePath('latexmkrc'),
536
- global.destinationPath(global.props.overleaf ? '_latexmkrc' : 'latexmkrc'),
537
- global.props
167
+ this.fs.copyTpl(
168
+ this.templatePath("latexmkrc"),
169
+ this.destinationPath(this.props.overleaf ? "_latexmkrc" : "latexmkrc"),
170
+ this.props
538
171
  );
539
- global.fs.copyTpl(
540
- global.templatePath('localSettings.yaml'),
541
- global.destinationPath('localSettings.yaml'),
542
- global.props
172
+ this.fs.copyTpl(
173
+ this.templatePath("localSettings.yaml"),
174
+ this.destinationPath("localSettings.yaml"),
175
+ this.props
543
176
  );
544
- global.fs.copyTpl(
545
- global.templatePath('LICENSE'),
546
- global.destinationPath('LICENSE'),
547
- global.props
177
+ this.fs.copyTpl(
178
+ this.templatePath("LICENSE"),
179
+ this.destinationPath("LICENSE"),
180
+ this.props
548
181
  );
549
- global.fs.copyTpl(
550
- global.templatePath('Makefile'),
551
- global.destinationPath('Makefile'),
552
- global.props
182
+ this.fs.copyTpl(
183
+ this.templatePath("Makefile"),
184
+ this.destinationPath("Makefile"),
185
+ this.props
553
186
  );
554
- if (global.props.documentclass === 'lncs') {
555
- global.fs.copy(
556
- global.templatePath('splncs04nat.bst'),
557
- global.destinationPath('splncs04nat.bst')
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
- if (global.props.language === 'de') {
561
- global.fs.copyTpl(
562
- global.templatePath('main.de.tex'),
563
- global.destinationPath(global.props.filenames.main + ".tex"),
564
- global.props
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 (global.props.documentclass === 'scientific-thesis') {
567
- global.fs.copy(
568
- global.templatePath('acronyms.de.tex'),
569
- global.destinationPath('acronyms.tex')
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
- if (!global.props.githubpublish) {
573
- // we keep the English README.md in case of GitHub publish
574
- global.fs.copyTpl(
575
- global.templatePath('README.de.md'),
576
- global.destinationPath('README.md'),
577
- global.props
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
- global.fs.copyTpl(
582
- global.templatePath('main.en.tex'),
583
- global.destinationPath(global.props.filenames.main + ".tex"),
584
- global.props
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 (global.props.documentclass === 'scientific-thesis') {
587
- global.fs.copy(
588
- global.templatePath('acronyms.en.tex'),
589
- global.destinationPath('acronyms.tex')
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
- global.fs.copyTpl(
593
- global.templatePath('README.en.md'),
594
- global.destinationPath('README.md'),
595
- global.props
227
+
228
+ this.fs.copyTpl(
229
+ this.templatePath("README.en.md"),
230
+ this.destinationPath("README.md"),
231
+ this.props
596
232
  );
597
233
  }
598
- switch (global.props.docker) {
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
- global.fs.copy(
601
- global.templatePath('dot.dockerignore'),
602
- global.destinationPath('.dockerignore')
254
+ this.fs.copy(
255
+ this.templatePath("dot.dockerignore"),
256
+ this.destinationPath(".dockerignore")
603
257
  );
604
- global.fs.copyTpl(
605
- global.templatePath('Dockerfile.reitzig'),
606
- global.destinationPath('Dockerfile'),
607
- global.props
258
+ this.fs.copyTpl(
259
+ this.templatePath("Dockerfile.reitzig"),
260
+ this.destinationPath("Dockerfile"),
261
+ this.props
608
262
  );
609
- global.fs.copyTpl(
610
- global.templatePath('Texlivefile'),
611
- global.destinationPath('Texlivefile'),
612
- global.props
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
- global.fs.copy(
617
- global.templatePath('dot.dockerignore'),
618
- global.destinationPath('.dockerignore')
270
+ this.fs.copy(
271
+ this.templatePath("dot.dockerignore"),
272
+ this.destinationPath(".dockerignore")
619
273
  );
620
- global.fs.copyTpl(
621
- global.templatePath('Dockerfile.dante'),
622
- global.destinationPath('Dockerfile'),
623
- global.props
274
+ this.fs.copyTpl(
275
+ this.templatePath("Dockerfile.dante"),
276
+ this.destinationPath("Dockerfile"),
277
+ this.props
624
278
  );
625
279
  break;
626
280
  }
627
- if (global.props.docker) {
628
- global.fs.copyTpl(
629
- global.templatePath('.github/workflows/check.yml'),
630
- global.destinationPath('.github/workflows/check.yml'),
631
- global.props
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
+ }