generator-latex-template 0.1.1 → 0.4.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 (75) hide show
  1. package/LICENSE +11 -18
  2. package/README.md +103 -36
  3. package/generators/app/index.js +529 -41
  4. package/generators/app/templates/Dockerfile.dante +9 -0
  5. package/generators/app/templates/Dockerfile.reitzig +25 -0
  6. package/generators/app/templates/LICENSE +14 -0
  7. package/generators/app/templates/Makefile +18 -0
  8. package/generators/app/templates/README.de.md +3 -3
  9. package/generators/app/templates/README.en.md +377 -10
  10. package/generators/app/templates/Texlivefile +98 -0
  11. package/generators/app/templates/babel.preamble.de.tex +30 -0
  12. package/generators/app/templates/{babel.preamble.tex → babel.preamble.en.tex} +5 -9
  13. package/generators/app/templates/bibliography.bib +48 -0
  14. package/generators/app/templates/booktabs.preamble.en.tex +2 -0
  15. package/generators/app/templates/cleveref.example.en.tex +33 -0
  16. package/generators/app/templates/{cleveref.de.preamble.tex → cleveref.preamble.de.tex} +14 -4
  17. package/generators/app/templates/cleveref.preamble.en.tex +21 -0
  18. package/generators/app/templates/csquotes.example.de.tex +14 -0
  19. package/generators/app/templates/csquotes.example.en.tex +11 -0
  20. package/generators/app/templates/csquotes.preamble.en.tex +12 -0
  21. package/generators/app/templates/diagbox.example.en.tex +16 -0
  22. package/generators/app/templates/diagbox.preamble.en.tex +3 -0
  23. package/generators/app/templates/dot.dockerignore +429 -0
  24. package/generators/app/templates/dot.editorconfig +8 -0
  25. package/generators/app/templates/{.gitignore → dot.gitignore} +0 -0
  26. package/generators/app/templates/figure.example.de.tex +17 -0
  27. package/generators/app/templates/figure.example.en.tex +35 -0
  28. package/generators/app/templates/floatflt.example.en.tex +13 -0
  29. package/generators/app/templates/floatflt.preamble.en.tex +2 -0
  30. package/generators/app/templates/font.preamble.en.tex +138 -0
  31. package/generators/app/templates/hyperref.preamble.de.tex +21 -0
  32. package/generators/app/templates/hyperref.preamble.en.tex +14 -0
  33. package/generators/app/templates/hyphenation.example.en.tex +22 -0
  34. package/generators/app/templates/{.latexmkrc → latexmkrc} +31 -31
  35. package/generators/app/templates/listings.example.de.tex +81 -0
  36. package/generators/app/templates/listings.example.en.tex +64 -0
  37. package/generators/app/templates/listings.preamble.de.tex +101 -0
  38. package/generators/app/templates/listings.preamble.en.tex +104 -0
  39. package/generators/app/templates/localSettings.yaml +28 -0
  40. package/generators/app/templates/main.de.tex +324 -24
  41. package/generators/app/templates/main.en.tex +791 -29
  42. package/generators/app/templates/{microtype.de.preamble.tex → microtype.preamble.de.tex} +0 -0
  43. package/generators/app/templates/{microtype.en.preamble.tex → microtype.preamble.en.tex} +5 -0
  44. package/generators/app/templates/mindflow.example.en.tex +9 -0
  45. package/generators/app/templates/mindflow.preamble.en.tex +5 -0
  46. package/generators/app/templates/minted.example.en.tex +50 -0
  47. package/generators/app/templates/minted.preamble.en.tex +28 -0
  48. package/generators/app/templates/natbib.preamble.en.tex +46 -0
  49. package/generators/app/templates/otherfeatures.example.en.tex +17 -0
  50. package/generators/app/templates/paragraphs.example.de.tex +25 -0
  51. package/generators/app/templates/paragraphs.example.en.tex +21 -0
  52. package/generators/app/templates/paralist.example.en.tex +51 -0
  53. package/generators/app/templates/paralist.preamble.en.tex +2 -0
  54. package/generators/app/templates/pdfcomment.preamble.en.tex +11 -0
  55. package/generators/app/templates/plainlatex.enquotes.example.de.tex +6 -0
  56. package/generators/app/templates/plainlatex.enquotes.example.en.tex +5 -0
  57. package/generators/app/templates/plainlatextodo.preamble.en.tex +8 -0
  58. package/generators/app/templates/powerset.preamble.en.tex +13 -0
  59. package/generators/app/templates/siunitx.example.en.tex +16 -0
  60. package/generators/app/templates/siunitx.preamble.en.tex +2 -0
  61. package/generators/app/templates/splncsnat.bst +1508 -0
  62. package/generators/app/templates/subfig.preamble.en.tex +5 -0
  63. package/generators/app/templates/subfloat.example.en.tex +40 -0
  64. package/generators/app/templates/tables.example.en.tex +23 -0
  65. package/generators/app/templates/textcmds.example.en.tex +5 -0
  66. package/generators/app/templates/textcmds.preamble.en.tex +2 -0
  67. package/generators/app/templates/{url.de.preamble.tex → url.preamble.de.tex} +0 -0
  68. package/generators/app/templates/{url.en.preamble.tex → url.preamble.en.tex} +12 -3
  69. package/package.json +19 -15
  70. package/CHANGELOG.md +0 -20
  71. package/generators/app/templates/cleveref.en.preamble.tex +0 -5
  72. package/generators/app/templates/figure.de.example.tex +0 -14
  73. package/generators/app/templates/figure.en.example.tex +0 -14
  74. package/generators/app/templates/font.en.preamble.tex +0 -26
  75. package/generators/app/templates/hyperref.en.preamble.tex +0 -26
