generator-latex-template 0.3.0 → 0.6.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 +16 -3
- package/generators/app/index.js +210 -98
- package/generators/app/templates/.github/workflows/check.yml +43 -0
- package/generators/app/templates/Dockerfile.dante +9 -0
- package/generators/app/templates/Dockerfile.reitzig +37 -0
- package/generators/app/templates/Makefile +0 -13
- package/generators/app/templates/README.en.md +61 -26
- package/generators/app/templates/Texlivefile +128 -0
- package/generators/app/templates/acronyms.de.tex +6 -0
- package/generators/app/templates/acronyms.en.tex +5 -0
- package/generators/app/templates/acronyms.example.de.tex +24 -0
- package/generators/app/templates/acronyms.example.en.tex +24 -0
- package/generators/app/templates/acronyms.preamble.en.tex +15 -0
- package/generators/app/templates/biblatex.preamble.de.tex +9 -0
- package/generators/app/templates/biblatex.preamble.en.tex +61 -0
- package/generators/app/templates/bibliography.bib +11 -0
- package/generators/app/templates/cleveref.example.en.tex +1 -1
- package/generators/app/templates/dot.dockerignore +429 -0
- package/generators/app/templates/figure.example.en.tex +1 -1
- package/generators/app/templates/font.preamble.en.tex +1 -4
- package/generators/app/templates/{dot.latexmkrc → latexmkrc} +11 -9
- package/generators/app/templates/main.de.tex +133 -11
- package/generators/app/templates/main.en.tex +153 -46
- package/generators/app/templates/scientific-thesis-cover.preamble.de.tex +12 -0
- package/generators/app/templates/scientific-thesis-cover.preamble.en.tex +12 -0
- package/generators/app/templates/siunitx.preamble.en.tex +0 -5
- package/generators/app/templates/{splncsnat.bst → splncs04nat.bst} +156 -118
- package/package.json +9 -9
- package/CHANGELOG.md +0 -76
- package/generators/app/templates/bibliography.bib.bak +0 -37
- package/generators/app/templates/main.de.pdf +0 -0
- package/generators/app/templates/main.de.synctex.gz +0 -0
- package/generators/app/templates/main.en.aux +0 -3
- package/generators/app/templates/main.en.fdb_latexmk +0 -38
- package/generators/app/templates/main.en.fls +0 -52
- package/generators/app/templates/main.en.log +0 -251
- package/generators/app/templates/main.en.pdf +0 -0
- package/generators/app/templates/main.en.synctex.gz +0 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LaTeX Template Generator [](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
|
|
|
@@ -108,8 +108,9 @@ 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
|
-
-
|
|
112
|
-
- Windows
|
|
111
|
+
- Linux: `npx yo /tmp/repo --documentclass=lncs --overleaf=false --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 --overleaf=false --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 --overleaf=false --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
115
|
- Update npm dependencies
|
|
115
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,6 +118,16 @@ In the long run, the contents of the `paper.tex` (and similar) files in reposito
|
|
|
117
118
|
- See <https://github.com/yeoman/generator/releases> for changes in the generator.
|
|
118
119
|
- When one encounters `Cannot find module 'yeoman-generator'`, please update the npm dependencies.
|
|
119
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
|
|
120
131
|
|
|
121
132
|
### Useful snippets
|
|
122
133
|
|
|
@@ -160,6 +171,8 @@ ejslint.cmd c:\git-repositories\latextemplates\generator-latex-template\generato
|
|
|
160
171
|
The code is licensed [0BSD](https://choosealicense.com/licenses/0bsd/#), the snippets (both LaTeX and text) 0BSD, too.
|
|
161
172
|
See [benbalter/talks#15](https://github.com/benbalter/talks/issues/15#issuecomment-599704662), for a reasoning, why [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/) cannot be used.
|
|
162
173
|
|
|
174
|
+
`generators/app/templates/splncs04nat.bst` is taken from [tpavlic/splncs04nat](https://github.com/tpavlic/splncs04nat) and is MIT-licensed.
|
|
175
|
+
|
|
163
176
|
[hyperref]: https://ctan.org/pkg/hyperref
|
|
164
177
|
[listings]: https://ctan.org/pkg/listings
|
|
165
178
|
[minted]: https://ctan.org/pkg/minted
|
package/generators/app/index.js
CHANGED
|
@@ -60,6 +60,50 @@ module.exports = class extends Generator {
|
|
|
60
60
|
],
|
|
61
61
|
default: "scientific-thesis"
|
|
62
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
|
+
},
|
|
63
107
|
{
|
|
64
108
|
type: 'list',
|
|
65
109
|
name: 'ieee_variant',
|
|
@@ -102,28 +146,50 @@ module.exports = class extends Generator {
|
|
|
102
146
|
],
|
|
103
147
|
default: "a4paper"
|
|
104
148
|
},
|
|
149
|
+
{
|
|
150
|
+
type: 'list',
|
|
151
|
+
name: 'overleaf',
|
|
152
|
+
message: 'Overleaf compatibility?',
|
|
153
|
+
choices: [
|
|
154
|
+
{
|
|
155
|
+
name: "yes",
|
|
156
|
+
value: true
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "no",
|
|
160
|
+
value: false
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
default: true
|
|
164
|
+
},
|
|
105
165
|
{
|
|
106
166
|
type: 'list',
|
|
107
167
|
name: 'texlive',
|
|
108
|
-
|
|
168
|
+
when: function(response) {
|
|
169
|
+
return (!response.overleaf || (response.overleaf == "false"));
|
|
170
|
+
},
|
|
171
|
+
message: 'Which TeXLive compatibility?',
|
|
109
172
|
choices: [
|
|
110
173
|
{
|
|
111
174
|
name: "TeXLive 2021",
|
|
112
175
|
value: 2021
|
|
113
176
|
},
|
|
114
177
|
{
|
|
115
|
-
name: "TeXLive
|
|
116
|
-
value:
|
|
178
|
+
name: "TeXLive 2022",
|
|
179
|
+
value: 2022
|
|
117
180
|
}
|
|
118
181
|
],
|
|
119
|
-
default:
|
|
182
|
+
default: 2022
|
|
120
183
|
},
|
|
121
184
|
{
|
|
122
185
|
type: 'list',
|
|
123
186
|
name: 'latexcompiler',
|
|
124
187
|
message: 'Which latex compiler should be used?',
|
|
125
188
|
choices: ["pdflatex", "lualatex"],
|
|
126
|
-
default: "pdflatex"
|
|
189
|
+
default: "pdflatex",
|
|
190
|
+
when: function(response) {
|
|
191
|
+
return !(response.documentclass === 'ieee');
|
|
192
|
+
}
|
|
127
193
|
},
|
|
128
194
|
{
|
|
129
195
|
when: function(response) {
|
|
@@ -153,6 +219,26 @@ module.exports = class extends Generator {
|
|
|
153
219
|
}
|
|
154
220
|
},
|
|
155
221
|
},
|
|
222
|
+
{
|
|
223
|
+
type: 'list',
|
|
224
|
+
name: 'docker',
|
|
225
|
+
message: 'Should a Dockerfile be generated?',
|
|
226
|
+
choices: [
|
|
227
|
+
{
|
|
228
|
+
name: "no",
|
|
229
|
+
value: false
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: "yes (Reiztig)",
|
|
233
|
+
value: "reitzig"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: "yes (DANTE e.V.)",
|
|
237
|
+
value: "dante"
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
default: false,
|
|
241
|
+
},
|
|
156
242
|
{
|
|
157
243
|
type: 'list',
|
|
158
244
|
name: 'language',
|
|
@@ -331,12 +417,25 @@ module.exports = class extends Generator {
|
|
|
331
417
|
// To access props later use this.props.someAnswer;
|
|
332
418
|
this.props = props;
|
|
333
419
|
|
|
334
|
-
|
|
420
|
+
if (this.props.overleaf) {
|
|
421
|
+
// we do not prompt for texlive version in case of overleaf
|
|
422
|
+
this.props.texlive = 2021;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// somehow texlive is not routed through
|
|
426
|
+
// special handling
|
|
427
|
+
if (this.params.options.texlive) {
|
|
428
|
+
this.props.texlive = parseInt(this.params.options.texlive)
|
|
429
|
+
}
|
|
335
430
|
|
|
336
431
|
// Command line argument "--githubpublish" switches the generator to generate a template deployable on a GitHub repository (causing e.g., a refined README.md)
|
|
337
432
|
this.props.githubpublish = this.params.options.githubpublish;
|
|
338
433
|
this.props.githubpublish = (this.props.githubpublish === true) || (this.props.githubpublish === 'true')
|
|
339
434
|
|
|
435
|
+
// 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
|
|
436
|
+
this.props.preparereitzig = this.params.options.preparereitzig;
|
|
437
|
+
this.props.preparereitzig = (this.props.preparereitzig === true) || (this.props.preparereitzig === 'true')
|
|
438
|
+
|
|
340
439
|
// Ensure all values are set - even if the user was not asked
|
|
341
440
|
if ((this.props.documentclass === 'acmart') || (this.props.documentclass === 'ieee')) {
|
|
342
441
|
this.props.bibtextool = 'bibtex';
|
|
@@ -348,10 +447,16 @@ module.exports = class extends Generator {
|
|
|
348
447
|
// In 2021 this is not used any more, all papers are the "normal" IEEE format
|
|
349
448
|
this.props.ieee_compsoc = false;
|
|
350
449
|
|
|
450
|
+
// As of 2021-12-24 the IEEE setup does not work on TeXLive 2021 and lualatex (TeXLive 2019 and 2020 work)
|
|
451
|
+
if ((this.props.documentclass === 'ieee') && (this.props.texlive == 2021)) {
|
|
452
|
+
this.props.latexcompiler = 'pdflatex';
|
|
453
|
+
}
|
|
454
|
+
|
|
351
455
|
// convert "String" Boolean command line options
|
|
352
456
|
this.props.cleveref = (this.props.cleveref === true) || (this.props.cleveref === 'true')
|
|
353
457
|
this.props.examples = (this.props.examples === true) || (this.props.examples === 'true')
|
|
354
458
|
this.props.howtotext = (this.props.howtotext === true) || (this.props.howtotext === 'true')
|
|
459
|
+
this.props.overleaf = (this.props.overleaf === true) || (this.props.overleaf === 'true')
|
|
355
460
|
|
|
356
461
|
if (this.props.examples) {
|
|
357
462
|
this.props.useExampleEnvironment = true;
|
|
@@ -379,8 +484,12 @@ module.exports = class extends Generator {
|
|
|
379
484
|
|
|
380
485
|
this.props.requiresShellEscape = (this.props.listings === 'minted');
|
|
381
486
|
|
|
382
|
-
this.props.
|
|
487
|
+
this.props.feature = {};
|
|
488
|
+
this.props.feature.acronyms = (this.props.documentclass === 'scientific-thesis');
|
|
489
|
+
|
|
490
|
+
this.props.isPaper = (this.props.documentclass === 'acmart') || (this.props.documentclass === 'ieee') || (this.props.documentclass === 'lncs');
|
|
383
491
|
if (this.props.isPaper) {
|
|
492
|
+
// this sets filenames.main and filenames.bib
|
|
384
493
|
this.props.filenames = {
|
|
385
494
|
"main": "paper",
|
|
386
495
|
"bib": "paper"
|
|
@@ -413,121 +522,124 @@ module.exports = class extends Generator {
|
|
|
413
522
|
}
|
|
414
523
|
|
|
415
524
|
writing() {
|
|
416
|
-
var promise = new Promise(function(resolve, reject) {resolve();});
|
|
417
|
-
if ((this.props.documentclass === "lncs") && !fs.existsSync('llncs.cls')) {
|
|
418
|
-
if (!fs.existsSync('llncs2e.zip')) {
|
|
419
|
-
console.log("Need to llncs2e.zip from Springer");
|
|
420
|
-
const ftp = require("basic-ftp");
|
|
421
|
-
const client = new ftp.Client()
|
|
422
|
-
client.ftp.verbose = true
|
|
423
|
-
promise = client.access({
|
|
424
|
-
host: "ftp.springernature.com",
|
|
425
|
-
user: "anonymous",
|
|
426
|
-
password: "anonymous",
|
|
427
|
-
secure: false
|
|
428
|
-
}).then(function() {
|
|
429
|
-
return client.ensureDir("cs-proceeding/llncs")
|
|
430
|
-
}).then(function() {
|
|
431
|
-
return client.downloadTo("llncs2e.zip", "llncs2e.zip")
|
|
432
|
-
}).then(function() {
|
|
433
|
-
return new Promise(function(resolve, reject) {
|
|
434
|
-
console.log("Downloaded");
|
|
435
|
-
client.close();
|
|
436
|
-
resolve();
|
|
437
|
-
});
|
|
438
|
-
});
|
|
439
|
-
} else {
|
|
440
|
-
console.log("llncs2e.zip already exists. Needs to be extracted.");
|
|
441
|
-
promise = new Promise(function(resolve, reject) {resolve();});
|
|
442
|
-
}
|
|
443
|
-
var oldPromise = promise;
|
|
444
|
-
promise = oldPromise.then(function() {
|
|
445
|
-
return fs.createReadStream('llncs2e.zip')
|
|
446
|
-
.pipe(unzipper.Parse())
|
|
447
|
-
.on('entry', function (entry) {
|
|
448
|
-
const fileName = entry.path;
|
|
449
|
-
const type = entry.type; // 'Directory' or 'File'
|
|
450
|
-
const size = entry.vars.uncompressedSize; // There is also compressedSize;
|
|
451
|
-
if ((fileName === "llncs.cls") || (fileName === "splncs04.bst")) {
|
|
452
|
-
entry.pipe(fs.createWriteStream(fileName));
|
|
453
|
-
} else {
|
|
454
|
-
entry.autodrain();
|
|
455
|
-
}
|
|
456
|
-
})
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
525
|
let global = this;
|
|
460
526
|
global.props.config = global.props;
|
|
461
|
-
|
|
527
|
+
global.fs.copy(
|
|
528
|
+
// .gitignore is not uploaded by npm publish
|
|
529
|
+
// Thus, we prefix it with `dot`.
|
|
530
|
+
global.templatePath('dot.gitignore'),
|
|
531
|
+
global.destinationPath('.gitignore')
|
|
532
|
+
);
|
|
533
|
+
global.fs.copyTpl(
|
|
534
|
+
global.templatePath('dot.editorconfig'),
|
|
535
|
+
global.destinationPath('.editorconfig'),
|
|
536
|
+
global.props
|
|
537
|
+
);
|
|
538
|
+
global.fs.copyTpl(
|
|
539
|
+
global.templatePath('bibliography.bib'),
|
|
540
|
+
global.destinationPath(global.props.filenames.bib + ".bib"),
|
|
541
|
+
global.props
|
|
542
|
+
);
|
|
543
|
+
global.fs.copyTpl(
|
|
544
|
+
global.templatePath('latexmkrc'),
|
|
545
|
+
global.destinationPath(global.props.overleaf ? '_latexmkrc' : 'latexmkrc'),
|
|
546
|
+
global.props
|
|
547
|
+
);
|
|
548
|
+
global.fs.copyTpl(
|
|
549
|
+
global.templatePath('localSettings.yaml'),
|
|
550
|
+
global.destinationPath('localSettings.yaml'),
|
|
551
|
+
global.props
|
|
552
|
+
);
|
|
553
|
+
global.fs.copyTpl(
|
|
554
|
+
global.templatePath('LICENSE'),
|
|
555
|
+
global.destinationPath('LICENSE'),
|
|
556
|
+
global.props
|
|
557
|
+
);
|
|
558
|
+
global.fs.copyTpl(
|
|
559
|
+
global.templatePath('Makefile'),
|
|
560
|
+
global.destinationPath('Makefile'),
|
|
561
|
+
global.props
|
|
562
|
+
);
|
|
563
|
+
if (global.props.documentclass === 'lncs') {
|
|
462
564
|
global.fs.copy(
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
global.templatePath('dot.gitignore'),
|
|
466
|
-
global.destinationPath('.gitignore')
|
|
467
|
-
);
|
|
468
|
-
global.fs.copyTpl(
|
|
469
|
-
global.templatePath('dot.editorconfig'),
|
|
470
|
-
global.destinationPath('.editorconfig'),
|
|
471
|
-
global.props
|
|
472
|
-
);
|
|
473
|
-
global.fs.copyTpl(
|
|
474
|
-
global.templatePath('dot.latexmkrc'),
|
|
475
|
-
global.destinationPath('.latexmkrc'),
|
|
476
|
-
global.props
|
|
477
|
-
);
|
|
478
|
-
global.fs.copyTpl(
|
|
479
|
-
global.templatePath('bibliography.bib'),
|
|
480
|
-
global.destinationPath(global.props.filenames.bib + ".bib"),
|
|
481
|
-
global.props
|
|
565
|
+
global.templatePath('splncs04nat.bst'),
|
|
566
|
+
global.destinationPath('splncs04nat.bst')
|
|
482
567
|
);
|
|
568
|
+
}
|
|
569
|
+
if (global.props.language === 'de') {
|
|
483
570
|
global.fs.copyTpl(
|
|
484
|
-
global.templatePath('
|
|
485
|
-
global.destinationPath(
|
|
571
|
+
global.templatePath('main.de.tex'),
|
|
572
|
+
global.destinationPath(global.props.filenames.main + ".tex"),
|
|
486
573
|
global.props
|
|
487
574
|
);
|
|
575
|
+
if (global.props.documentclass === 'scientific-thesis') {
|
|
576
|
+
global.fs.copy(
|
|
577
|
+
global.templatePath('acronyms.de.tex'),
|
|
578
|
+
global.destinationPath('acronyms.tex')
|
|
579
|
+
);
|
|
580
|
+
}
|
|
581
|
+
if (!global.props.githubpublish) {
|
|
582
|
+
// we keep the English README.md in case of GitHub publish
|
|
583
|
+
global.fs.copyTpl(
|
|
584
|
+
global.templatePath('README.de.md'),
|
|
585
|
+
global.destinationPath('README.md'),
|
|
586
|
+
global.props
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
} else {
|
|
488
590
|
global.fs.copyTpl(
|
|
489
|
-
global.templatePath('
|
|
490
|
-
global.destinationPath(
|
|
591
|
+
global.templatePath('main.en.tex'),
|
|
592
|
+
global.destinationPath(global.props.filenames.main + ".tex"),
|
|
491
593
|
global.props
|
|
492
594
|
);
|
|
595
|
+
if (global.props.documentclass === 'scientific-thesis') {
|
|
596
|
+
global.fs.copy(
|
|
597
|
+
global.templatePath('acronyms.en.tex'),
|
|
598
|
+
global.destinationPath('acronyms.tex')
|
|
599
|
+
);
|
|
600
|
+
}
|
|
493
601
|
global.fs.copyTpl(
|
|
494
|
-
global.templatePath('
|
|
495
|
-
global.destinationPath('
|
|
602
|
+
global.templatePath('README.en.md'),
|
|
603
|
+
global.destinationPath('README.md'),
|
|
496
604
|
global.props
|
|
497
605
|
);
|
|
498
|
-
|
|
606
|
+
}
|
|
607
|
+
switch (global.props.docker) {
|
|
608
|
+
case "reitzig":
|
|
499
609
|
global.fs.copy(
|
|
500
|
-
global.templatePath('
|
|
501
|
-
global.destinationPath('
|
|
610
|
+
global.templatePath('dot.dockerignore'),
|
|
611
|
+
global.destinationPath('.dockerignore')
|
|
502
612
|
);
|
|
503
|
-
}
|
|
504
|
-
if (global.props.language === 'de') {
|
|
505
613
|
global.fs.copyTpl(
|
|
506
|
-
global.templatePath('
|
|
507
|
-
global.destinationPath(
|
|
614
|
+
global.templatePath('Dockerfile.reitzig'),
|
|
615
|
+
global.destinationPath('Dockerfile'),
|
|
508
616
|
global.props
|
|
509
617
|
);
|
|
510
|
-
if (!global.props.githubpublish) {
|
|
511
|
-
// we keep the English README.md in case of GitHub publish
|
|
512
|
-
global.fs.copyTpl(
|
|
513
|
-
global.templatePath('README.de.md'),
|
|
514
|
-
global.destinationPath('README.md'),
|
|
515
|
-
global.props
|
|
516
|
-
);
|
|
517
|
-
}
|
|
518
|
-
} else {
|
|
519
618
|
global.fs.copyTpl(
|
|
520
|
-
global.templatePath('
|
|
521
|
-
global.destinationPath(
|
|
619
|
+
global.templatePath('Texlivefile'),
|
|
620
|
+
global.destinationPath('Texlivefile'),
|
|
522
621
|
global.props
|
|
523
622
|
);
|
|
623
|
+
break;
|
|
624
|
+
case "dante":
|
|
625
|
+
global.fs.copy(
|
|
626
|
+
global.templatePath('dot.dockerignore'),
|
|
627
|
+
global.destinationPath('.dockerignore')
|
|
628
|
+
);
|
|
524
629
|
global.fs.copyTpl(
|
|
525
|
-
global.templatePath('
|
|
526
|
-
global.destinationPath('
|
|
630
|
+
global.templatePath('Dockerfile.dante'),
|
|
631
|
+
global.destinationPath('Dockerfile'),
|
|
527
632
|
global.props
|
|
528
633
|
);
|
|
529
|
-
|
|
530
|
-
}
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
if (global.props.docker) {
|
|
637
|
+
global.fs.copyTpl(
|
|
638
|
+
global.templatePath('.github/workflows/check.yml'),
|
|
639
|
+
global.destinationPath('.github/workflows/check.yml'),
|
|
640
|
+
global.props
|
|
641
|
+
);
|
|
642
|
+
}
|
|
531
643
|
}
|
|
532
644
|
|
|
533
645
|
install() {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
on:
|
|
2
|
+
push:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
concurrency:
|
|
5
|
+
group: check
|
|
6
|
+
cancel-in-progress: true
|
|
7
|
+
jobs:
|
|
8
|
+
check:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
services:
|
|
11
|
+
registry:
|
|
12
|
+
image: registry:2
|
|
13
|
+
ports:
|
|
14
|
+
- 5000:5000
|
|
15
|
+
steps:
|
|
16
|
+
- name: Set up QEMU
|
|
17
|
+
uses: docker/setup-qemu-action@v1
|
|
18
|
+
- name: Set up Docker Buildx
|
|
19
|
+
uses: docker/setup-buildx-action@v1
|
|
20
|
+
with:
|
|
21
|
+
driver-opts: network=host
|
|
22
|
+
- name: Cache Docker layers
|
|
23
|
+
uses: actions/cache@v2
|
|
24
|
+
with:
|
|
25
|
+
path: /tmp/.buildx-cache
|
|
26
|
+
key: ${{ runner.os }}-buildx
|
|
27
|
+
- name: Build Docker image
|
|
28
|
+
uses: docker/build-push-action@v2
|
|
29
|
+
with:
|
|
30
|
+
push: true
|
|
31
|
+
tags: localhost:5000/name/app:latest
|
|
32
|
+
- name: Set up Git repository
|
|
33
|
+
uses: actions/checkout@v3
|
|
34
|
+
- run: |
|
|
35
|
+
mkdir /tmp/out
|
|
36
|
+
mkdir /tmp/res
|
|
37
|
+
- run: docker run -v $(pwd):/work/src -v /tmp/out:/work/out localhost:5000/name/app:latest work "latexmk -pdf -pdflatex='<% if ((latexcompiler == "pdflatex") || githubpublish) { %>pdflatex<% } else { %>lualatex<% } %> --interaction=nonstopmode' <%= filenames.main %>"
|
|
38
|
+
- run: mv /tmp/out/*.pdf /tmp/res
|
|
39
|
+
- uses: actions/upload-artifact@v2
|
|
40
|
+
with:
|
|
41
|
+
name: test-result
|
|
42
|
+
path: |
|
|
43
|
+
/tmp/res/*.pdf
|
|
@@ -0,0 +1,37 @@
|
|
|
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 2022: %>2022.2<% break;
|
|
7
|
+
case 2021: %>2021.10<% break;
|
|
8
|
+
} -%>
|
|
9
|
+
|
|
10
|
+
RUN apk update && apk add --no-cache bash perl python3 py3-pip
|
|
11
|
+
RUN pip3 install pygments
|
|
12
|
+
|
|
13
|
+
# Emulate "Install dependencies" of "entrypoint work ..."
|
|
14
|
+
<% if (texlive < 2022) { -%>
|
|
15
|
+
RUN tlmgr update --self --repository http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/<%= texlive %>/tlnet-final
|
|
16
|
+
COPY Texlivefile /work/src
|
|
17
|
+
RUN xargs tlmgr install --repository http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/<%= texlive %>/tlnet-final < "/work/src/Texlivefile" && \
|
|
18
|
+
<% } else { -%>
|
|
19
|
+
RUN tlmgr update --self --repository https://mirror.mwt.me/ctan/systems/texlive/tlnet
|
|
20
|
+
COPY Texlivefile /work/src
|
|
21
|
+
RUN xargs tlmgr install --repository https://mirror.mwt.me/ctan/systems/texlive/tlnet < "/work/src/Texlivefile" && \
|
|
22
|
+
<% } -%>
|
|
23
|
+
sha256sum "/work/src/Texlivefile" > "/work/tmp/Texlivefile.sha" && \
|
|
24
|
+
#
|
|
25
|
+
# make <% if (bibtextool == "biblatex") { %>biber, <% } %>latexmk and texlogsieve available
|
|
26
|
+
<% if (bibtextool == "biblatex") { -%>
|
|
27
|
+
cp /usr/local/texlive/<%= texlive %>/bin/x86_64-linuxmusl/biber /usr/local/bin && \
|
|
28
|
+
<% } -%>
|
|
29
|
+
cp /usr/local/texlive/<%= texlive %>/bin/x86_64-linuxmusl/latexmk /usr/local/bin && \
|
|
30
|
+
cp /usr/local/texlive/<%= texlive %>/bin/x86_64-linuxmusl/texlogsieve /usr/local/bin && \
|
|
31
|
+
<% if (latexcompiler === "lualatex") { -%>
|
|
32
|
+
#
|
|
33
|
+
# update font index
|
|
34
|
+
luaotfload-tool --update && \
|
|
35
|
+
<% } -%>
|
|
36
|
+
# use latest texlogsieve
|
|
37
|
+
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)
|