generator-latex-template 0.2.0 → 0.5.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 (43) hide show
  1. package/README.md +24 -9
  2. package/generators/app/index.js +198 -106
  3. package/generators/app/templates/Dockerfile.dante +9 -0
  4. package/generators/app/templates/Dockerfile.reitzig +35 -0
  5. package/generators/app/templates/Makefile +0 -13
  6. package/generators/app/templates/README.en.md +68 -27
  7. package/generators/app/templates/Texlivefile +128 -0
  8. package/generators/app/templates/acronyms.de.tex +6 -0
  9. package/generators/app/templates/acronyms.en.tex +5 -0
  10. package/generators/app/templates/acronyms.example.de.tex +24 -0
  11. package/generators/app/templates/acronyms.example.en.tex +24 -0
  12. package/generators/app/templates/acronyms.preamble.en.tex +15 -0
  13. package/generators/app/templates/biblatex.preamble.de.tex +9 -0
  14. package/generators/app/templates/biblatex.preamble.en.tex +61 -0
  15. package/generators/app/templates/bibliography.bib +11 -0
  16. package/generators/app/templates/cleveref.example.en.tex +1 -1
  17. package/generators/app/templates/diagbox.example.en.tex +1 -1
  18. package/generators/app/templates/dot.dockerignore +429 -0
  19. package/generators/app/templates/figure.example.en.tex +5 -5
  20. package/generators/app/templates/font.preamble.en.tex +9 -6
  21. package/generators/app/templates/{dot.latexmkrc → latexmkrc} +11 -9
  22. package/generators/app/templates/main.de.tex +135 -11
  23. package/generators/app/templates/main.en.tex +244 -87
  24. package/generators/app/templates/microtype.preamble.en.tex +5 -0
  25. package/generators/app/templates/mindflow.example.en.tex +9 -0
  26. package/generators/app/templates/mindflow.preamble.en.tex +5 -0
  27. package/generators/app/templates/natbib.preamble.en.tex +1 -1
  28. package/generators/app/templates/scientific-thesis-cover.preamble.de.tex +12 -0
  29. package/generators/app/templates/scientific-thesis-cover.preamble.en.tex +12 -0
  30. package/generators/app/templates/siunitx.preamble.en.tex +0 -5
  31. package/generators/app/templates/subfloat.example.en.tex +4 -4
  32. package/generators/app/templates/url.preamble.en.tex +2 -0
  33. package/package.json +12 -12
  34. package/CHANGELOG.md +0 -58
  35. package/generators/app/templates/bibliography.bib.bak +0 -37
  36. package/generators/app/templates/main.de.pdf +0 -0
  37. package/generators/app/templates/main.de.synctex.gz +0 -0
  38. package/generators/app/templates/main.en.aux +0 -3
  39. package/generators/app/templates/main.en.fdb_latexmk +0 -38
  40. package/generators/app/templates/main.en.fls +0 -52
  41. package/generators/app/templates/main.en.log +0 -251
  42. package/generators/app/templates/main.en.pdf +0 -0
  43. package/generators/app/templates/main.en.synctex.gz +0 -0
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # generator-latex-template ![Tests](https://github.com/latextemplates/generator-latex-template/workflows/Tests/badge.svg) [![npm version](http://img.shields.io/npm/v/generator-latex-template.svg?style=flat)](https://npmjs.org/package/generator-latex-template "View this project on npm")
1
+ # LaTeX Template Generator [![npm version](http://img.shields.io/npm/v/generator-latex-template.svg?style=flat)](https://npmjs.org/package/generator-latex-template "View this project on npm")
2
2
 
3
3
  > Generates latextemplates (e.g., for thesis, workshops, conferences, IEEEtran, LNCS, ...) out of "micro-templates"
4
4
 