@@ -1,7 +1,12 @@
1
1
  'use strict';
2
2
  const Generator = require('yeoman-generator');
3
+ const optionOrPrompt = require('yeoman-option-or-prompt');
3
4
  const chalk = require('chalk');
4
5
  const yosay = require('yosay');
6
+ const fs = require('fs');
7
+
8
+ // unzipper instead of extract-zip, because we want to excact a subset of the archive
9
+ const unzipper = require('unzipper');
5
10
 
6
11
  module.exports = class extends Generator {
7
12
  prompting() {
@@ -9,98 +14,581 @@ module.exports = class extends Generator {
9
14
  yosay(`Welcome to the ${chalk.red('latex-template')} generator!`)
10
15
  );
11
16
 
12
- const prompts = [
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, [
13
39
  {
14
40
  type: 'list',
15
41
  name: 'documentclass',
16
42
  message: 'Which template should be generated?',
17
- choices: ["scientific-thesis", "lncs", "ieee"],
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
+ ],
18
61
  default: "scientific-thesis"
19
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: 'texlive',
152
+ message: 'Which TeXLive compatiblity?',
153
+ choices: [
154
+ {
155
+ name: "TeXLive 2021",
156
+ value: 2021
157
+ }
158
+ ],
159
+ default: 2021
160
+ },
20
161
  {
21
162
  type: 'list',
22
163
  name: 'latexcompiler',
23
164
  message: 'Which latex compiler should be used?',
24
165
  choices: ["pdflatex", "lualatex"],
25
- default: "pdflatex"
166
+ default: "pdflatex",
167
+ when: function(response) {
168
+ return !((response.documentclass === 'ieee') && (response.texlive == 2021));
169
+ }
26
170
  },
27
171
  {
172
+ when: function(response) {
173
+ return ((response.documentclass !== 'acmart') && (response.documentclass !== 'ieee'));
174
+ },
28
175
  type: 'list',
29
176
  name: 'bibtextool',
30
177
  message: 'Which BibTeX tool should be used?',
31
- choices: ["bibtex", "biblatex"],
32
- default: "biblatex"
178
+ choices: [
179
+ {
180
+ name: "BibTeX",
181
+ value: "bibtex"
182
+ },
183
+ {
184
+ name: "BibLaTeX + biber",
185
+ value: "biblatex"
186
+ }
187
+ ],
188
+ default: function(response) {
189
+ switch (response.documentclass) {
190
+ case 'acmart':
191
+ case 'ieee':
192
+ case 'lncs':
193
+ return 'bibtex'
194
+ default:
195
+ return 'biblatex'
196
+ }
197
+ },
198
+ },
199
+ {
200
+ type: 'list',
201
+ name: 'docker',
202
+ message: 'Should a Dockerfile be generated?',
203
+ choices: [
204
+ {
205
+ name: "no",
206
+ value: false
207
+ },
208
+ {
209
+ name: "yes (Reiztig)",
210
+ value: "reitzig"
211
+ },
212
+ {
213
+ name: "yes (DANTE e.V.)",
214
+ value: "dante"
215
+ }
216
+ ],
217
+ default: false,
33
218
  },
34
219
  {
35
220
  type: 'list',
36
221
  name: 'language',
222
+ when: function(response) {
223
+ return ((response.documentclass !== 'acmart') && (response.documentclass !== 'ieee'));
224
+ },
37
225
  message: 'Which language should the document be?',
38
- choices: ["english", "german"],
39
- default: "english"
226
+ choices: [
227
+ {
228
+ name: "English",
229
+ value: "en"
230
+ },
231
+ {
232
+ name: "German",
233
+ value: "de"
234
+ }
235
+ ],
236
+ default: "en"
40
237
  },
41
238
  {
42
239
  type: 'list',
43
240
  name: 'font',
44
241
  message: 'Which font should be used?',
45
- choices: ["arial", "times", "latex default"],
46
- default: "latex default"
242
+ choices: function(state) {
243
+ var res = [];
244
+ if (state.documentclass === "acmart") {
245
+ res.push({
246
+ name: "ACM Default",
247
+ value: "default"
248
+ })
249
+ } else if (state.documentclass === "ieee") {
250
+ res.push({
251
+ name: "IEEE Default",
252
+ value: "default"
253
+ })
254
+ } else {
255
+ res.push({
256
+ name: "Computer Modern (Default LaTeX font)",
257
+ value: "default"
258
+ })
259
+ if (state.documentclass === "scientific-thesis") {
260
+ res.push({
261
+ name: "Arial",
262
+ value: "arial"
263
+ })
264
+ }
265
+ res.push({
266
+ name: "Times New Roman",
267
+ value: "times"
268
+ });
269
+ }
270
+ return res;
271
+ },
272
+ default: "default",
273
+ when: function(response) {
274
+ return response.documentclass !== 'ieee';
275
+ }
276
+ },
277
+ {
278
+ type: 'list',
279
+ name: 'listings',
280
+ message: 'Which package to typeset listings?',
281
+ choices: [
282
+ {
283
+ name: "listings",
284
+ value: "listings"
285
+ },
286
+ {
287
+ name: "minted (requires a working Python installation)",
288
+ value: "minted"
289
+ }
290
+ ],
291
+ default: "listings"
47
292
  },
48
293
  {
49
294
  type: 'confirm',
50
295
  name: 'cleveref',
51
296
  message: 'Use cleveref?',
52
297
  default: true
298
+ },
299
+ {
300
+ type: 'list',
301
+ name: 'enquotes',
302
+ message: 'Which package to use to "enquote" text?',
303
+ choices: function(state) {
304
+ var res = [];
305
+ res.push({
306
+ name: "csquotes (\\enquote{...} command)",
307
+ value: "csquotes"
308
+ });
309
+ if (state.language === "en") {
310
+ res.push({
311
+ name: "textcmds (\\qq{...} command)",
312
+ value: "textcmds"
313
+ })
314
+ }
315
+ if (state.language === "de") {
316
+ res.push({
317
+ name: "Plain LaTeX (\\glqq{}text\\grqq{} - not recommended)",
318
+ value: "plainlatex"
319
+ });
320
+ } else {
321
+ res.push({
322
+ name: "Plain LaTeX (``text'' - not recommended)",
323
+ value: "plainlatex"
324
+ })
325
+ };
326
+ return res;
327
+ },
328
+ default: "csquotes"
329
+ },
330
+ {
331
+ type: 'list',
332
+ name: 'tweak_outerquote',
333
+ 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)?',
334
+ choices: [
335
+ {
336
+ name: "Hyphenation tweak",
337
+ value: "babel"
338
+ },
339
+ {
340
+ name: "Easy quotation",
341
+ value: "outerquote"
342
+ }
343
+ ],
344
+ default: "babel"
345
+ },
346
+ {
347
+ type: 'list',
348
+ name: 'todo',
349
+ message: 'Which package to mark TODOs?',
350
+ choices: [
351
+ {
352
+ name: "pdfcomment",
353
+ value: "pdfcomment"
354
+ },/*
355
+ {
356
+ name: "Plain LaTeX (simple \\commentontext and \\commentatside are defined)",
357
+ value: "plainlatex"
358
+ },*/
359
+ {
360
+ name: "None (no support)",
361
+ value: "none"
362
+ }
363
+ ],
364
+ default: "pdfcomment"
365
+ },
366
+ {
367
+ type: 'confirm',
368
+ name: 'howtotext',
369
+ message: 'Include hints on text (e.g., how to write an abstract)?',
370
+ default: true
371
+ },
372
+ {
373
+ type: 'confirm',
374
+ name: 'examples',
375
+ message: 'Include minimal LaTeX examples?',
376
+ default: true
53
377
  }
54
- ];
378
+ ]);
379
+
380
+ this.mapper = mapper;
381
+ this.params = params;
382
+
383
+ var prompt;
384
+
385
+ if (Object.keys(params.filteredProps).length === 0) {
386
+ prompt = new Promise(resolve => {
387
+ resolve(this.params.options)
388
+ })
389
+ } else {
390
+ prompt = this.prompt(params.filteredProps).then(props => this.mapper(props));
391
+ }
55
392
 
