This repository has been archived by the owner on Apr 23, 2021. It is now read-only.
forked from latextemplates/LNCS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
paper-minted.tex
562 lines (480 loc) · 18.4 KB
/
paper-minted.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
% This template has been tested with LLNCS DOCUMENT CLASS -- version 2.20 (10-Mar-2018)
% !TeX spellcheck = en-US
% !TeX encoding = utf8
% !TeX program = pdflatex
% !TeX TXS-program:compile = txs:///pdflatex/[--shell-escape]
% !BIB program = bibtex
% -*- coding:utf-8 mod:LaTeX -*-
% "a4paper" enables:
% - easy print out on DIN A4 paper size
%
% One can configure a4 vs. letter in the LaTeX installation. So it is configuration dependend, what the paper size will be.
% This option present, because the current word template offered by Springer is DIN A4.
% We accept that DIN A4 cause WTFs at persons not used to A4 in USA.
% "runningheads" enables:
% - page number on page 2 onwards
% - title/authors on even/odd pages
% This is good for other readers to enable proper archiving among other papers and pointing to
% content. Even if the title page states the title, when printed and stored in a folder, when
% blindly opening the folder, one could hit not the title page, but an arbitrary page. Therefore,
% it is good to have title printed on the pages, too.
%
% It is enabled by default as the springer template as of 2018/03/10 uses this as default
% German documents: pass ngerman as class option
% \documentclass[ngerman,runningheads,a4paper]{llncs}[2018/03/10]
% English documents: pass english as class option
\documentclass[english,runningheads,a4paper]{llncs}[2018/03/10]
%% If you need packages for other papers,
%% START COPYING HERE
% Set English as language and allow to write hyphenated"=words
%
% In case you write German, switch the parameters, so that the command becomes
%\usepackage[english,ngerman]{babel}
%
% 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.
% english has to go last to set it as default language
\usepackage[ngerman,english]{babel}
%
% Hint by http://tex.stackexchange.com/a/321066/9075 -> enable "= as dashes
\addto\extrasenglish{\languageshorthands{ngerman}\useshorthands{"}}
%
% Fix by https://tex.stackexchange.com/a/441701/9075
\usepackage{regexpatch}
\makeatletter
\edef\switcht@albion{%
\relax\unexpanded\expandafter{\switcht@albion}%
}
\xpatchcmd*{\switcht@albion}{ \def}{\def}{}{}
\xpatchcmd{\switcht@albion}{\relax}{}{}{}
\edef\switcht@deutsch{%
\relax\unexpanded\expandafter{\switcht@deutsch}%
}
\xpatchcmd*{\switcht@deutsch}{ \def}{\def}{}{}
\xpatchcmd{\switcht@deutsch}{\relax}{}{}{}
\edef\switcht@francais{%
\relax\unexpanded\expandafter{\switcht@francais}%
}
\xpatchcmd*{\switcht@francais}{ \def}{\def}{}{}
\xpatchcmd{\switcht@francais}{\relax}{}{}{}
\makeatother
\usepackage{ifluatex}
\ifluatex
\usepackage{fontspec}
\usepackage[english]{selnolig}
\fi
\iftrue % use default-font
\ifluatex
% use the better (sharper, ...) Latin Modern variant of Computer Modern
\setmainfont{Latin Modern Roman}
\setsansfont{Latin Modern Sans}
\setmonofont{Latin Modern Mono} % "variable=false"
%\setmonofont{Latin Modern Mono Prop} % "variable=true"
\else
% better font, similar to the default springer font
% cfr-lm is preferred over lmodern. Reasoning at http://tex.stackexchange.com/a/247543/9075
\usepackage[%
rm={oldstyle=false,proportional=true},%
sf={oldstyle=false,proportional=true},%
tt={oldstyle=false,proportional=true,variable=false},%
qt=false%
]{cfr-lm}
\fi
\else
% In case more space is needed, it is accepted to use Times New Roman
\ifluatex
\setmainfont{TeX Gyre Termes}
\setsansfont[Scale=.9]{TeX Gyre Heros}
% newtxtt looks good with times, but no equivalent for lualatex found,
% therefore tried to replace with inconsolata.
% However, inconsolata does not look good in the context of LNCS ...
%\setmonofont[StylisticSet={1,3},Scale=.9]{inconsolata}
% ... thus, we use the good old Latin Modern Mono font for source code.
\setmonofont{Latin Modern Mono} % "variable=false"
%\setmonofont{Latin Modern Mono Prop} % "variable=true"
\else
% overwrite cmodern with the Times variant
\usepackage{newtxtext}
\usepackage{newtxmath}
\usepackage[zerostyle=b,scaled=.9]{newtxtt}
\fi
\fi
\ifluatex
\else
% fontenc and inputenc are not required when using lualatex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} %support umlauts in the input
\fi
\usepackage{graphicx}
% backticks (`) are rendered as such in verbatim environment. See https://tex.stackexchange.com/a/341057/9075 for details.
\usepackage{upquote}
% Nicer tables (\toprule, \midrule, \bottomrule - see example)
\usepackage{booktabs}
%extended enumerate, such as \begin{compactenum}
\usepackage{paralist}
%put figures inside a text
%\usepackage{picins}
%use
%\piccaptioninside
%\piccaption{...}
%\parpic[r]{\includegraphics ...}
%Text...
% For easy quotations: \enquote{text}
% This package is very smart when nesting is applied, otherwise textcmds (see below) provides a shorter command
\usepackage{csquotes}
% For even easier quotations: \qq{text}
\usepackage{textcmds}
%enable margin kerning
\RequirePackage[%
babel,%
final,%
expansion=alltext,%
protrusion=alltext-nott]{microtype}%
% \texttt{test -- test} keeps the "--" as "--" (and does not convert it to an en dash)
\DisableLigatures{encoding = T1, family = tt* }
%tweak \url{...}
\usepackage{url}
%\urlstyle{same}
%improve wrapping of URLs - hint by http://tex.stackexchange.com/a/10419/9075
\makeatletter
\g@addto@macro{\UrlBreaks}{\UrlOrds}
\makeatother
%nicer // - solution by http://tex.stackexchange.com/a/98470/9075
%DO NOT ACTIVATE -> prevents line breaks
%\makeatletter
%\def\Url@twoslashes{\mathchar`\/\@ifnextchar/{\kern-.2em}{}}
%\g@addto@macro\UrlSpecials{\do\/{\Url@twoslashes}}
%\makeatother
% Diagonal lines in a table - http://tex.stackexchange.com/questions/17745/diagonal-lines-in-table-cell
% Slashbox is not available in texlive (due to licensing) and also gives bad results. This, we use diagbox
%\usepackage{diagbox}
% Required for package pdfcomment later
\usepackage{xcolor}
% For listings
\usepackage{listings}
\lstset{%
basicstyle=\ttfamily,%
columns=fixed,%
basewidth=.5em,%
xleftmargin=0.5cm,%
captionpos=b}%
\renewcommand{\lstlistingname}{List.}
% Fix counter as described at https://tex.stackexchange.com/a/28334/9075
\usepackage{chngcntr}
\AtBeginDocument{\counterwithout{lstlisting}{section}}
% Compatibility of packages minted and listings with respect to the numbering of "List." caption
% Source: https://tex.stackexchange.com/a/269510/9075
\AtBeginEnvironment{listing}{\setcounter{listing}{\value{lstlisting}}}
\AtEndEnvironment{listing}{\stepcounter{lstlisting}}
% Enable nice comments
\usepackage{pdfcomment}
%
\newcommand{\commentontext}[2]{\colorbox{yellow!60}{#1}\pdfcomment[color={0.234 0.867 0.211},hoffset=-6pt,voffset=10pt,opacity=0.5]{#2}}
\newcommand{\commentatside}[1]{\pdfcomment[color={0.045 0.278 0.643},icon=Note]{#1}}
%
% Compatibality with packages todo, easy-todo, todonotes
\newcommand{\todo}[1]{\commentatside{#1}}
% Compatiblity with package fixmetodonotes
\newcommand{\TODO}[1]{\commentatside{#1}}
% Bibliopgraphy enhancements
% - enable \cite[prenote][]{ref}
% - enable \cite{ref1,ref2}
% Alternative: \usepackage{cite}, which enables \cite{ref1, ref2} only (otherwise: Error message: "White space in argument")
% Doc: http://texdoc.net/natbib
\usepackage[%
square, % for square brackets
comma, % use commas as separators
numbers, % for numerical citations;
% sort, % orders multiple citations into the sequence in which they appear in the list of references;
sort&compress, % as sort but in addition multiple numerical citations
% are compressed if possible (as 3-6, 15);
]{natbib}
% In the bibliography, references have to be formatted as 1., 2., ... not [1], [2], ...
\renewcommand{\bibnumfmt}[1]{#1.}
\ifluatex
% does not work when using luatex
% see: https://tex.stackexchange.com/q/419288/9075
\else
% Prepare more space-saving rendering of the bibliography
% Source: https://tex.stackexchange.com/a/280936/9075
\SetExpansion
[ context = sloppy,
stretch = 30,
shrink = 60,
step = 5 ]
{ encoding = {OT1,T1,TS1} }
{ }
\fi
% Put footnotes below floats
% Source: https://tex.stackexchange.com/a/32993/9075
\usepackage{stfloats}
\fnbelowfloat
% 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
\usepackage{hyperref}
% Enable hyperref without colors and without bookmarks
\hypersetup{hidelinks,
colorlinks=true,
allcolors=black,
pdfstartview=Fit,
breaklinks=true}
%
% Enable correct jumping to figures when referencing
\usepackage[all]{hypcap}
\usepackage[group-four-digits,per-mode=fraction]{siunitx}
%enable \cref{...} and \Cref{...} instead of \ref: Type of reference included in the link
\usepackage[capitalise,nameinlink]{cleveref}
%Nice formats for \cref
\usepackage{iflang}
\IfLanguageName{ngerman}{
\crefname{table}{Tab.}{Tab.}
\Crefname{table}{Tabelle}{Tabellen}
\crefname{figure}{\figurename}{\figurename}
\Crefname{figure}{Abbildungen}{Abbildungen}
\crefname{equation}{Gleichung}{Gleichungen}
\Crefname{equation}{Gleichung}{Gleichungen}
\crefname{listing}{\lstlistingname}{\lstlistingname}
\Crefname{listing}{Listing}{Listings}
\crefname{section}{Abschnitt}{Abschnitte}
\Crefname{section}{Abschnitt}{Abschnitte}
\crefname{paragraph}{Abschnitt}{Abschnitte}
\Crefname{paragraph}{Abschnitt}{Abschnitte}
\crefname{subparagraph}{Abschnitt}{Abschnitte}
\Crefname{subparagraph}{Abschnitt}{Abschnitte}
}{
\crefname{section}{Sect.}{Sect.}
\Crefname{section}{Section}{Sections}
\crefname{listing}{\lstlistingname}{\lstlistingname}
\Crefname{listing}{Listing}{Listings}
}
\crefname{section}{Sect.}{Sect.}
\Crefname{section}{Section}{Sections}
\crefname{listing}{\lstlistingname}{\lstlistingname}
\Crefname{listing}{Listing}{Listings}
\usepackage[newfloat]{minted}
% Line numbers not flowing out of the margin
\setminted{numbersep=5pt, xleftmargin=12pt}
\usemintedstyle{bw} %black and white style
%\usemintedstyle{vs} %visual studio
%\usemintedstyle{friendlygrayscale} % custom style - submitted as pull request https://bitbucket.org/birkenfeld/pygments-main/pull-requests/748/add-style-friendly-grayscale/diff
%\usemintedstyle{friendly}
%\usemintedstyle{eclipse} %http://www.jevon.org/wiki/Eclipse_Pygments_Style
%\usemintedstyle{autumn}
%\usemintedstyle{rrt}
%\usemintedstyle{borland}
% We need to load caption to have a bold font on the label
% The other parameters mimic the layout of the LNCS class
\usepackage[labelfont=bf,font=small,skip=4pt]{caption}
\SetupFloatingEnvironment{listing}{name=List.,within=none}
%Intermediate solution for hyperlinked refs. See https://tex.stackexchange.com/q/132420/9075 for more information.
\newcommand{\Vlabel}[1]{\label[line]{#1}\hypertarget{#1}{}}
\newcommand{\lref}[1]{\hyperlink{#1}{\FancyVerbLineautorefname~\ref*{#1}}}
\usepackage{xspace}
%\newcommand{\eg}{e.\,g.\xspace}
%\newcommand{\ie}{i.\,e.\xspace}
\newcommand{\eg}{e.\,g.,\ }
\newcommand{\ie}{i.\,e.,\ }
%introduce \powerset - hint by http://matheplanet.com/matheplanet/nuke/html/viewtopic.php?topic=136492&post_id=997377
\DeclareFontFamily{U}{MnSymbolC}{}
\DeclareSymbolFont{MnSyC}{U}{MnSymbolC}{m}{n}
\DeclareFontShape{U}{MnSymbolC}{m}{n}{
<-6> MnSymbolC5
<6-7> MnSymbolC6
<7-8> MnSymbolC7
<8-9> MnSymbolC8
<9-10> MnSymbolC9
<10-12> MnSymbolC10
<12-> MnSymbolC12%
}{}
\DeclareMathSymbol{\powerset}{\mathord}{MnSyC}{180}
\ifluatex
\else
% Enable copy and paste - also of numbers
% This has to be done instead of \usepackage{cmap}, because it does not work together with cfr-lm.
% See: https://tex.stackexchange.com/a/430599/9075
\input glyphtounicode
\pdfgentounicode=1
\fi
% correct bad hyphenation here
\hyphenation{op-tical net-works semi-conduc-tor}
%% END COPYING HERE
% Add copyright
% Do that for the final version or if you send it to colleagues
\iffalse
%state: intended|submitted|llncs
%you can add "crop" if the paper should be cropped to the format Springer is publishing
\usepackage[intended]{llncsconf}
\conference{name of the conference}
%in case of "llncs" (final version!)
%example: llncs{Anonymous et al. (eds). \emph{Proceedings of the International Conference on \LaTeX-Hacks}, LNCS~42. Some Publisher, 2016.}{0042}
\llncs{book editors and title}{0042} %% 0042 is the start page
\fi
% For demonstration purposes only
\usepackage[math]{blindtext}
\usepackage{mwe}
\begin{document}
\title{Paper Title}
%If Title is too long, use \titlerunning
%\titlerunning{Short Title}
%Single insitute
\author{Firstname Lastname \and Firstname Lastname}
%If there are too many authors, use \authorrunning
%\authorrunning{First Author et al.}
\institute{Institute}
%% Multiple insitutes - ALTERNATIVE to the above
% \author{%
% Firstname Lastname\inst{1} \and
% Firstname Lastname\inst{2}
% }
%
%If there are too many authors, use \authorrunning
% \authorrunning{First Author et al.}
%
% \institute{
% Insitute 1\\
% \email{...}\and
% Insitute 2\\
% \email{...}
%}
\maketitle
\begin{abstract}
\lipsum[1]
\end{abstract}
\begin{keywords}
keyword1, keyword2
\end{keywords}
\section{Introduction}\label{sec:intro}
\lipsum[1-3]\todo{Refine me}
The remainder of the paper starts with a presentation of related work (\cref{sec:relatedwork}).
It is followed by a presentation of hints on \LaTeX{} (\cref{sec:hints}).
Finally, a conclusion is drawn and outlook on future work is made (\cref{sec:outlook}).
\section{Related Work}
\label{sec:relatedwork}
Winery~\cite{Winery} is a graphical \commentontext{modeling}{modeling with one \qq{l}, because of AE} tool.
The whole idea of TOSCA is explained by \citet{Binz2009}.
\section{LaTeX Hints}
\label{sec:hints}
\begin{figure}
\centering
\includegraphics[width=.8\textwidth]{example-image-golden}
\caption{Simple Figure. \cite[based on][]{mwe}}
\label{fig:simple}
\end{figure}
\begin{table}
\caption{Simple Table}
\label{tab:simple}
\centering
\begin{tabular}{ll}
\toprule
Heading1 & Heading2 \\
\midrule
One & Two \\
Thee & Four \\
\bottomrule
\end{tabular}
\end{table}
\begin{lstlisting}[
% one can adjust spacing here if required
% aboveskip=2.5\baselineskip,
% belowskip=-.8\baselineskip,
caption={Example Java Listing},
label=L1,
language=Java,
float]
public class Hello {
public static void main (String[] args) {
System.out.println("Hello World!");
}
}
\end{lstlisting}
\begin{lstlisting}[
% one can adjust spacing here if required
% aboveskip=2.5\baselineskip,
% belowskip=-.8\baselineskip,
caption={Example XML Listing},
label=L2,
language=XML,
float]
<example attr="demo">
text content
</example>
\end{lstlisting}
\begin{listing}[htbp]
\begin{minted}[linenos=true,escapeinside=||]{java}
public class Hello {
public static void main (String[] args) {
System.out.println("Hello World!");
}
}
\end{minted}
\caption{Java code rendered using minted}
\label{lst:java}
\end{listing}
\begin{listing}[htbp]
\begin{minted}[linenos=true,escapeinside=||]{xml}
<demo>
<node>
<!-- comment --> |\Vlabel{commentline}|
</node>
</demo>
\end{minted}
\caption{XML-Dokument rendered using minted}
\label{lst:xml}
\end{listing}
\Cref{L1,L2} show listings typeset using the \texttt{lstlisting} environment.
\href{https://github.com/gpoore/minted}{minted} is an alternative package, which enables syntax highlighting using \href{http://pygments.org/}{pygments}.
This, in turn, requires Python, so it is disabled by default.
In case you load it above, be sure to run pdflatex with \texttt{-shell-escape} option.
\Cref{lst:java,lst:xml} show listings rendered using minted.
You can point to a single line: \lref{commentline}.
cref Demonstration: Cref at beginning of sentence, cref in all other cases.
\Cref{fig:simple} shows a simple fact, although \cref{fig:simple} could also show something else.
\Cref{tab:simple} shows a simple fact, although \cref{tab:simple} could also show something else.
\Cref{sec:intro} shows a simple fact, although \cref{sec:intro} could also show something else.
Brackets work as designed:
<test>
One can also input backquotes in verbatim text: \verb|`test`|.
The symbol for powerset is now correct: $\powerset$ and not a Weierstrass p ($\wp$).
\begin{inparaenum}
\item All these items...
\item ...appear in one line
\item This is enabled by the paralist package.
\end{inparaenum}
Please use the \qq{qq command} or the \enquote{enquote command} to quote something.
``something in quotes'' using plain tex syntax also works.
You can now write words containing hyphens which are hyphenated (application"=specific) at other places.
This is enabled by an additional configuration of the babel package.
In case you write \qq{application-specific}, then the word will only be hyphenated at the dash.
You can also write applica\allowbreak{}tion-specific, but this is much more effort.
The words \qq{workflow} and \qq{dwarflike} can be copied from the PDF and pasted to a text file.
Numbers can written plain text (such as 100), by using the siunitx package like that:
\SI{100}{\km\per\hour},
or by using plain \LaTeX{} (and math mode):
$100 \frac{\mathit{km}}{h}$.
\section{Conclusion and Outlook}
\label{sec:outlook}
\lipsum[1-2]
\subsubsection*{Acknowledgments}
\ldots
In the bibliography, use \texttt{\textbackslash textsuperscript} for \qq{st}, \qq{nd}, \ldots:
E.g., \qq{The 2\textsuperscript{nd} conference on examples}.
When you use \href{https://www.jabref.org}{JabRef}, you can use the clean up command to achieve that.
See \url{https://help.jabref.org/en/CleanupEntries} for an overview of the cleanup functionality.
\renewcommand{\bibsection}{\section*{References}} % requried for natbib to have "References" printed and as section*, not chapter*
% Use natbib compatbile splncsnat style.
% It does provide all features of splncs03, but is developed in a clean way.
% Source: http://phaseportrait.blogspot.de/2011/02/natbib-compatible-bibtex-style-bst-file.html
\bibliographystyle{splncsnat}
\begingroup
\ifluatex
%try to activate if bibliography looks ugly
%\sloppy
\else
\microtypecontext{expansion=sloppy}
\fi
\small % ensure correct font size for the bibliography
\bibliography{paper}
\endgroup
% Enfore empty line after bibliography
\ \\
%
All links were last followed on October 5, 2017.
\end{document}