5
- See the **[Talk about the generator](https://github.com/dante-ev/Vortraege_Tagungen/blob/master/2019-Herbst/Oliver%20Kopp%20-%20The%20LaTeX%20Template%20Generator%20-%20dante2019-herbst.pdf)** for an overview on the aims and the general concept.
5
+ See the **[talk about the generator](https://github.com/dante-ev/Vortraege_Tagungen/blob/master/2019-Herbst/Oliver%20Kopp%20-%20The%20LaTeX%20Template%20Generator%20-%20dante2019-herbst.pdf)** for an overview on the aims and the general concept.
6
6
 
7
7
  ## Background information
8
8
 
@@ -19,7 +19,7 @@ The aim of the repository is to provide for each common latex package
19
19
 
20
20
  and a generation into templates:
21
21
 
22
- 1. Support for LNCS, IEEE, KOMA-Script
22
+ 1. Support for [ACM](https://ctan.org/pkg/acmart), [IEEE](https://ctan.org/pkg/ieeetran), LNCS, [KOMA-Script](https://ctan.org/pkg/koma-script)
23
23
  2. Support for separate documents which require `--shell-escape` and not.
24
24
  3. Support for integrated pdflatex and lualatex documents
25
25
 
@@ -78,9 +78,9 @@ You can use the magic of `git` to prevent that:
78
78
 
79
79
  ## Resources
80
80
 
81
- - [IEEE](https://latextemplates.github.io/IEEE/) - example: [paper-conference-minted.tex](https://github.com/latextemplates/IEEE/blob/master/paper-conference-minted.tex)
82
- - [LNCS](https://latextemplates.github.io/LNCS/) - example: [paper.tex](https://github.com/latextemplates/LNCS/blob/master/paper.tex)
83
- - [scientific-thesis-template](https://latextemplates.github.io/scientific-thesis-template/) - example: [latexhints-english.tex](https://github.com/latextemplates/scientific-thesis-template/blob/master/latexhints-english.tex)
81
+ - [IEEE](https://latextemplates.github.io/IEEE/) - example: [paper-conference-minted.tex](https://github.com/latextemplates/IEEE/blob/main/paper-conference-minted.tex)
82
+ - [LNCS](https://latextemplates.github.io/LNCS/) - example: [paper.tex](https://github.com/latextemplates/LNCS/blob/main/paper.tex)
83
+ - [scientific-thesis-template](https://latextemplates.github.io/scientific-thesis-template/) - example: [latexhints-english.tex](https://github.com/latextemplates/scientific-thesis-template/blob/main/latexhints-english.tex)
84
84
  - [alpenwasser/TeX](https://github.com/alpenwasser/TeX)
85
85
 
86
86
  ## Development roadmap
@@ -108,11 +108,26 @@ In the long run, the contents of the `paper.tex` (and similar) files in reposito
108
108
  - Run `npx yo <path-to-git-repository>`
109
109
  - Windows: `npx yo c:\git-repositories\latextemplates\generator-latex-template`
110
110
  - Parameters can be set using command line
111
- - Windows: `npx yo c:\git-repositories\latextemplates\generator-latex-template --texlive=tl2020 --documentclass=scientific-thesis --latexcompiler=lualatex --bibtextool=biblatex --language=en --font=arial --listings=listings --cleveref=true --enquotes=csquotes --tweak_outerquote=babel --todo=pdfcomment --examples=true`
112
- - Windows automatic generation of a LNCS template (with lualatex and bibtex): `npx yo c:\git-repositories\latextemplates\generator-latex-template --documentclass=lncs --latexcompiler=lualatex --bibtextool=bibtex --texlive=tl2020 --language=en --font=default --listings=listings --cleveref=true --enquotes=csquotes --tweak_outerquote=babel --todo=pdfcomment --examples=true`
111
+ - Linux: `npx yo /tmp/repo --documentclass=lncs --texlive=2021 --latexcompiler=pdflatex --bibtextool=bibtex --docker=false --language=en --font=default --listings=listings --cleveref=true --enquotes=csquotes --tweak_outerquote=babel --todo=pdfcomment --howtotext=true --examples=true`
112
+ - Windows: `npx yo c:\git-repositories\latextemplates\generator-latex-template --documentclass=scientific-thesis --texlive=2021 --latexcompiler=pdflatex --bibtextool=bibtex --docker=false --language=en --font=default --listings=listings --cleveref=true --enquotes=csquotes --tweak_outerquote=babel --todo=pdfcomment --howtotext=true --examples=true`
113
+ - Windows automatic generation of a LNCS template (with pdflatex and bibtex): `npx yo c:\git-repositories\latextemplates\generator-latex-template --documentclass=lncs --texlive=2021 --latexcompiler=pdflatex --bibtextool=bibtex --docker=false --language=en --font=default --listings=listings --cleveref=true --enquotes=csquotes --tweak_outerquote=babel --todo=pdfcomment --howtotext=true --examples=true`
113
114
  - Run `latexmk` to build the PDF
114
- - Update npm dependencies: `npx npm-update-all`. See [FreeCodeCamp](https://www.freecodecamp.org/news/10-npm-tricks-that-will-make-you-a-pro-a945982afb25/) for more details.
115
+ - Update npm dependencies
116
+ - `npx npm-update-all`. See [FreeCodeCamp](https://www.freecodecamp.org/news/10-npm-tricks-that-will-make-you-a-pro-a945982afb25/) for more details.
117
+ - `npx npm-check-updates -u`. [[Source](https://www.carlrippon.com/upgrading-npm-dependencies/)]
115
118
  - See <https://github.com/yeoman/generator/releases> for changes in the generator.
119
+ - When one encounters `Cannot find module 'yeoman-generator'`, please update the npm dependencies.
120
+ That error ocurred when using version `4.13.0` and `5.4.2` was available.
121
+ - In case of the error "Error: EACCES, permission denied '/root/.config/configstore/insight-yo.json'", one needs to execute `chmod g+rwx /root /root/.config /root/.config/configstore`
122
+ - Check GitHub actions
123
+ - Use [actionlint](https://github.com/rhysd/actionlint#readme)
124
+ - Use [vs.code GitHub actions plugin](https://marketplace.visualstudio.com/items?itemName=cschleiden.vscode-github-actions)
125
+ - When adding a new package:
126
+ 1. execute `npx` with `--generatereitzig`
127
+ 2. run `pdflatex`
128
+ 3. run `.../generate-texlivefile.sh`
129
+ 4. copy `Texlivefile` to the root of the source repository
130
+ 5. adapt `Texlivefile` as required
116
131
 
117
132
  ### Useful snippets
118
133
 
@@ -46,16 +46,64 @@ module.exports = class extends Generator {
46
46
  value: "scientific-thesis"
47
47
  },
48
48
  {
49
- name: "Springer's Lecture Notes in Computer Science (LNCS)",
50
- value: "lncs"
49
+ name: "Association for Computing Machinery (ACM)",
50
+ value: "acmart"
51
51
  },
52
52
  {
53
53
  name: "Institute of Electrical and Electronics Engineers (IEEE)",
54
54
  value: "ieee"
55
+ },
56
+ {
57
+ name: "Springer's Lecture Notes in Computer Science (LNCS)",
58
+ value: "lncs"
55
59
  }
56
60
  ],
57
61
  default: "scientific-thesis"
58
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
+ },
59
107
  {
60
108
  type: 'list',
61
109
  name: 'ieee_variant',
@@ -101,29 +149,28 @@ module.exports = class extends Generator {
101
149
  {
102
150
  type: 'list',
103
151
  name: 'texlive',
104
- message: 'Which texlive compatiblity?',
152
+ message: 'Which TeXLive compatiblity?',
105
153
  choices: [
106
154
  {
107
155
  name: "TeXLive 2021",
108
156
  value: 2021
109
- },
110
- {
111
- name: "TeXLive 2019",
112
- value: 2019
113
157
  }
114
158
  ],
115
- default: 2021
159
+ default: 2021
116
160
  },
117
161
  {
118
162
  type: 'list',
119
163
  name: 'latexcompiler',
120
164
  message: 'Which latex compiler should be used?',
121
165
  choices: ["pdflatex", "lualatex"],
122
- default: "pdflatex"
166
+ default: "pdflatex",
167
+ when: function(response) {
168
+ return !((response.documentclass === 'ieee') && (response.texlive == 2021));
169
+ }
123
170
  },
124
171
  {
125
172
  when: function(response) {
126
- return response.documentclass !== 'ieee';
173
+ return ((response.documentclass !== 'acmart') && (response.documentclass !== 'ieee'));
127
174
  },
128
175
  type: 'list',
129
176
  name: 'bibtextool',
@@ -140,6 +187,7 @@ module.exports = class extends Generator {
140
187
  ],
141
188
  default: function(response) {
142
189
  switch (response.documentclass) {
190
+ case 'acmart':
143
191
  case 'ieee':
144
192
  case 'lncs':
145
193
  return 'bibtex'
@@ -148,11 +196,31 @@ module.exports = class extends Generator {
148
196
  }
149
197
  },
150
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,
218
+ },
151
219
  {
152
220
  type: 'list',
153
221
  name: 'language',
154
222
  when: function(response) {
155
- return response.documentclass !== 'ieee';
223
+ return ((response.documentclass !== 'acmart') && (response.documentclass !== 'ieee'));
156
224
  },
157
225
  message: 'Which language should the document be?',
158
226
  choices: [
@@ -173,7 +241,12 @@ module.exports = class extends Generator {
173
241
  message: 'Which font should be used?',
174
242
  choices: function(state) {
175
243
  var res = [];
176
- if (state.documentclass === "ieee") {
244
+ if (state.documentclass === "acmart") {
245
+ res.push({
246
+ name: "ACM Default",
247
+ value: "default"
248
+ })
249
+ } else if (state.documentclass === "ieee") {
177
250
  res.push({
178
251
  name: "IEEE Default",
179
252
  value: "default"
@@ -321,11 +394,22 @@ module.exports = class extends Generator {
321
394
  // To access props later use this.props.someAnswer;
322
395
  this.props = props;
323
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
+
324
403
  // Command line argument "--githubpublish" switches the generator to generate a template deployable on a GitHub repository (causing e.g., a refined README.md)
325
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')
326
410
 
327
411
  // Ensure all values are set - even if the user was not asked
328
- if (this.props.documentclass === 'ieee') {
412
+ if ((this.props.documentclass === 'acmart') || (this.props.documentclass === 'ieee')) {
329
413
  this.props.bibtextool = 'bibtex';
330
414
  this.props.font = 'default';
331
415
  this.props.language = 'en';
@@ -335,6 +419,11 @@ module.exports = class extends Generator {
335
419
  // In 2021 this is not used any more, all papers are the "normal" IEEE format
336
420
  this.props.ieee_compsoc = false;
337
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
+
338
427
  // convert "String" Boolean command line options
339
428
  this.props.cleveref = (this.props.cleveref === true) || (this.props.cleveref === 'true')
340
429
  this.props.examples = (this.props.examples === true) || (this.props.examples === 'true')
@@ -366,8 +455,12 @@ module.exports = class extends Generator {
366
455
 
367
456
  this.props.requiresShellEscape = (this.props.listings === 'minted');
368
457
 
369
- this.props.isPaper = (this.props.documentclass === 'ieee') || (this.props.documentclass === 'lncs');
458
+ this.props.feature = {};
459
+ this.props.feature.acronyms = (this.props.documentclass === 'scientific-thesis');
460
+
461
+ this.props.isPaper = (this.props.documentclass === 'acmart') || (this.props.documentclass === 'ieee') || (this.props.documentclass === 'lncs');
370
462
  if (this.props.isPaper) {
463
+ // this sets filenames.main and filenames.bib
371
464
  this.props.filenames = {
372
465
  "main": "paper",
373
466
  "bib": "paper"
@@ -389,7 +482,9 @@ module.exports = class extends Generator {
389
482
 
390
483
  this.props.available = {};
391
484
 
392
- if (props.bibtextool == 'bibtex' && props.documentclass !== 'ieee' && props.documentclass !== 'lncs') {
485
+ if (props.bibtextool == 'bibtex' && props.documentclass !== 'acmart' && props.documentclass !== 'ieee' && props.documentclass !== 'lncs') {
486
+ // acmart uses natbib
487
+ // in lncs, we patched-in natbib
393
488
  this.props.available.citet = false;
394
489
  } else {
395
490
  this.props.available.citet = true;
@@ -398,120 +493,117 @@ module.exports = class extends Generator {
398
493
  }
399
494
 
400
495
  writing() {
401
- var promise = new Promise(function(resolve, reject) {resolve();});
402
- if ((this.props.documentclass === "lncs") && !fs.existsSync('llncs.cls')) {
403
- if (!fs.existsSync('llncs2e.zip')) {
404
- console.log("Need to llncs2e.zip from Springer");
405
- const ftp = require("basic-ftp");
406
- const client = new ftp.Client()
407
- client.ftp.verbose = true
408
- promise = client.access({
409
- host: "ftp.springernature.com",
410
- user: "anonymous",
411
- password: "anonymous",
412
- secure: false
413
- }).then(function() {
414
- return client.ensureDir("cs-proceeding/llncs")
415
- }).then(function() {
416
- return client.downloadTo("llncs2e.zip", "llncs2e.zip")
417
- }).then(function() {
418
- return new Promise(function(resolve, reject) {
419
- console.log("Downloaded");
420
- client.close();
421
- resolve();
422
- });
423
- });
424
- } else {
425
- console.log("llncs2e.zip already exists. Needs to be extracted.");
426
- promise = new Promise(function(resolve, reject) {resolve();});
427
- }
428
- var oldPromise = promise;
429
- promise = oldPromise.then(function() {
430
- return fs.createReadStream('llncs2e.zip')
431
- .pipe(unzipper.Parse())
432
- .on('entry', function (entry) {
433
- const fileName = entry.path;
434
- const type = entry.type; // 'Directory' or 'File'
435
- const size = entry.vars.uncompressedSize; // There is also compressedSize;
436
- if ((fileName === "llncs.cls") || (fileName === "splncs04.bst")) {
437
- entry.pipe(fs.createWriteStream(fileName));
438
- } else {
439
- entry.autodrain();
440
- }
441
- })
442
- });
443
- }
444
496
  let global = this;
445
- promise.then(function() {
497
+ global.props.config = global.props;
498
+ global.fs.copy(
499
+ // .gitignore is not uploaded by npm publish
500
+ // Thus, we prefix it with `dot`.
501
+ global.templatePath('dot.gitignore'),
502
+ global.destinationPath('.gitignore')
503
+ );
504
+ global.fs.copyTpl(
505
+ global.templatePath('dot.editorconfig'),
506
+ global.destinationPath('.editorconfig'),
507
+ global.props
508
+ );
509
+ global.fs.copyTpl(
510
+ global.templatePath('bibliography.bib'),
511
+ global.destinationPath(global.props.filenames.bib + ".bib"),
512
+ global.props
513
+ );
514
+ global.fs.copyTpl(
515
+ global.templatePath('latexmkrc'),
516
+ global.destinationPath('latexmkrc'),
517
+ global.props
518
+ );
519
+ global.fs.copyTpl(
520
+ global.templatePath('localSettings.yaml'),
521
+ global.destinationPath('localSettings.yaml'),
522
+ global.props
523
+ );
524
+ global.fs.copyTpl(
525
+ global.templatePath('LICENSE'),
526
+ global.destinationPath('LICENSE'),
527
+ global.props
528
+ );
529
+ global.fs.copyTpl(
530
+ global.templatePath('Makefile'),
531
+ global.destinationPath('Makefile'),
532
+ global.props
533
+ );
534
+ if (global.props.documentclass === 'lncs') {
446
535
  global.fs.copy(
447
- // .gitignore is not uploaded by npm publish
448
- // Thus, we prefix it with `dot`.
449
- global.templatePath('dot.gitignore'),
450
- global.destinationPath('.gitignore')
451
- );
452
- global.fs.copyTpl(
453
- global.templatePath('dot.editorconfig'),
454
- global.destinationPath('.editorconfig'),
455
- global.props
456
- );
457
- global.fs.copyTpl(
458
- global.templatePath('dot.latexmkrc'),
459
- global.destinationPath('.latexmkrc'),
460
- global.props
461
- );
462
- global.fs.copyTpl(
463
- global.templatePath('bibliography.bib'),
464
- global.destinationPath(global.props.filenames.bib + ".bib"),
465
- global.props
536
+ global.templatePath('splncsnat.bst'),
537
+ global.destinationPath('splncsnat.bst')
466
538
  );
539
+ }
540
+ if (global.props.language === 'de') {
467
541
  global.fs.copyTpl(
468
- global.templatePath('localSettings.yaml'),
469
- global.destinationPath('localSettings.yaml'),
542
+ global.templatePath('main.de.tex'),
543
+ global.destinationPath(global.props.filenames.main + ".tex"),
470
544
  global.props
471
545
  );
546
+ if (global.props.documentclass === 'scientific-thesis') {
547
+ global.fs.copy(
548
+ global.templatePath('acronyms.de.tex'),
549
+ global.destinationPath('acronyms.tex')
550
+ );
551
+ }
552
+ if (!global.props.githubpublish) {
553
+ // we keep the English README.md in case of GitHub publish
554
+ global.fs.copyTpl(
555
+ global.templatePath('README.de.md'),
556
+ global.destinationPath('README.md'),
557
+ global.props
558
+ );
559
+ }
560
+ } else {
472
561
  global.fs.copyTpl(
473
- global.templatePath('LICENSE'),
474
- global.destinationPath('LICENSE'),
562
+ global.templatePath('main.en.tex'),
563
+ global.destinationPath(global.props.filenames.main + ".tex"),
475
564
  global.props
476
565
  );
566
+ if (global.props.documentclass === 'scientific-thesis') {
567
+ global.fs.copy(
568
+ global.templatePath('acronyms.en.tex'),
569
+ global.destinationPath('acronyms.tex')
570
+ );
571
+ }
477
572
  global.fs.copyTpl(
478
- global.templatePath('Makefile'),
479
- global.destinationPath('Makefile'),
573
+ global.templatePath('README.en.md'),
574
+ global.destinationPath('README.md'),
480
575
  global.props
481
576
  );
482
- if (global.props.documentclass === 'lncs') {
577
+ }
578
+ switch (global.props.docker) {
579
+ case "reitzig":
483
580
  global.fs.copy(
484
- global.templatePath('splncsnat.bst'),
485
- global.destinationPath('splncsnat.bst')
581
+ global.templatePath('dot.dockerignore'),
582
+ global.destinationPath('.dockerignore')
486
583
  );
487
- }
488
- if (global.props.language === 'de') {
489
584
  global.fs.copyTpl(
490
- global.templatePath('main.de.tex'),
491
- global.destinationPath(global.props.filenames.main + ".tex"),
585
+ global.templatePath('Dockerfile.reitzig'),
586
+ global.destinationPath('Dockerfile'),
492
587
  global.props
493
588
  );
494
- if (!global.props.githubpublish) {
495
- // we keep the English README.md in case of GitHub publish
496
- global.fs.copyTpl(
497
- global.templatePath('README.de.md'),
498
- global.destinationPath('README.md'),
499
- global.props
500
- );
501
- }
502
- } else {
503
589
  global.fs.copyTpl(
504
- global.templatePath('main.en.tex'),
505
- global.destinationPath(global.props.filenames.main + ".tex"),
590
+ global.templatePath('Texlivefile'),
591
+ global.destinationPath('Texlivefile'),
506
592
  global.props
507
593
  );
594
+ break;
595
+ case "dante":
596
+ global.fs.copy(
597
+ global.templatePath('dot.dockerignore'),
598
+ global.destinationPath('.dockerignore')
599
+ );
508
600
  global.fs.copyTpl(
509
- global.templatePath('README.en.md'),
510
- global.destinationPath('README.md'),
601
+ global.templatePath('Dockerfile.dante'),
602
+ global.destinationPath('Dockerfile'),
511
603
  global.props
512
604
  );
513
- }
514
- });
605
+ break;
606
+ }
515
607
  }
516
608
 
517
609
  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,35 @@
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
+ # Emulate "Install dependencies" of "entrypoint work ..."
13
+ <% if (texlive < 2021) { -%>
14
+ COPY Texlivefile /work/src
15
+ RUN xargs tlmgr install --repository ftp://ftp.math.utah.edu/pub/tex/historic/systems/texlive/<%= texlive %>/tlnet-final < "/work/src/Texlivefile" && \
16
+ <% } else { -%>
17
+ RUN tlmgr update --self --repository https://mirror.mwt.me/ctan/systems/texlive/tlnet
18
+ COPY Texlivefile /work/src
19
+ RUN 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 <% if (bibtextool == "biblatex") { %>biber, <% } %>latexmk and texlogsieve available
24
+ <% if (bibtextool == "biblatex") { -%>
25
+ cp /usr/local/texlive/<%= texlive %>/bin/x86_64-linuxmusl/biber /usr/local/bin && \
26
+ <% } -%>
27
+ cp /usr/local/texlive/<%= texlive %>/bin/x86_64-linuxmusl/latexmk /usr/local/bin && \
28
+ cp /usr/local/texlive/<%= texlive %>/bin/x86_64-linuxmusl/texlogsieve /usr/local/bin && \
29
+ <% if (latexcompiler === "lualatex") { -%>
30
+ #
31
+ # update font index
32
+ luaotfload-tool --update && \
33
+ <% } -%>
34
+ # use latest texlogsieve
35
+ cd /usr/local/bin && wget https://gitlab.com/lago/texlogsieve/-/raw/main/texlogsieve?inline=false
@@ -1,22 +1,9 @@
1
1
  sources = <%= filenames.main %>.tex
2
- <% if (documentclass == 'lncs') { -%>
3
- llncs-class = llncs.cls
4
- <% } -%>
5
2
 
6
3
  .PHONY: clean reformat split-sentences indent
7
4
 
8
5
  compile: $(sources)
9
6
  latexmk $(sources)
10
- <% if (documentclass == 'lncs') { -%>
11
-
12
- $(sources): $(llncs-class)
13
- $(llncs-class): download
14
-
15
- download:
16
- ifeq (,$(wildcard ./$(llncs-class)))
17
- ./download-llncs-files-from-springer.sh
18
- endif
19
- <% } -%>
20
7
 
21
8
  format:
22
9
  latexindent -l -s -sl -w $(sources)