Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
latextemplates
GitHub Repository: latextemplates/LNCS
Path: blob/main/paper-minted.tex
224 views
1
% This template has been tested with LLNCS DOCUMENT CLASS -- version 2.21 (12-Jan-2022)
2
3
% !TeX spellcheck = en-US
4
% LTeX: language=en-US
5
% !TeX encoding = utf8
6
% !TeX program = lualatex
7
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
8
% !BIB program = bibtex
9
% -*- coding:utf-8 mod:LaTeX -*-
10
11
% "a4paper" enables:
12
%
13
% - easy print out on DIN A4 paper size
14
%
15
% One can configure default page size (a4 vs. letter) in the LaTeX installation.
16
% Thus, it is configuration dependend, what the paper size will be.
17
% Having "a4paper" option present, the page size is set to A4.
18
% Note that the current word template offered by Springer is DIN A4.
19
%
20
% "runningheads" enables:
21
%
22
% - page number on page 2 onwards
23
% - title/authors on even/odd pages
24
%
25
% This is good for other readers to enable proper archiving among other papers and pointing to
26
% content. Even if the title page states the title, when printed and stored in a folder, when
27
% blindly opening the folder, one could hit not the title page, but an arbitrary page. Therefore,
28
% it is good to have title printed on the pages, too.
29
%
30
% The optiion "runningheads" neesd to be removed upon request of the publisher.
31
%
32
% To disable outputting page headers and footers, remove "runningheads"
33
\documentclass[runningheads,a4paper,english]{llncs}[2022/01/12]
34
35
\usepackage{iftex}
36
37
% backticks (`) are rendered as such in verbatim environments.
38
% See following links for details:
39
% - https://tex.stackexchange.com/a/341057/9075
40
% - https://tex.stackexchange.com/a/47451/9075
41
% - https://tex.stackexchange.com/a/166791/9075
42
\usepackage{upquote}
43
44
% Set English as language and allow to write hyphenated"=words
45
%
46
% Even though `american`, `english` and `USenglish` are synonyms for babel package (according to https://tex.stackexchange.com/questions/12775/babel-english-american-usenglish), the llncs document class is prepared to avoid the overriding of certain names (such as "Abstract." -> "Abstract" or "Fig." -> "Figure") when using `english`, but not when using the other 2.
47
% english has to go last to set it as default language
48
\usepackage[ngerman,main=english]{babel}
49
%
50
% Hint by http://tex.stackexchange.com/a/321066/9075 -> enable "= as dashes
51
\addto\extrasenglish{\languageshorthands{ngerman}\useshorthands{"}}
52
53
% Links behave as they should. Enables "\url{...}" for URL typesettings.
54
% Allow URL breaks also at a hyphen, even though it might be confusing: Is the "-" part of the address or just a hyphen?
55
% See https://tex.stackexchange.com/a/3034/9075.
56
\usepackage[hyphens]{url}
57
58
% When activated, use text font as url font, not the monospaced one.
59
% For all options see https://tex.stackexchange.com/a/261435/9075.
60
% \urlstyle{same}
61
62
% Improve wrapping of URLs - hint by http://tex.stackexchange.com/a/10419/9075
63
\makeatletter
64
\g@addto@macro{\UrlBreaks}{\UrlOrds}
65
\makeatother
66
67
% nicer // - solution by http://tex.stackexchange.com/a/98470/9075
68
% DO NOT ACTIVATE -> prevents line breaks
69
%\makeatletter
70
%\def\Url@twoslashes{\mathchar`\/\@ifnextchar/{\kern-.2em}{}}
71
%\g@addto@macro\UrlSpecials{\do\/{\Url@twoslashes}}
72
%\makeatother
73
74
%% !!! If you change the font, be sure that words such as "workflow" can
75
%% !!! still be copied from the PDF. If this is not the case, you have
76
%% !!! to use glyphtounicode. See comment at cmap package.
77
%%
78
%% Background: "workflow" contains "fl" which is a ligature, which in turn
79
%% is rendered as one character in the PDF and needs to be split
80
%% whily copying.
81
82
\ifluatex
83
\usepackage[no-math]{fontspec}
84
\usepackage{unicode-math}
85
86
% Typewriter font (for source code etc)
87
% Use New Computer Modern font (Computer Modern is the default LaTeX font; this is the implemented modern variant)
88
% Source: https://tug.org/FontCatalogue/newcomputermoderntypewriter/
89
90
\setmainfont[
91
ItalicFont=NewCM10-Italic.otf,
92
BoldFont=NewCM10-Bold.otf,
93
BoldItalicFont=NewCM10-BoldItalic.otf,
94
SmallCapsFeatures={Numbers=OldStyle}]{NewCM10-Regular.otf}
95
96
\setsansfont[
97
ItalicFont=NewCMSans10-Oblique.otf,
98
BoldFont=NewCMSans10-Bold.otf,
99
BoldItalicFont=NewCMSans10-BoldOblique.otf,
100
SmallCapsFeatures={Numbers=OldStyle}]{NewCMSans10-Regular.otf}
101
102
\setmonofont[ItalicFont=NewCMMono10-Italic.otf,
103
BoldFont=NewCMMono10-Bold.otf,
104
BoldItalicFont=NewCMMono10-BoldOblique.otf,
105
SmallCapsFeatures={Numbers=OldStyle}]{NewCMMono10-Regular.otf}
106
107
\setmathfont{NewCMMath-Regular.otf}
108
109
% Enable proper ligatures
110
% For more information see https://ctan.org/pkg/selnolig
111
% language "english" or "ngerman" is passed to selnolig by the document class
112
\usepackage{selnolig}
113
114
\else
115
% This is the modern package for "Computer Modern".
116
% In case this gets activated, one has to switch from cmap package to glyphtounicode (in the case of pdflatex)
117
\usepackage[%
118
rm={oldstyle=false,proportional=true},%
119
sf={oldstyle=false,proportional=true},%
120
% By using 'variable=true' the monospaced font can be used as variable font (with differents widths per letter)
121
% However, this makes listings look ugly.
122
tt={oldstyle=false,proportional=true,variable=false},%
123
qt=false%
124
]{cfr-lm}
125
126
% Has to be loaded AFTER any font packages. See https://tex.stackexchange.com/a/2869/9075.
127
\usepackage[T1]{fontenc}
128
\fi
129
130
% Character protrusion and font expansion. See http://www.ctan.org/tex-archive/macros/latex/contrib/microtype/
131
132
\usepackage[
133
babel=true, % Enable language-specific kerning. Take language-settings from the languge of the current document (see Section 6 of microtype.pdf)
134
expansion=alltext,
135
protrusion=alltext-nott, % Ensure that at listings, there is no change at the margin of the listing
136
% In the standard configuration, this template is always in the final mode, so this option only makes a difference if "pros" use the draft mode
137
final % Always enable microtype, even if in draft mode. This helps finding bad boxes quickly.
138
]{microtype}
139
140
% \texttt{test -- test} keeps the "--" as "--" (and does not convert it to an en dash)
141
\DisableLigatures{encoding = T1, family = tt* }
142
143
%\DeclareMicrotypeSet*[tracking]{my}{ font = */*/*/sc/* }%
144
%\SetTracking{ encoding = *, shape = sc }{ 45 }
145
% Source: http://homepage.ruhr-uni-bochum.de/Georg.Verweyen/pakete.html
146
% Deactiviated, because does not look good
147
148
\usepackage{graphicx}
149
150
% Diagonal lines in a table - http://tex.stackexchange.com/questions/17745/diagonal-lines-in-table-cell
151
% Slashbox is not available in texlive (due to licensing) and also gives bad results. Thus, we use diagbox
152
\usepackage{diagbox}
153
154
\ifluatex
155
\usepackage{spelling}
156
\spellingoutput{off}
157
\fi
158
159
\usepackage[dvipsnames, table]{xcolor}
160
% See https://github.com/gpoore/minted
161
\usepackage[newfloat]{minted}
162
163
\setminted{
164
% Line numbers not flowing out of the margin
165
numbersep=5pt,
166
xleftmargin=12pt,
167
%
168
% Better listing breaking
169
breakafter=-/\{,
170
breakbefore=\\
171
%
172
% Alternative: Rely on pygment's tokenizer. Does not work well with LaTeX and comments
173
% breakbytoken=true,
174
% breakbytokenanywhere=true
175
}
176
177
%\usemintedstyle{bw} %black and white style
178
%\usemintedstyle{vs} %visual studio
179
\usemintedstyle{friendly_grayscale}
180
%\usemintedstyle{friendly}
181
%\usemintedstyle{eclipse} %http://www.jevon.org/wiki/Eclipse_Pygments_Style
182
%\usemintedstyle{autumn}
183
%\usemintedstyle{rrt}
184
%\usemintedstyle{borland}
185
186
% We need to load caption to have a bold font on the label
187
% The other parameters mimic the layout of the LNCS class
188
\usepackage[labelfont=bf,font=small,skip=4pt]{caption}
189
\SetupFloatingEnvironment{listing}{name=List.,within=none}
190
191
% When using both minted and listings
192
% Compatibility of packages minted and listings with respect to the numbering of "List." caption
193
% Source: https://tex.stackexchange.com/a/269510/9075
194
% \AtBeginEnvironment{listing}{\setcounter{listing}{\value{lstlisting}}}
195
% \AtEndEnvironment{listing}{\stepcounter{lstlisting}}
196
197
% Intermediate solution for hyperlinked refs. See https://tex.stackexchange.com/q/132420/9075 for more information.
198
\newcommand{\labelline}[1]{\label[line]{#1}\hypertarget{#1}{}}
199
\newcommand{\refline}[1]{\hyperlink{#1}{\FancyVerbLineautorefname~\ref*{#1}}}
200
201
% For easy quotations: \enquote{text}
202
% This package is very smart when nesting is applied, otherwise textcmds (see below) provides a shorter command
203
\usepackage[autostyle=true]{csquotes}
204
205
% Enable using "`quote"' - see https://tex.stackexchange.com/a/150954/9075
206
\defineshorthand{"`}{\openautoquote}
207
\defineshorthand{"'}{\closeautoquote}
208
209
% Nicer tables (\toprule, \midrule, \bottomrule)
210
\usepackage{booktabs}
211
212
% Extended enumerate, such as \begin{compactenum}
213
\usepackage{paralist}
214
215
% Bibliopgraphy enhancements
216
% - enable \cite[prenote][]{ref}
217
% - enable \cite{ref1,ref2}
218
% Alternative: \usepackage{cite}, which enables \cite{ref1, ref2} only (otherwise: Error message: "White space in argument")
219
220
% Doc: http://texdoc.net/natbib
221
\usepackage[%
222
square, % for square brackets
223
comma, % use commas as separators
224
numbers, % for numerical citations;
225
%sort % orders multiple citations into the sequence in which they appear in the list of references;
226
sort&compress % as sort but in addition multiple numerical citations are compressed if possible (as 3-6, 15);
227
]{natbib}
228
229
% In the bibliography, references have to be formatted as 1., 2., ... not [1], [2], ...
230
\renewcommand{\bibnumfmt}[1]{#1.}
231
232
% Enable hyperlinked author names in the case of \citet
233
% Source: https://tex.stackexchange.com/a/76075/9075
234
\usepackage{etoolbox}
235
\makeatletter
236
\patchcmd{\NAT@test}{\else \NAT@nm}{\else \NAT@hyper@{\NAT@nm}}{}{}
237
\makeatother
238
239
% Prepare more space-saving rendering of the bibliography
240
% Source: https://tex.stackexchange.com/a/280936/9075
241
\SetExpansion
242
[ context = sloppy,
243
stretch = 30,
244
shrink = 60,
245
step = 5 ]
246
{ encoding = {OT1,T1,TS1} }
247
{ }
248
249
% Put figures aside a text
250
% Even though the package is from 1998, it works well
251
\usepackage[rflt]{floatflt}
252
253
% Farbige Tabellen
254
% ----------------
255
% Das Paket colortbl wird inzwischen automatisch durch xcolor geladen
256
%
257
% Erweiterte Funktionen innerhalb von Tabellen
258
% --------------------------------------------
259
%%% Doc: http://mirror.ctan.org/tex-archive/macros/latex/contrib/multirow/multirow.sty
260
\usepackage{multirow} % Mehrfachspalten
261
%
262
%%% Doc: Documentation inside dtx Package
263
\usepackage{dcolumn} % Ausrichtung an Komma oder Punkt
264
265
%%% Doc: http://mirror.ctan.org/tex-archive/macros/latex/contrib/supertabular/supertabular.pdf
266
%\usepackage{supertabular}
267
268
%%% Fussnoten/Endnoten ===================================================
269
270
% EN: Put footnotes below floats
271
% DE: Fußnoten unter Gleitumgebungen ("floats") platzieren
272
% Source: https://tex.stackexchange.com/a/32993/9075
273
\usepackage{stfloats}
274
\fnbelowfloat
275
276
% EN: Extended support for footnotes
277
% DE: Fußnoten
278
%
279
%\usepackage{dblfnote} %Zweispaltige Fußnoten
280
%
281
% Keine hochgestellten Ziffern in der Fußnote (KOMA-Script-spezifisch):
282
%\deffootnote[1.5em]{0pt}{1em}{\makebox[1.5em][l]{\bfseries\thefootnotemark}}
283
%
284
% Abstand zwischen Fußnoten vergrößern:
285
%\setlength{\footnotesep}{.85\baselineskip}
286
%
287
% EN: Following command disables the separting line of the footnote
288
% DE: Folgendes Kommando deaktiviert die Trennlinie zur Fußnote
289
%\renewcommand{\footnoterule}{}
290
%
291
%\addtolength{\skip\footins}{\baselineskip} % Abstand Text <-> Fußnote
292
293
% DE: Fußnoten immer ganz unten auf einer \raggedbottom-Seite
294
% DE: fnpos kommt aus dem yafoot package
295
%\usepackage{fnpos}
296
%\makeFNbelow
297
%\makeFNbottom
298
299
% TODO (and comment) configuration
300
%
301
% - \todo (from todo, easy-todo, todonotes) / \TODO (from fixmetodonotes) - for "normal" TODOs
302
% - \todofix - "important" TODOs
303
%
304
% - \textcomment - highlights text and has a hover comment
305
% - \sidecomment - just puts a comment to the side. Note: \comment MUST NOT be used as command name, it is already defined by much packages (mathdesign, mindflow, verbatim, and others)
306
%
307
% - \missingfigure
308
%
309
% - \textmarker
310
% - \modified
311
% - \change - adresses a review comment
312
313
% Enable nice comments
314
\usepackage{pdfcomment}
315
316
\newcommand{\textcomment}[2]{\colorbox{yellow!60}{#1}\pdfcomment[color={0.234 0.867 0.211},hoffset=-6pt,voffset=10pt,opacity=0.5]{#2}}
317
318
% Small PDF comment
319
% 1. Parameter: Comment
320
\newcommand{\sidecomment}[1]{\pdfcomment[color={0.045 0.278 0.643},voffset=4pt,icon=Note]{#1}}
321
% Disabled variant - for the final PDF
322
%\newcommand{\sidecomment}[1]{}
323
324
\newcommand{\todo}[1]{TODO!\sidecomment{#1}}
325
326
% Änderungen
327
%
328
% 1. Parameter: Review-Kommentar
329
% 2. Parameter: Neuer Text
330
\newcommand{\change}[2]{{\color{red}#2}\pdfcomment[color={0.234 0.867 0.211},voffset=8pt,opacity=0.5]{#1}}
331
% Disabled variant - for the final PDF
332
%\newcommand{\change}[2]{#2}
333
334
% Define default commands
335
\makeatletter
336
\@ifundefined{missingfigure}{\newcommand{\missingfigure}{... missing figure ...}}{}
337
\@ifundefined{textcomment}{\newcommand{\textcomment}[2]{#1 \todo{#2}}}{}
338
\@ifundefined{sidecomment}{\newcommand{\sidecomment}[1]{\marginpar{#1}}}{}
339
\@ifundefined{todo}{\newcommand{\todo}[1]{\sidecomment{#1}}}{}
340
\@ifundefined{TODO}{\newcommand{\TODO}[1]{\todo{#1}}}{}
341
\@ifundefined{todofix}{\newcommand{\todofix}[1]{\todo{#1}}}{}
342
\@ifundefined{change}{\newcommand{\change}[2]{#1 $\rightarrow$ #2}}{}
343
\makeatother
344
345
% Textmarker (Textfarbe rot)
346
\newcommand{\textmarker}[1]{{\color{red} #1}\xspace}
347
348
% Modified (Text blau)
349
\newcommand{\modified}[1]{{\color{blue!60!black} #1}\xspace}
350
351
\usepackage[group-minimum-digits=4,per-mode=fraction]{siunitx}
352
353
% Enable that parameters of \cref{}, \ref{}, \cite{}, ... are linked so that a reader can click on the number an jump to the target in the document
354
\usepackage{hyperref}
355
356
% Enable hyperref without colors and without bookmarks
357
\hypersetup{
358
hidelinks,
359
colorlinks=true, % Links erhalten Farben statt Kaeten
360
raiselinks=true, % calculate real height of the link
361
allcolors=black,
362
pdfstartview=Fit,
363
breaklinks=true, % Links ueberstehen Zeilenumbruch
364
hypertexnames=false, % Fix jumping to algorithm line - http://tex.stackexchange.com/a/156404/9075
365
}
366
367
% Enable correct jumping to figures when referencing
368
\usepackage[all]{hypcap}
369
370
\usepackage[caption=false,font=footnotesize]{subfig}
371
372
% Alternative for making subfigures:
373
% Part of the caption package. See http://www.ctan.org/pkg/caption
374
% Ersetzt die Pakete subfigure und subfig - siehe https://tex.stackexchange.com/a/13778/9075
375
%
376
% (subfigure is outdated. subfig is maintained, but subcaption is better)
377
% See: http://tex.stackexchange.com/questions/13625/subcaption-vs-subfig-best-package-for-referencing-a-subfigure
378
%\usepackage[hypcap=true]{subcaption}
379
380
\usepackage{mindflow}
381
382
% Extensions for references inside the document (\cref{fig:sample}, ...)
383
% Enable usage \cref{...} and \Cref{...} instead of \ref: Type of reference included in the link
384
% That means, "Figure 5" is a full link instead of just "5".
385
\usepackage[capitalise,nameinlink]{cleveref}
386
387
\crefname{section}{Sect.}{Sect.}
388
\Crefname{section}{Section}{Sections}
389
\crefname{listing}{List.}{List.}
390
\crefname{listing}{Listing}{Listings}
391
\Crefname{listing}{Listing}{Listings}
392
393
% Intermediate solution for hyperlinked refs. See https://tex.stackexchange.com/q/132420/9075 for more information.
394
\newcommand{\llabel}[1]{\label[line]{#1}\hypertarget{#1}{}}
395
\newcommand{\lref}[1]{\hyperlink{#1}{\FancyVerbLineautorefname~\ref*{#1}}}
396
397
\usepackage{lipsum}
398
399
% For demonstration purposes only
400
% These packages can be removed when all examples have been deleted
401
\usepackage[math]{blindtext}
402
\usepackage{mwe}
403
\usepackage[realmainfile]{currfile}
404
\usepackage{tcolorbox}
405
\tcbuselibrary{minted}
406
407
%introduce \powerset - hint by http://matheplanet.com/matheplanet/nuke/html/viewtopic.php?topic=136492&post_id=997377
408
\DeclareFontFamily{U}{MnSymbolC}{}
409
\DeclareSymbolFont{MnSyC}{U}{MnSymbolC}{m}{n}
410
\DeclareFontShape{U}{MnSymbolC}{m}{n}{
411
<-6> MnSymbolC5
412
<6-7> MnSymbolC6
413
<7-8> MnSymbolC7
414
<8-9> MnSymbolC8
415
<9-10> MnSymbolC9
416
<10-12> MnSymbolC10
417
<12-> MnSymbolC12%
418
}{}
419
\DeclareMathSymbol{\powerset}{\mathord}{MnSyC}{180}
420
421
% Allows for defining commands that don't eat spaces.
422
\usepackage{xspace}
423
% Adds compatibility to \xspace und \enquote
424
\makeatletter
425
\xspaceaddexceptions{\grqq \grq \csq@qclose@i \} }
426
\makeatother
427
428
\newcommand{\eg}{e.g.,\ }
429
\newcommand{\ie}{i.e.,\ }
430
431
% Enable hyphenation at other places as the dash.
432
% Example: applicaiton\hydash specific
433
\makeatletter
434
\newcommand{\hydash}{\penalty\@M-\hskip\z@skip}
435
% Definition of "= taken from http://mirror.ctan.org/macros/latex/contrib/babel-contrib/german/ngermanb.dtx
436
\makeatother
437
438
% Add manual adapted hyphenation of English words
439
% See https://ctan.org/pkg/hyphenex and https://tex.stackexchange.com/a/22892/9075 for details
440
\input{ushyphex}
441
442
% correct bad hyphenation here
443
\hyphenation{
444
op-tical net-works semi-conduc-tor
445
% May not be hypphenated
446
AROMA TOSCA BPMN OASIS OMG DMTF IT DevOps
447
}
448
449
\input{commands}
450
451
% Add copyright
452
%
453
% This is recommended if you intend to send the version to colleagues
454
% See https://ctan.org/pkg/llncsconf for details
455
\iffalse
456
% state: intended | submitted | llncs
457
% you can add "crop" if the paper should be cropped to the format Springer is publishing
458
\usepackage[intended]{llncsconf}
459
460
\conference{name of the conference}
461
462
% in case of "proceedings" (final version!)
463
% example: \llncs{Anonymous et al. (eds). \emph{Proceedings of the International Conference on \LaTeX-Hacks}, LNCS~42. Some Publisher, 2016.}{0042}
464
% 0042 denotes an example start page
465
\llncs{book editors and title}{0042}
466
\fi
467
468
\ifpdftex
469
% Enable copy and paste of text from the PDF
470
% Only required for pdflatex. It "just works" in the case of lualatex.
471
% Alternative: cmap or mmap package
472
% mmap enables mathematical symbols, but does not work with the newtx font set
473
% See: https://tex.stackexchange.com/a/64457/9075
474
% Other solutions outlined at http://goemonx.blogspot.de/2012/01/pdflatex-ligaturen-und-copynpaste.html and http://tex.stackexchange.com/questions/4397/make-ligatures-in-linux-libertine-copyable-and-searchable
475
% Trouble shooting outlined at https://tex.stackexchange.com/a/100618/9075
476
%
477
% According to https://tex.stackexchange.com/q/451235/9075 this is the way to go
478
\input{glyphtounicode}
479
\pdfgentounicode=1
480
\fi
481
\begin{document}
482
483
\title{Paper Title}
484
% If Title is too long, use \titlerunning
485
%\titlerunning{Short Title}
486
487
% Single insitute
488
\author{Firstname Lastname \and Firstname Lastname}
489
490
% If there are too many authors, use \authorrunning
491
%\authorrunning{First Author et al.}
492
493
\institute{Institute}
494
495
%% Multiple insitutes - ALTERNATIVE to the above
496
% \author{%
497
% Firstname Lastname\inst{1} \and
498
% Firstname Lastname\inst{2}
499
% }
500
%
501
%If there are too many authors, use \authorrunning
502
% \authorrunning{First Author et al.}
503
%
504
% \institute{
505
% Insitute 1\\
506
% \email{...}\and
507
% Insitute 2\\
508
% \email{...}
509
%}
510
511
\maketitle
512
513
\begin{abstract}
514
\lipsum[1]
515
516
\keywords{First keyword \and Second keyword \and Third keyword}
517
\end{abstract}
518
519
520
\section{Introduction}
521
\label{sec:introduction}
522
\lipsum[1-3]\todo{Refine me}
523
524
The remainder of the paper starts with a presentation of related work (\cref{sec:relatedwork}).
525
It is followed by a presentation of hints on \LaTeX{} (\cref{sec:latexhints}).
526
Finally, a conclusion is drawn and outlook on future work is made (\cref{sec:outlook}).
527
528
\section{Related Work}
529
\label{sec:relatedwork}
530
531
Winery~\cite{Winery} is a graphical \textcomment{modeling}{modeling with one ``l'', because of American English} tool.
532
The whole idea of TOSCA is explained by \citet{Binz2009}.
533
534
\section{LaTeX Hints}
535
\label{sec:latexhints}
536
537
% Required for proper example rendering in the compiled PDF
538
\newcount\LTGbeginlineexample
539
\newcount\LTGendlineexample
540
\newenvironment{ltgexample}%
541
{\LTGbeginlineexample=\numexpr\inputlineno+1\relax}%
542
{\LTGendlineexample=\numexpr\inputlineno-1\relax%
543
\tcbinputlisting{%
544
listing only,
545
listing file=\currfilepath,
546
colback=green!5!white,
547
colframe=green!25,
548
coltitle=black!90,
549
coltext=black!90,
550
left=8mm,
551
title=Corresponding \LaTeX{} code of \texttt{\currfilepath},
552
minted language=TeX,
553
minted style=vs,
554
minted options={
555
fontsize=\footnotesize,
556
firstline=\the\LTGbeginlineexample,
557
lastline=\the\LTGendlineexample,
558
firstnumber=\the\LTGbeginlineexample,
559
breaklines,
560
linenos,
561
numbersep=8pt
562
}
563
}
564
}%
565
566
This section contains hints on writing LaTeX.
567
It focuses on minimal examples, which can be directly adapted to the content
568
569
\subsection{Handling of paragraphs}
570
571
\begin{ltgexample}
572
One sentence per line.
573
This rule is important for the usage of version control systems.
574
A new line is generated with a blank line.
575
As you would do in Word:
576
New paragraphs are generated by pressing enter.
577
In LaTeX, this does not lead to a new paragraph as LaTeX joins subsequent lines.
578
In case you want a new paragraph, just press enter twice!
579
This leads to an empty line.
580
In word, there is the functionality to press shift and enter.
581
This leads to a hard line break.
582
The text starts at the beginning of a new line.
583
In LaTeX, you can do that by using two backslashes (\textbackslash\textbackslash).
584
\\
585
This is rarely used.
586
587
Please do \textit{not} use two backslashes for new paragraphs.
588
For instance, this sentence belongs to the same paragraph, whereas the last one started a new one.
589
A long motivation for that is provided at \url{http://loopspace.mathforge.org/HowDidIDoThat/TeX/VCS/#section.3}.
590
\end{ltgexample}
591
592
\subsection{Notes separated from the text}
593
594
The package mindflow enables writing down notes and annotations in a way so that they are separated from the main text.
595
596
\begin{ltgexample}
597
\begin{mindflow}
598
This is a small note.
599
\end{mindflow}
600
\end{ltgexample}
601
602
\subsection{Handling TODOs}
603
604
\begin{ltgexample}
605
\textmarker{Markierter Text.}
606
\end{ltgexample}
607
608
Bei \verb1\textmarker1 wird nur die Textfarbe geändert, da dies auch bei einigen Worten gut funktioniert.
609
610
\begin{ltgexample}
611
\textcomment{Markierter Text.}{Kommentar dazu.}
612
\end{ltgexample}
613
614
\begin{ltgexample}
615
\modified{Manuelle Markierung für Text, der seit der letzten Version geändert wurde.}
616
\end{ltgexample}
617
618
\begin{ltgexample}
619
Das ist ein Text.
620
\change{FL1: Text angepasst}{Geänderter Text}.
621
\end{ltgexample}
622
623
\begin{ltgexample}
624
Hier nur ein Kommentar\sidecomment{Kommentar}.
625
\end{ltgexample}
626
627
\begin{ltgexample}
628
\todo{Hier muss noch kräftig Text produziert werden}
629
\end{ltgexample}
630
631
\subsection{Hyphenation}
632
633
\LaTeX{} automatically hyphenates words.
634
When using \href{https://ctan.org/pkg/microtype}{microtype}, there should be fewer hyphenations than in other settings.
635
It might be necessary to tweak the hyphenations nevertheless.
636
Here are some hints:
637
638
\begin{ltgexample}
639
In case you write \enquote{application-specific}, then the word will only be hyphenated at the dash.
640
You can also write \verb1applica\allowbreak{}tion-specific1 (result: applica\allowbreak{}tion-specific), but this is much more effort.
641
642
You can now write words containing hyphens which are hyphenated at other places in the word.
643
For instance, \verb1application"=specific1 gets application"=specific.
644
This is enabled by an additional configuration of the babel package.
645
\end{ltgexample}
646
647
\subsection{Typesetting Units}
648
649
\begin{ltgexample}
650
Numbers can be written plain text (such as 100), by using the \href{https://ctan.org/pkg/siunitx}{siunitx} package as follows:
651
\SI{100}{\km\per\hour},
652
or by using plain \LaTeX{} (and math mode):
653
$100 \frac{\mathit{km}}{h}$.
654
\end{ltgexample}
655
656
\begin{ltgexample}
657
\SI{5}{\percent} of \SI{10}{kg}
658
\end{ltgexample}
659
660
\begin{ltgexample}
661
Numbers are automatically grouped: \num{123456}.
662
\end{ltgexample}
663
664
\subsection{Surrounding Text by Quotes}
665
666
\begin{ltgexample}
667
Please use the \enquote{enquote command} to quote something.
668
Quoting with "`quote"' or ``quote'' also works.
669
670
\end{ltgexample}
671
672
\subsection{Cleveref examples}
673
\label{sec:ex:cref}
674
675
Cleveref demonstration: Cref at beginning of sentence, cref in all other cases.
676
677
\begin{figure}
678
\centering
679
\includegraphics[width=.75\linewidth]{example-image-a}
680
\caption{Example figure for cref demo}
681
\label{fig:ex:cref}
682
\end{figure}
683
684
\begin{table}
685
\centering
686
\begin{tabular}{ll}
687
\toprule
688
Heading1 & Heading2 \\
689
\midrule
690
One & Two \\
691
Thee & Four \\
692
\bottomrule
693
\end{tabular}
694
\caption{Example table for cref demo}
695
\label{tab:ex:cref}
696
\end{table}
697
698
\begin{ltgexample}
699
\Cref{fig:ex:cref} shows a simple fact, although \cref{fig:ex:cref} could also show something else.
700
701
\Cref{tab:ex:cref} shows a simple fact, although \cref{tab:ex:cref} could also show something else.
702
703
\Cref{sec:ex:cref} shows a simple fact, although \cref{sec:ex:cref} could also show something else.
704
\end{ltgexample}
705
706
\subsection{Figures}
707
708
\begin{ltgexample}
709
\Cref{fig:label} shows something interesting.
710
711
\begin{figure}
712
\centering
713
\includegraphics[width=.8\linewidth]{example-image-golden}
714
\caption[Simple Figure]{
715
Simple Figure.
716
Based on \citet{mwe}.
717
}
718
\label{fig:label}
719
\end{figure}
720
\end{ltgexample}
721
722
One can also have pictures floating inside text:
723
\clearpage
724
725
\begin{ltgexample}
726
\begin{floatingfigure}{.33\linewidth}
727
\includegraphics[width=.29\linewidth]{example-image-a}
728
\caption{A floating figure}
729
\end{floatingfigure}
730
\lipsum[2]
731
\end{ltgexample}
732
733
\subsection{Sub Figures}
734
735
An example of two sub figures is shown in \cref{fig:two_sub_figures}.
736
737
\begin{ltgexample}
738
\begin{figure}[!b]
739
\centering
740
\subfloat[Case I]{\includegraphics[width=.4\linewidth]{example-image-a}%
741
\label{fig:first_case}}
742
\hfil
743
\subfloat[Case II]{\includegraphics[width=.4\linewidth]{example-image-b}%
744
\label{fig:second_case}}
745
\caption{Example figure with two sub figures.}
746
\label{fig:two_sub_figures}
747
\end{figure}
748
\end{ltgexample}
749
750
\subsection{Tables}
751
752
\begin{ltgexample}
753
\begin{table}
754
\caption{Simple Table}
755
\label{tab:simple}
756
\centering
757
\begin{tabular}{ll}
758
\toprule
759
Heading1 & Heading2 \\
760
\midrule
761
One & Two \\
762
Thee & Four \\
763
\bottomrule
764
\end{tabular}
765
\end{table}
766
\end{ltgexample}
767
768
\begin{ltgexample}
769
% Source: https://tex.stackexchange.com/a/468994/9075
770
\begin{table}
771
\caption{Table with diagonal line}
772
\label{tab:diag}
773
\begin{center}
774
\begin{tabular}{|l|c|c|}
775
\hline
776
\diagbox[width=10em]{Diag \\Column Head I}{Diag Column\\Head II} & Second & Third \\
777
\hline
778
& foo & bar \\
779
\hline
780
\end{tabular}
781
\end{center}
782
\end{table}
783
\end{ltgexample}
784
785
786
\subsection{Source Code}
787
788
\href{https://github.com/gpoore/minted}{minted} is a sophisticated package to enable properly highlighted listings.
789
It uses the \href{http://pygments.org/}{pygments} library, which in turn requires Python.
790
791
\begin{ltgexample}
792
\Cref{lst:XML} shows source code written in XML.
793
\refline{line:comment} contains a comment.
794
795
\begin{listing}[htbp]
796
\begin{minted}[linenos=true,escapeinside=||]{xml}
797
<listing name="example">
798
<!-- comment --> |\labelline{line:comment}|
799
<content>not interesting</content>
800
</listing>
801
\end{minted}
802
\caption{Example XML listing using minted}
803
\label{lst:XML}
804
\end{listing}
805
\end{ltgexample}
806
807
One can also typeset JSON as shown in \cref{lst:flJSON}.
808
809
\begin{ltgexample}
810
\begin{listing}[htbp]
811
\begin{minted}[linenos=true,escapeinside=||]{json}
812
{
813
key: "value"
814
}
815
\end{minted}
816
\caption{Example JSON listing using minted}
817
\label{lst:flJSON}
818
\end{listing}
819
\end{ltgexample}
820
821
Java is also possible as shown in \cref{lst:flJava}.
822
823
\begin{ltgexample}
824
\begin{listing}[htbp]
825
\begin{minted}[linenos=true,escapeinside=||]{java}
826
public class Hello {
827
public static void main (String[] args) {
828
System.out.println("Hello World!");
829
}
830
}
831
\end{minted}
832
\caption{Java code rendered using minted}
833
\label{lst:flJava}
834
\end{listing}
835
\end{ltgexample}
836
837
\subsection{Itemization}
838
839
One can list items as follows:
840
841
\begin{ltgexample}
842
\begin{itemize}
843
\item Item One
844
\item Item Two
845
\end{itemize}
846
\end{ltgexample}
847
848
849
One can enumerate items as follows:
850
851
\begin{ltgexample}
852
\begin{enumerate}
853
\item Item One
854
\item Item Two
855
\end{enumerate}
856
\end{ltgexample}
857
858
859
With paralist, one can even have all items typeset after each other and have them clean in the TeX document:
860
861
\begin{ltgexample}
862
\begin{inparaenum}
863
\item All these items...
864
\item ...appear in one line
865
\item This is enabled by the paralist package.
866
\end{inparaenum}
867
\end{ltgexample}
868
869
\subsection{Other Features}
870
871
\begin{ltgexample}
872
The words \enquote{workflow} and \enquote{dwarflike} can be copied from the PDF and pasted to a text file.
873
\end{ltgexample}
874
875
\begin{ltgexample}
876
The symbol for powerset is now correct: $\powerset$ and not a Weierstrass p ($\wp$).
877
878
$\powerset({1,2,3})$
879
\end{ltgexample}
880
881
\begin{ltgexample}
882
Brackets work as designed:
883
<test>
884
One can also input backticks in verbatim text: \verb|`test`|.
885
\end{ltgexample}
886
887
888
\section{Conclusion and Outlook}
889
\label{sec:outlook}
890
\lipsum[1-2]
891
892
\subsubsection*{Acknowledgments}
893
894
Identification of funding sources and other support, and thanks to individuals and groups that assisted in the research and the preparation of the work should be included in an acknowledgment section, which is placed just before the reference section in your document \cite{acmart}.
895
896
%%% ===============================================================================
897
%%% Bibliography
898
%%% ===============================================================================
899
900
In the bibliography, use \texttt{\textbackslash textsuperscript} for \enquote{st}, \enquote{nd}, \ldots:
901
E.g., \enquote{The 2\textsuperscript{nd} conference on examples}.
902
When you use \href{https://www.jabref.org}{JabRef}, you can use the clean up command to achieve that.
903
See \url{https://help.jabref.org/en/CleanupEntries} for an overview of the cleanup functionality.
904
905
\renewcommand{\bibsection}{\section*{References}} % requried for natbib to have "References" printed and as section*, not chapter*
906
% Use natbib compatbile splncs04nat style.
907
% It does provide all features of splncs04.bst, but is developed in a clean way.
908
% Source: https://github.com/tpavlic/splncs04nat
909
\bibliographystyle{splncs04nat}
910
\begingroup
911
\microtypecontext{expansion=sloppy}
912
\small % ensure correct font size for the bibliography
913
\bibliography{paper}
914
\endgroup
915
916
% Enfore empty line after bibliography
917
\ \\
918
%
919
\noindent
920
All links were last followed on October 5, 2020.
921
922
%%% ===============================================================================
923
%\appendix
924
%\addcontentsline{toc}{chapter}{APPENDICES}
925
926
%\listoffigures
927
%\listoftables
928
%%% ===============================================================================
929
930
%%% ===============================================================================
931
%\section{My first appendix}\label{sec:appendix1}
932
%%% ===============================================================================
933
\end{document}
934
935