generator-latex-template 0.4.0 → 0.7.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 (30) hide show
  1. package/README.md +9 -11
  2. package/generators/app/index.js +58 -16
  3. package/generators/app/templates/.github/workflows/check.yml +43 -0
  4. package/generators/app/templates/Dockerfile.reitzig +24 -12
  5. package/generators/app/templates/README.en.md +35 -15
  6. package/generators/app/templates/Texlivefile +30 -0
  7. package/generators/app/templates/acronyms.de.tex +6 -0
  8. package/generators/app/templates/acronyms.en.tex +5 -0
  9. package/generators/app/templates/acronyms.example.de.tex +24 -0
  10. package/generators/app/templates/acronyms.example.en.tex +24 -0
  11. package/generators/app/templates/acronyms.preamble.en.tex +15 -0
  12. package/generators/app/templates/biblatex.preamble.de.tex +9 -0
  13. package/generators/app/templates/biblatex.preamble.en.tex +61 -0
  14. package/generators/app/templates/cleveref.example.en.tex +1 -1
  15. package/generators/app/templates/figure.example.de.tex +0 -4
  16. package/generators/app/templates/figure.example.en.tex +2 -6
  17. package/generators/app/templates/latexmkrc +8 -6
  18. package/generators/app/templates/listings.example.de.tex +0 -17
  19. package/generators/app/templates/listings.example.en.tex +6 -6
  20. package/generators/app/templates/main.de.tex +141 -19
  21. package/generators/app/templates/main.en.tex +154 -64
  22. package/generators/app/templates/minted.example.en.tex +5 -5
  23. package/generators/app/templates/minted.preamble.en.tex +13 -2
  24. package/generators/app/templates/refcheck.example.en.tex +36 -0
  25. package/generators/app/templates/refcheck.preamble.en.tex +4 -0
  26. package/generators/app/templates/scientific-thesis-cover.preamble.de.tex +12 -0
  27. package/generators/app/templates/scientific-thesis-cover.preamble.en.tex +12 -0
  28. package/generators/app/templates/{splncsnat.bst → splncs04nat.bst} +156 -118
  29. package/generators/app/templates/subfloat.example.en.tex +2 -2
  30. package/package.json +11 -11
@@ -1,11 +1,7 @@
1
1
  <%= heading2 %>{Abbildungen}
2
2
 
3
3
  <%- bexample %>
4
- <% if (cleveref) { -%>
5
4
  \Cref{fig:label} zeigt etwas Interessantes
6
- <% } else { -%>
7
- Figure~\ref{fig:label} zeigt etwas Interessantes.
8
- <% } -%>
9
5
 
10
6
  \begin{figure}
11
7
  \centering
@@ -1,11 +1,7 @@
1
1
  <%= heading2 %>{Figures}
2
2
 
3
3
  <%- bexample %>
4
- <% if (cleveref) { -%>
5
4
  \Cref{fig:label} shows something interesting.
6
- <% } else { -%>
7
- Figure~\ref{fig:label} shows something interesting.
8
- <% } -%>
9
5
 
10
6
  \begin{figure}
11
7
  \centering
@@ -17,8 +13,8 @@ Figure~\ref{fig:label} shows something interesting.
17
13
  <%- include('floatflt.example.en.tex', this); %>