56
- return this.prompt(prompts).then(props => {
393
+ return prompt.then(props => {
57
394
  // To access props later use this.props.someAnswer;
58
395
  this.props = props;
396
+
397
+ // somehow texlive is not routed through
398
+ // special handling
399
+ if (this.params.options.texlive) {
400
+ this.props.texlive = parseInt(this.params.options.texlive)
401
+ }
402
+
403
+ // Command line argument "--githubpublish" switches the generator to generate a template deployable on a GitHub repository (causing e.g., a refined README.md)
404
+ this.props.githubpublish = this.params.options.githubpublish;
405
+ this.props.githubpublish = (this.props.githubpublish === true) || (this.props.githubpublish === 'true')
406
+
407
+ // 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
408
+ this.props.preparereitzig = this.params.options.preparereitzig;
409
+ this.props.preparereitzig = (this.props.preparereitzig === true) || (this.props.preparereitzig === 'true')
410
+
411
+ // Ensure all values are set - even if the user was not asked
412
+ if ((this.props.documentclass === 'acmart') || (this.props.documentclass === 'ieee')) {
413
+ this.props.bibtextool = 'bibtex';
414
+ this.props.font = 'default';
415
+ this.props.language = 'en';
416
+ }
417
+
418
+ // IEEE class offers "compsoc"
419
+ // In 2021 this is not used any more, all papers are the "normal" IEEE format
420
+ this.props.ieee_compsoc = false;
421
+
422
+ // As of 2021-12-24 the IEEE setup does not work on TeXLive 2021 and lualatex (TeXLive 2019 and 2020 work)
423
+ if ((this.props.documentclass === 'ieee') && (this.props.texlive == 2021)) {
424
+ this.props.latexcompiler = 'pdflatex';
425
+ }
426
+
427
+ // convert "String" Boolean command line options
428
+ this.props.cleveref = (this.props.cleveref === true) || (this.props.cleveref === 'true')
429
+ this.props.examples = (this.props.examples === true) || (this.props.examples === 'true')
430
+ this.props.howtotext = (this.props.howtotext === true) || (this.props.howtotext === 'true')
431
+
432
+ if (this.props.examples) {
433
+ this.props.useExampleEnvironment = true;
434
+ this.props.bexample = "\\begin{ltgexample}"
435
+ this.props.eexample = "\\end{ltgexample}"
436
+ } else {
437
+ this.props.useExampleEnvironment = false;
438
+ this.props.bexample = "";
439
+ this.props.eexample = "";
440
+ }
441
+
442
+ if (this.props.tweak_outerquote == 'outerquote') {
443
+ this.props.bquote = "\"";
444
+ this.props.equote = "\"";
445
+ } else if (this.props.enquotes == 'csquotes') {
446
+ this.props.bquote = "\\enquote{";
447
+ this.props.equote = "}";
448
+ } else if (this.props.enquotes == 'textcmds') {
449
+ this.props.bquote = "\\qq{";
450
+ this.props.equote = "}";
451
+ } else {
452
+ this.props.bquote = "\"`";
453
+ this.props.equote = "\"'";
454
+ }
455
+
456
+ this.props.requiresShellEscape = (this.props.listings === 'minted');
457
+
458
+ this.props.isPaper = (this.props.documentclass === 'acmart') || (this.props.documentclass === 'ieee') || (this.props.documentclass === 'lncs');
459
+ if (this.props.isPaper) {
460
+ // this sets filenames.main and filenames.bib
461
+ this.props.filenames = {
462
+ "main": "paper",
463
+ "bib": "paper"
464
+ };
465
+ } else {
466
+ this.props.filenames = {
467
+ "main": "main",
468
+ "bib": "bibliography"
469
+ };
470
+ }
471
+
59
472
  if (props.documentclass === 'scientific-thesis') {
60
- this.props.heading1 = 'chapter';
61
- this.props.heading2 = 'section';
473
+ this.props.heading1 = '\\chapter';
474
+ this.props.heading2 = '\\section';
475
+ } else {
476
+ this.props.heading1 = '\\section';
477
+ this.props.heading2 = '\\subsection';
478
+ }
479
+
480
+ this.props.available = {};
481
+
482
+ if (props.bibtextool == 'bibtex' && props.documentclass !== 'acmart' && props.documentclass !== 'ieee' && props.documentclass !== 'lncs') {
483
+ // acmart uses natbib
484
+ // in lncs, we patched-in natbib
485
+ this.props.available.citet = false;
62
486
  } else {
63
- this.props.heading1 = 'section';
64
- this.props.heading2 = 'subsection';
487
+ this.props.available.citet = true;
65
488
  }
66
- this.props.lang = props.language === 'german' ? 'de' : 'en';
67
- this.props.requiresShellEscape = false;
68
489
  });
69
490
  }
70
491
 
71
492
  writing() {
72
- this.fs.copy(
73
- this.templatePath('.gitignore'),
74
- this.destinationPath('.gitignore')
493
+ let global = this;
494
+ global.props.config = global.props;
495
+ global.fs.copy(
496
+ // .gitignore is not uploaded by npm publish
497
+ // Thus, we prefix it with `dot`.
498
+ global.templatePath('dot.gitignore'),
499
+ global.destinationPath('.gitignore')
500
+ );
501
+ global.fs.copyTpl(
502
+ global.templatePath('dot.editorconfig'),
503
+ global.destinationPath('.editorconfig'),
504
+ global.props
505
+ );
506
+ global.fs.copyTpl(
507
+ global.templatePath('bibliography.bib'),
508
+ global.destinationPath(global.props.filenames.bib + ".bib"),
509
+ global.props
510
+ );
511
+ global.fs.copyTpl(
512
+ global.templatePath('latexmkrc'),
513
+ global.destinationPath('latexmkrc'),
514
+ global.props
75
515
  );
76
- this.fs.copyTpl(
77
- this.templatePath('.latexmkrc'),
78
- this.destinationPath('.latexmkrc'),
79
- this.props
516
+ global.fs.copyTpl(
517
+ global.templatePath('localSettings.yaml'),
518
+ global.destinationPath('localSettings.yaml'),
519
+ global.props
80
520
  );
81
- if (this.props.lang === 'de') {
82
- this.fs.copyTpl(
83
- this.templatePath('main.de.tex'),
84
- this.destinationPath('main.tex'),
85
- this.props
521
+ global.fs.copyTpl(
522
+ global.templatePath('LICENSE'),
523
+ global.destinationPath('LICENSE'),
524
+ global.props
525
+ );
526
+ global.fs.copyTpl(
527
+ global.templatePath('Makefile'),
528
+ global.destinationPath('Makefile'),
529
+ global.props
530
+ );
531
+ if (global.props.documentclass === 'lncs') {
532
+ global.fs.copy(
533
+ global.templatePath('splncsnat.bst'),
534
+ global.destinationPath('splncsnat.bst')
86
535
  );
87
- this.fs.copyTpl(
88
- this.templatePath('README.de.md'),
89
- this.destinationPath('README.md'),
90
- this.props
536
+ }
537
+ if (global.props.language === 'de') {
538
+ global.fs.copyTpl(
539
+ global.templatePath('main.de.tex'),
540
+ global.destinationPath(global.props.filenames.main + ".tex"),
541
+ global.props
91
542
  );
543
+ if (!global.props.githubpublish) {
544
+ // we keep the English README.md in case of GitHub publish
545
+ global.fs.copyTpl(
546
+ global.templatePath('README.de.md'),
547
+ global.destinationPath('README.md'),
548
+ global.props
549
+ );
550
+ }
92
551
  } else {
93
- this.fs.copyTpl(
94
- this.templatePath('main.en.tex'),
95
- this.destinationPath('main.tex'),
96
- this.props
552
+ global.fs.copyTpl(
553
+ global.templatePath('main.en.tex'),
554
+ global.destinationPath(global.props.filenames.main + ".tex"),
555
+ global.props
97
556
  );
98
- this.fs.copyTpl(
99
- this.templatePath('README.en.md'),
100
- this.destinationPath('README.md'),
101
- this.props
557
+ global.fs.copyTpl(
558
+ global.templatePath('README.en.md'),
559
+ global.destinationPath('README.md'),
560
+ global.props
102
561
  );
103
562
  }
563
+ switch (global.props.docker) {
564
+ case "reitzig":
565
+ global.fs.copy(
566
+ global.templatePath('dot.dockerignore'),
567
+ global.destinationPath('.dockerignore')
568
+ );
569
+ global.fs.copyTpl(
570
+ global.templatePath('Dockerfile.reitzig'),
571
+ global.destinationPath('Dockerfile'),
572
+ global.props
573
+ );
574
+ global.fs.copyTpl(
575
+ global.templatePath('Texlivefile'),
576
+ global.destinationPath('Texlivefile'),
577
+ global.props
578
+ );
579
+ break;
580
+ case "dante":
581
+ global.fs.copy(
582
+ global.templatePath('dot.dockerignore'),
583
+ global.destinationPath('.dockerignore')
584
+ );
585
+ global.fs.copyTpl(
586
+ global.templatePath('Dockerfile.dante'),
587
+ global.destinationPath('Dockerfile'),
588
+ global.props
589
+ );
590
+ break;
591
+ }
104
592
  }
105
593
 
106
594
  install() {
@@ -0,0 +1,9 @@
1
+ FROM danteev/texlive:<% switch (texlive) {
2
+ case 2021: %>edge<% break;
3
+ } -%>
4
+
5
+ WORKDIR /workdir
6
+
7
+ COPY . /workdir
8
+
9
+ RUN latexmk <%= filenames.main %>
@@ -0,0 +1,25 @@
1
+ FROM reitzig/texlive-<% switch (latexcompiler) {
2
+ case "pdflatex": %>base<% break;
3
+ case "lualatex": %>base-luatex<% break;
4
+ default: %>base<% break;
5
+ } -%>:<% switch (texlive) {
6
+ case 2021: %>2021.5<% break;
7
+ } -%>
8
+
9
+ RUN apk update && apk add --no-cache bash perl python3 py3-pip
10
+ RUN pip3 install pygments
11
+
12
+ COPY Texlivefile /work/src
13
+
14
+ # Emulate "Install dependencies" of "entrypoint work ..."
15
+ <% if (texlive < 2021) { -%>
16
+ RUN xargs tlmgr install --repository ftp://ftp.math.utah.edu/pub/tex/historic/systems/texlive/<%= texlive %>/tlnet-final < "/work/src/Texlivefile" && \
17
+ <% } else { -%>
18
+ RUN tlmgr update --self --repository https://mirror.mwt.me/ctan/systems/texlive/tlnet && \
19
+ xargs tlmgr install --repository https://mirror.mwt.me/ctan/systems/texlive/tlnet < "/work/src/Texlivefile" && \
20
+ <% } -%>
21
+ sha256sum "/work/src/Texlivefile" > "/work/tmp/Texlivefile.sha"
22
+
23
+ # make latexmk and texlogsieve available
24
+ RUN cp /usr/local/texlive/<%= texlive %>/bin/x86_64-linuxmusl/latexmk /usr/local/bin && \
25
+ cp /usr/local/texlive/<%= texlive %>/bin/x86_64-linuxmusl/texlogsieve /usr/local/bin
@@ -0,0 +1,14 @@
1
+ BSD Zero Clause License
2
+
3
+ Copyright (c) [year] [fullname]
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.