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
package/LICENSE CHANGED
@@ -1,21 +1,14 @@
1
- MIT License
1
+ BSD Zero Clause License
2
2
 
3
- Copyright (c) 2018-2019 Oliver Kopp <kopp.dev@gmail.com> (http://orcid.org/0000-0001-6962-4290)
3
+ Copyright (c) 2018-2021 Oliver Kopp <kopp.dev@gmail.com> (http://orcid.org/0000-0001-6962-4290)
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
11
7
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
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,27 +19,36 @@ 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
 
26
26
  ## Talks
27
27
 
28
- * [Oliver Kopp - The LaTeX Template Generator](https://github.com/dante-ev/Vortraege_Tagungen/blob/master/2019-Herbst/Oliver%20Kopp%20-%20The%20LaTeX%20Template%20Generator%20-%20dante2019-herbst.pdf) - a talk on the motivation, user experience, and the contribution
28
+ - [Oliver Kopp - The LaTeX Template Generator](https://github.com/dante-ev/Vortraege_Tagungen/blob/master/2019-Herbst/Oliver%20Kopp%20-%20The%20LaTeX%20Template%20Generator%20-%20dante2019-herbst.pdf) - a talk on the motivation, user experience, and the contribution
29
29
 
30
30
  ## Usage
31
31
 
32
+ One has to install [Node.js](https://nodejs.org/en/) version 14 to get this generator running.
33
+ On Windows, one can just run `choco install nodejs-lts` to get the right version of Node.js.
34
+
35
+ On Linux, one can start using the generator directly using the node execution wrapper [npx](https://www.npmjs.com/package/npx):
36
+
37
+ ```bash
38
+ npx -p yo -p generator-latex-template -c 'yo latex-template'
39
+ ```
40
+
32
41
  ### Installing `generator-latex-template`
33
42
 
34
- You can install `generator-latex-template` using following command:
43
+ In case one wants to have the generator installed permanently or `npx` does work as exepcted, one can install `generator-latex-template` using following command:
35
44
 
36
45
  ```bash
37
- npm install -g yo generator-latex-template
46
+ npm install -g generator-latex-template
38
47
  ```
39
48
 
40
49
  ### Using the generator
41
50
 
42
- You can run the generator by invoking this command on a command prompt:
51
+ One can run the generator by invoking this command on a command prompt:
43
52
 
44
53
  ```bash
45
54
  yo latex-template
@@ -47,46 +56,40 @@ yo latex-template
47
56
 
48
57
  ## How to update the document
49
58
 
50
- !! The template generator overwrites `main.tex` on each run and will destroy your work.
59
+ ⚠️ The template generator overwrites `main.tex` on each run. This will destroy your work. ⚠️
51
60
 
52
61
  You can use the magic of `git` to prevent that:
53
62
 
54
63
  1. After repository initialization:
55
64
 
56
- - `git commit` to save your work
57
- - `git checkout -b template` - to create a branch with initial template (required for updating)
58
- - `git checkout master` switch back to your thesis
65
+ - `git commit` to save your work
66
+ - `git checkout -b template` - to create a branch with initial template (required for updating)
67
+ - `git checkout main` switch back to your thesis
59
68
 
60
- 2. Work on the `master` branch
69
+ 2. Work on the `main` branch
61
70
  3. In case an update comes in, update the `template` branch
62
71
 
63
- - `git checkout template` - switch to the `template` branch
64
- - `yo latex-template` - generate new template
65
- - `git commit` - save the new template
66
- - `git checkout master` - switch to your work
67
- - `git merge template` - merge in the template changes
68
- - resolve conflicts ^^ (Hint: IntelliJ Community Edition has a [great conflict resolving tool](https://www.jetbrains.com/help/idea/resolving-conflicts.html#))
69
-
70
- <!--
71
- #### Generator Output
72
-
73
- Use this section for documenting what your generator actually will generate.
74
- -->
72
+ - `git checkout template` - switch to the `template` branch
73
+ - `yo latex-template` - generate new template
74
+ - `git commit` - save the new template
75
+ - `git checkout main` - switch to your work
76
+ - `git merge template` - merge in the template changes
77
+ - resolve conflicts ^^ (Hint: IntelliJ Community Edition has a [great conflict resolving tool](https://www.jetbrains.com/help/idea/resolving-conflicts.html#))
75
78
 
76
79
  ## Resources
77
80
 
78
- - [IEEE](https://latextemplates.github.io/IEEE/) - example: [paper-conference-minted.tex](https://github.com/latextemplates/IEEE/blob/master/paper-conference-minted.tex)
79
- - [LNCS](https://latextemplates.github.io/LNCS/) - example: [paper.tex](https://github.com/latextemplates/LNCS/blob/master/paper.tex)
80
- - [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)
81
84
  - [alpenwasser/TeX](https://github.com/alpenwasser/TeX)
82
85
 
83
86
  ## Development roadmap
84
87
 
85
- 1. Create directory structure
86
- 2. Sort in examples from the [scientific-thesis-template](http://latextemplates.github.io/scientific-thesis-template/)
87
- 3. Have scientific-thesis-template generated completely.
88
- 4. Have LNCS generated completely.
89
- 5. Have [uni-stuttgart-dissertation-template](https://github.com/latextemplates/uni-stuttgart-dissertation-template) generated automatically.
88
+ - [x] Create directory structure
89
+ - [ ] Sort in examples from the [scientific-thesis-template](http://latextemplates.github.io/scientific-thesis-template/)
90
+ - [ ] Have scientific-thesis-template generated completely.
91
+ - [x] Have LNCS generated completely.
92
+ - [ ] Have [uni-stuttgart-dissertation-template](https://github.com/latextemplates/uni-stuttgart-dissertation-template) generated automatically.
90
93
 
91
94
  In the long run, the contents of the `paper.tex` (and similar) files in repositories of the [latextemplates](https://latextemplates.github.io/) organization should be generated automatically.
92
95
 
@@ -94,7 +97,65 @@ In the long run, the contents of the `paper.tex` (and similar) files in reposito
94
97
 
95
98
  - Templating language: <https://ejs.co/>
96
99
  - Conditional questions: <https://stackoverflow.com/a/18706640/873282>.
97
- - Types of questions: <https://github.com/SBoudrias/Inquirer.js#prompt-types>
100
+ - Types of prompts: <https://github.com/SBoudrias/Inquirer.js#prompt-types>
101
+ - E.g,. [Question](https://github.com/SBoudrias/Inquirer.js#question)
102
+ - Add a new question
103
+ - Also adapt `__tests__/app.js`
104
+ - Execute tests with `npx jest`
105
+ - Test locally
106
+ - Create empty directory ("target directory")
107
+ - Change to the target directory
108
+ - Run `npx yo <path-to-git-repository>`
109
+ - Windows: `npx yo c:\git-repositories\latextemplates\generator-latex-template`
110
+ - Parameters can be set using command line
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`
114
+ - Run `latexmk` to build the PDF
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/)]
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
131
+
132
+ ### Useful snippets
133
+
134
+ ```ejs
135
+ <% if (howtotext) { -%>
136
+ <% } else { -%>
137
+ <% } -%>
138
+ ```
139
+
140
+ ```ejs
141
+ <% switch (documentclass) { case "lncs": -%>
142
+ <% break; case "ieee": -%>
143
+ <% break; default: -%>
144
+ <% break; } -%>
145
+ ```
146
+
147
+ ```ejs
148
+ <% if (cleveref) { %>\cref<% } else if (documentclass == 'lncs') { %>Sect.~<% } else { %>Section~<% } %>{sec:relatedwork}
149
+ ```
150
+
151
+ ### Debugging
152
+
153
+ A `launch.json` configured for Windows and Visual Studio Code is included.
154
+ Just press <kbd>F5</kbd> and the generator should run in debug mode.
155
+
156
+ ```terminal
157
+ ejslint.cmd c:\git-repositories\latextemplates\generator-latex-template\generators\app\templates\main.en.tex
158
+ ```
98
159
 
99
160
  ### Releasing a new version
100
161
 
@@ -102,10 +163,16 @@ In the long run, the contents of the `paper.tex` (and similar) files in reposito
102
163
  2. Update `package.json`, publish to [npmjs](https://www.npmjs.com/package/generator-latex-template), create GitHub release.
103
164
  Use [release-it](https://www.npmjs.com/package/release-it) (do not create a release on GitHub) and [github-release-from-changelog](https://www.npmjs.com/package/github-release-from-changelog).
104
165
 
166
+ - `npx release-it`
167
+ - `npx github-release-from-changelog`
168
+
105
169
  ## License
106
170
 
107
- The code is licenced MIT, the snippets (both LaTeX and text) [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/).
171
+ The code is licensed [0BSD](https://choosealicense.com/licenses/0bsd/#), the snippets (both LaTeX and text) 0BSD, too.
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.
173
+
174
+ [hyperref]: https://ctan.org/pkg/hyperref
175
+ [listings]: https://ctan.org/pkg/listings
176
+ [minted]: https://ctan.org/pkg/minted
108
177
 
109
- [hyperref]: https://ctan.org/pkg/hyperref
110
- [listings]: https://ctan.org/pkg/listings
111
- [minted]: https://ctan.org/pkg/minted
178
+ <!-- markdownlint-disable-file MD013 MD033 -->