18
14
  <% if (documentclass == 'ieee') { -%>
19
15
 
20
- One can span a figure across mulitple columns by using \verb+\begin{figure*}+.
21
- See <% if (cleveref) { %>\cref<% } else { %>Fig.~\ref<% } %>{fig:16x9} as an example.
16
+ One can span a figure across multiple columns by using \verb+\begin{figure*}+.
17
+ See \cref{fig:16x9} as an example.
22
18
 
23
19
  <%- bexample %>
24
20
  \begin{figure*}
@@ -11,21 +11,23 @@ $preview_mode = 0;
11
11
  #automatically call lualatex/pdflatex (instead of latex)
12
12
  $pdf_mode = 1;
13
13
 
14
+ # enable deletion of *.bbl when calling "latexmk -c"
15
+ $bibtex_use = 2;
16
+
17
+ # Glossaries inclusion inspired by https://tex.stackexchange.com/a/44316/9075
14
18
  add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
15
19
  add_cus_dep('acn', 'acr', 0, 'run_makeglossaries');
16
20
 
17
21
  sub run_makeglossaries {
18
22
  if ( $silent ) {
19
- system "makeglossaries", "-q", $_[0];
23
+ # we use -lite to avoid an installation of perl
24
+ system "makeglossaries-lite", "-q", $_[0];
20
25
  }
21
26
  else {
22
- system "makeglossaries", $_[0];
27
+ system "makeglossaries-lite", $_[0];
23
28
  };
24
29
  }
25
30
 
26
- # enable deletion of *.bbl when calling "latexmk -c"
27
- $bibtex_use = 2;
28
-
29
31
  #remove more files than in the default configuration
30
- @generated_exts = qw(acn acr alg aux code ist fls glg glo gls glsdefs idx ind lof lot out thm toc tpt wrt upa upb synctex);
32
+ @generated_exts = qw(acn acr alg aux code fls glg glo glo-abr gls glsdefs idx ind ist lof lol lot out run.xml synctex thm toc tpt upa upb wrt);
31
33
  $clean_ext .= ' %R.ist %R.xdy';
@@ -1,13 +1,8 @@
1
1
  <%= heading2 %>{Quellcode}
2
2
 
3
3
  <%- bexample %>
4
- <% if (cleveref) { -%>
5
4
  \Cref{lst:XML} zeigt XML-Quelltext.
6
5
  \Cref{line:comment} enthält einen Kommentar.
7
- <% } else { -%>
8
- Listing~\ref{fig:label} zeigt XML-Quelltext.
9
- Zeile~\ref{line:comment} enthält einen Kommentar.
10
- <% } -%>
11
6
 
12
7
  \begin{lstlisting}[
13
8
  language=XML,
@@ -21,11 +16,7 @@ Zeile~\ref{line:comment} enthält einen Kommentar.
21
16
  <%- eexample %>
22
17
 
23
18
  Der zusätzliche Paramter \verb+float+ führt dazu, dass das Listing auch floated.
24
- <% if (cleveref) { -%>
25
19
  \Cref{lst:flXML} zeigt das gleitendede Listing.
26
- <% } else { -%>
27
- Listing~\ref{lst:flXML} zeigt das gleitendede Listing.
28
- <% } -%>
29
20
 
30
21
  <%- bexample %>
31
22
  \begin{lstlisting}[
@@ -42,11 +33,7 @@ Listing~\ref{lst:flXML} zeigt das gleitendede Listing.
42
33
  \end{lstlisting}
43
34
  <%- eexample %>
44
35
 
45
- <% if (cleveref) { -%>
46
36
  Es ist möglich auch JSON zu setzen, wie in \cref{lst:json} gezeigt.
47
- <% } else { -%>
48
- Es ist möglich auch JSON zu setzen, wie in Listing~\ref{lst:json} gezeigt.
49
- <% } -%>
50
37
 
51
38
  <%- bexample %>
52
39
  \begin{lstlisting}[
@@ -60,11 +47,7 @@ Es ist möglich auch JSON zu setzen, wie in Listing~\ref{lst:json} gezeigt.
60
47
  \end{lstlisting}
61
48
  <%- eexample %>
62
49
 
63
- <% if (cleveref) { -%>
64
50
  Java ist auch möglich -- \cref{lst:java}.
65
- <% } else { -%>
66
- Java ist auch möglich -- Listing~\ref{lst:java}.
67
- <% } -%>
68
51
 
69
52
  <%- bexample %>
70
53
  \begin{lstlisting}[
@@ -1,8 +1,8 @@
1
1
  <%= heading2 %>{Source Code}
2
2
 
3
3
  <%- bexample %>
4
- <% if (cleveref) { %>\Cref<% } else { %>Listing~\ref<% } %>{lst:XML} shows source code written in XML.
5
- <% if (cleveref) { %>\Cref<% } else { %>Line~\ref<% } %>{line:comment} contains a comment.
4
+ \Cref{lst:XML} shows source code written in XML.
5
+ \Cref{line:comment} contains a comment.
6
6
 
7
7
  \begin{lstlisting}[
8
8
  language=XML,
@@ -15,8 +15,8 @@
15
15
  \end{lstlisting}
16
16
  <%- eexample %>
17
17
 
18
- One can also add \verb+float+ as paramter to have the listing floating.
19
- <% if (cleveref) { %>\Cref<% } else { %>Listing~\ref<% } %>{lst:flXML} shows the floating listing.
18
+ One can also add \verb+float+ as parameter to have the listing floating.
19
+ \Cref{lst:flXML} shows the floating listing.
20
20
 
21
21
  <%- bexample %>
22
22
  \begin{lstlisting}[
@@ -33,7 +33,7 @@ One can also add \verb+float+ as paramter to have the listing floating.
33
33
  \end{lstlisting}
34
34
  <%- eexample %>
35
35
 
36
- One can also typeset JSON as shown in <% if (cleveref) { %>\cref<% } else { %>Listing~<% } %>{lst:json}.
36
+ One can also typeset JSON as shown in \cref{lst:json}.
37
37
 
38
38
  <%- bexample %>
39
39
  \begin{lstlisting}[
@@ -47,7 +47,7 @@ One can also typeset JSON as shown in <% if (cleveref) { %>\cref<% } else { %>Li
47
47
  \end{lstlisting}
48
48
  <%- eexample %>
49
49
 
50
- Java is also possible as shown in <% if (cleveref) { %>\cref<% } else { %>Listing~<% } %>{lst:java}.
50
+ Java is also possible as shown in \cref{lst:java}.
51
51
 
52
52
  <%- bexample %>
53
53
  \begin{lstlisting}[
@@ -2,10 +2,11 @@
2
2
  \RequirePackage{snapshot}
3
3
  <% } -%>
4
4
  <% if (documentclass == 'lncs') { -%>
5
- % Dieses Template wurde mit der "LLNCS DOCUMENT CLASS -- version 2.20 (10-Mar-2018)" getestet
5
+ % Dieses Template wurde mit der "LLNCS DOCUMENT CLASS -- version 2.21 (12-Jan-2022)" getestet
6
6
 
7
7
  <% } -%>
8
8
  % !TeX spellcheck = de-DE
9
+ % LTeX: language=de-DE
9
10
  % !TeX encoding = utf8
10
11
  % !TeX program = <%= latexcompiler %>
11
12
  % !BIB program = <%= bibtextool %>
@@ -28,7 +29,7 @@
28
29
  % "runningheads" zeigt Author + Titel auf jeder Seite.
29
30
  % Diese Option nach Aufforderung durch die Herausgeber entfernen.
30
31
  % Während des Schreibens und das Review des Papers hilft das, um z.B. auf konkrete Seitenzahlen einfach verweisen zu können.
31
- \documentclass[ngerman,runningheads,a4paper]{llncs}[2018/03/10]
32
+ \documentclass[runningheads,a4paper,ngerman]{llncs}[2022/01/12]
32
33
  <% } else {-%>
33
34
  \documentclass[
34
35
  % fontsize=11pt is the standard
@@ -43,8 +44,8 @@
43
44
  a4paper, % Standard format - only KOMAScript uses paper=a4 - https://tex.stackexchange.com/a/61044/9075
44
45
  twoside, % we are optimizing for both screen and two-side printing. So the page numbers will jump, but the content is configured to stay in the middle (by using the geometry package)
45
46
  bibliography=totoc,
46
- % idxtotoc, % Index ins Inhaltsverzeichnis
47
- % liststotoc, % List of X ins Inhaltsverzeichnis, mit liststotocnumbered werden die Abbildungsverzeichnisse nummeriert
47
+ % idxtotoc, % Index ins Inhaltsverzeichnis
48
+ % liststotoc, % List of X ins Inhaltsverzeichnis, mit liststotocnumbered werden die Abbildungsverzeichnisse nummeriert
48
49
  headsepline,
49
50
  cleardoublepage=empty,
50
51
  parskip=half,
@@ -126,8 +127,7 @@
126
127
  <%- include('siunitx.preamble.en.tex'); %>
127
128
  <%- include('hyperref.preamble.de.tex', this); %>
128
129
  <% if (texlive >= 2021) { %><%- include('mindflow.preamble.en.tex', this); %><% } -%>
129
- <% if (cleveref) { %><%- include('cleveref.preamble.de.tex', this); %><% } -%>
130
-
130
+ <%- include('cleveref.preamble.de.tex', this); %>
131
131
  \usepackage{lipsum}
132
132
  <% if (examples) { -%>
133
133
 
@@ -136,7 +136,7 @@
136
136
  \usepackage[math]{blindtext}
137
137
  \usepackage{mwe}
138
138
  <% if (useExampleEnvironment) { -%>
139
- \usepackage{currfile}
139
+ \usepackage[realmainfile]{currfile}
140
140
  \usepackage{tcolorbox}
141
141
  \tcbuselibrary{<%= listings %>}
142
142
  <% } -%>
@@ -169,6 +169,11 @@
169
169
  \llncs{book editors and title}{0042} %% 0042 is the start page
170
170
  \fi
171
171
  <% } -%>
172
+ <% if (documentclass == 'scientific-thesis') { -%>
173
+
174
+ <% if (feature.acronyms) { -%><%- include('acronyms.preamble.en.tex', this); %><% } -%>
175
+ <%- include('scientific-thesis-cover.preamble.de.tex', this); %>
176
+ <% } -%>
172
177
  <% if (latexcompiler == "pdflatex") { -%>
173
178
 
174
179
  % Enable copy and paste of text from the PDF
@@ -185,8 +190,7 @@
185
190
  <% } -%>
186
191
 
187
192
  \begin{document}
188
- <% switch (documentclass) {
189
- case "lncs": -%>
193
+ <% switch (documentclass) { case "lncs": -%>
190
194
 
191
195
  \title{Paper Title}
192
196
  % If Title is too long, use \titlerunning
@@ -230,9 +234,12 @@
230
234
  \label{sec:intro}
231
235
  \lipsum[1-3]\todo{Refine me}
232
236
 
233
- The remainder of the paper starts with a presentation of related work (<% if (cleveref) { %>\cref<% } else if (documentclass == 'lncs') { %>Sect.~<% } else { %>Section~<% } %>{sec:relatedwork}).
234
- <% if (examples) { %>It is followed by a presentation of hints on \LaTeX{} (<% if (cleveref) { %>\cref<% } else if (documentclass == 'lncs') { %>Sect.~<% } else { %>Section~<% } %>{sec:latexhints}).<% } -%>
235
- Finally, a conclusion is drawn and outlook on future work is made (<% if (cleveref) { %>\cref<% } else if (documentclass == 'lncs') { %>Sect.~<% } else { %>Section~<% } %>{sec:outlook}).
237
+ The remainder of the paper starts with a presentation of related work (\cref{sec:relatedwork}).
238
+ <% if (examples) { %>It is followed by a presentation of hints on \LaTeX{} (\cref{sec:latexhints}).
239
+ <% } -%>
240
+ <% if (!examples && (documentclass == 'ieee')) { %>Afterwards, we present some Lorem Ipsum (\cref{sec:loremipsum}).
241
+ <% } -%>
242
+ Finally, a conclusion is drawn and outlook on future work is made (\cref{sec:outlook}).
236
243
 
237
244
  \section{Related Work}
238
245
  \label{sec:relatedwork}
@@ -241,10 +248,106 @@ Winery~\cite{Winery} is a graphical \commentontext{modeling}{modeling with one `
241
248
  The whole idea of TOSCA is explained by <% if (available.citet) { %>\citet<% } else { %>Binz et al.~\cite<% } %>{Binz2009}.
242
249
  <% break;
243
250
  default: -%>
244
- \lipsum[1]
245
- <%
246
- break;
247
- } -%>
251
+ \pagenumbering{arabic}
252
+ \Titelblatt
253
+
254
+ %Eigener Seitenstil fuer die Kurzfassung und das Inhaltsverzeichnis
255
+ \deftriplepagestyle{preamble}{}{}{}{}{}{\pagemark}
256
+ %Doku zu deftriplepagestyle: scrguide.pdf
257
+ \pagestyle{preamble}
258
+ \renewcommand*{\chapterpagestyle}{preamble}
259
+
260
+ %Kurzfassung / abstract
261
+ %auch im Stil vom Inhaltsverzeichnis
262
+ \section*{Kurzfassung}
263
+
264
+ <Kurzfassung der Arbeit>
265
+
266
+ \cleardoublepage
267
+
268
+ \microtypesetup{protrusion=false}
269
+
270
+ % In case you have trouble with headings reaching into the page numbers, enable the following three lines.
271
+ % Hint by http://golatex.de/inhaltsverzeichnis-schreibt-ueber-rand-t3106.html
272
+ %
273
+ %\makeatletter
274
+ %\renewcommand{\@pnumwidth}{2em}
275
+ %\makeatother
276
+ %
277
+ % Bei einem ungünstigen Seitenumbruch im Inhaltsverzeichnis, kann dieser mit
278
+ % \addtocontents{toc}{\protect\newpage}
279
+ % an der passenden Stelle im Fließtext erzwungen werden.
280
+ \tableofcontents
281
+
282
+ \listoffigures
283
+
284
+ \listoftables
285
+ <% if (listings == 'listings') { -%>
286
+
287
+ % We use lstlisting environments with caption paramters.
288
+ % Thus, we need that command.
289
+ % Alternative: \listof{Listing}{List of Listings}
290
+ \lstlistoflistings
291
+ <% } else { -%>
292
+
293
+ \listof{Listing}{Verzeichnis der Listings}
294
+ <% } -%>
295
+
296
+ %mittels \newfloat wurde die Algorithmus-Gleitumgebung definiert.
297
+ %Mit folgendem Befehl werden alle floats dieses Typs ausgegeben
298
+ %\listof{Algorithmus}{Verzeichnis der Algorithmen}
299
+ %\listofalgorithms %Ist nur für Algorithmen, die mittels \begin{algorithm} umschlossen werden, nötig
300
+
301
+ % Abkürzungsverzeichnis
302
+ \printnoidxglossaries
303
+
304
+ \microtypesetup{protrusion=true}
305
+
306
+ % Headline and footline
307
+ \renewcommand*{\chapterpagestyle}{scrplain}
308
+ \pagestyle{scrheadings}
309
+ \pagestyle{scrheadings}
310
+ \ihead[]{}
311
+ \chead[]{}
312
+ \ohead[]{\headmark}
313
+ \cfoot[]{}
314
+ \ofoot[\usekomafont{pagenumber}\thepage]{\usekomafont{pagenumber}\thepage}
315
+ \ifoot[]{}
316
+
317
+ \chapter{Einleitung}
318
+ In diesem Kapitel steht die Einleitung zu dieser Arbeit.
319
+ Sie soll nur als Beispiel dienen und hat nichts mit dem Buch \cite{WSPA} zu tun.
320
+ Nun viel Erfolg bei der Arbeit!
321
+
322
+ Bei \LaTeX\ werden Absätze durch freie Zeilen angegeben.
323
+ Da die Arbeit über ein Versionskontrollsystem versioniert wird, ist es sinnvoll, pro \emph{Satz} eine neue Zeile im \texttt{.tex}-Dokument anzufangen.
324
+ So kann einfacher ein Vergleich von Versionsständen vorgenommen werden.
325
+
326
+ Die Arbeit ist in folgender Weise gegliedert:
327
+ In \cref{chap:k2} werden die Grundlagen dieser Arbeit beschrieben.
328
+ Schließlich fasst \cref{chap:zusfas} die Ergebnisse der Arbeit zusammen und stellt Anknüpfungspunkte vor.
329
+
330
+
331
+ \chapter{Kapitel zwei}
332
+ \label{chap:k2}
333
+
334
+ Hier wird der Hauptteil stehen.
335
+ Falls mehrere Kapitel gewünscht, entweder mehrmals \texttt{\textbackslash{}chapter} benutzen oder pro Kapitel eine eigene Datei anlegen und \texttt{ausarbeitung.tex} anpassen.
336
+
337
+ LaTeX-Hinweise stehen in \cref{chap:latextipps}.
338
+
339
+ %noch etwas Fülltext
340
+ \blinddocument
341
+
342
+ \chapter{Verwandte Arbeiten}
343
+ Eine Beschreibung relevanter wissenschaftlicher Arbeiten mit Bezug zur eigenen Arbeit. Der Abschnitt kann je nach Kontext auch an anderer Stelle stehen.
344
+
345
+ \chapter{Zusammenfassung und Ausblick}\label{chap:zusfas}
346
+ Hier bitte einen kurzen Durchgang durch die Arbeit.
347
+
348
+ \section*{Ausblick}
349
+ ...und anschließend einen Ausblick
350
+ <% break; } -%>
248
351
 
249
352
  <% if (examples) { -%>
250
353
  <%= heading1 %>{LaTeX Hinweise}
@@ -309,7 +412,7 @@ Hier sollen allgemeine \LaTeX-Hinweise gegeben werden, damit man Minimalbeispiel
309
412
  <%- include('siunitx.example.en.tex', this); %>
310
413
  <% if (enquotes == 'csquotes') { %><%- include('csquotes.example.en.tex', this); %><% } -%>
311
414
  <% if (enquotes == 'plainlatex') { %><%- include('plainlatex.enquotes.example.de.tex', this); %><% } -%>
312
- <% if (cleveref) { %><%- include('cleveref.example.en.tex', this); %><% } -%>
415
+ <%- include('cleveref.example.en.tex', this); %>
313
416
  <%- include('figure.example.de.tex', this); %>
314
417
  <%- include('tables.example.en.tex', this); %>
315
418
  <% if (listings == 'listings') { -%>
@@ -318,6 +421,8 @@ Hier sollen allgemeine \LaTeX-Hinweise gegeben werden, damit man Minimalbeispiel
318
421
  <%- include('minted.example.en.tex', this); %>
319
422
  <% } -%>
320
423
  <%- include('paralist.example.en.tex', this); %>
424
+ <% if (feature.acronyms) { %><%- include('acronyms.example.de.tex', this); %>
425
+ <% } -%>
321
426
  <%- include('otherfeatures.example.en.tex', this); %>
322
427
  <% } -%>
323
428
 
@@ -335,10 +440,10 @@ When you use \href{https://www.jabref.org}{JabRef}, you can use the clean up com
335
440
  See \url{https://help.jabref.org/en/CleanupEntries} for an overview of the cleanup functionality.
336
441
 
337
442
  \renewcommand{\bibsection}{\section*{Literatur}} % requried for natbib to have "References" printed and as section*, not chapter*
338
- % Use natbib compatbile splncsnat style.
443
+ % Use natbib compatbile splncs04nat style.
339
444
  % It does provide all features of splncs03, but is developed in a clean way.
340
445
  % Source: http://phaseportrait.blogspot.de/2011/02/natbib-compatible-bibtex-style-bst-file.html
341
- \bibliographystyle{splncsnat}
446
+ \bibliographystyle{splncs04nat}
342
447
  \begingroup
343
448
  \microtypecontext{expansion=sloppy}
344
449
  \small % ensure correct font size for the bibliography
@@ -350,5 +455,22 @@ See \url{https://help.jabref.org/en/CleanupEntries} for an overview of the clean
350
455
  %
351
456
  Alle Links wurden zuletzt am 29.03.2021 geprüft.
352
457
  <% } -%>
458
+ <% if (documentclass == 'scientific-thesis') { -%>
459
+
460
+ %%% ===============================================================================
461
+ \appendix
462
+ \addcontentsline{toc}{chapter}{Anhang}
463
+
464
+ %\listoffigures
465
+ %\listoftables
466
+ %%% ===============================================================================
353
467
 
468
+ %%% ===============================================================================
469
+ %<%= heading1 %>{My first appendix}\label{sec:appendix1}
470
+ %%% ===============================================================================
471
+
472
+ \pagestyle{empty}
473
+ \renewcommand*{\chapterpagestyle}{empty}
474
+ \Versicherung
475
+ <% } -%>
354
476
  \end{document}