-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathexamples.tex
48 lines (37 loc) · 1.02 KB
/
examples.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
% Copyright 2017 Sergei Tikhomirov, MIT License
% https://github.com/s-tikhomirov/solidity-latex-highlighting/
\documentclass{article}
\usepackage{filecontents, pgffor}
\usepackage{listings}
\usepackage{listings-solidity} % copy listings-solidity.sty to your project
\usepackage{xcolor}
\definecolor{verylightgray}{rgb}{.97,.97,.97}
\lstset{ % define general preferences
language=Solidity,
backgroundcolor=\color{verylightgray},
extendedchars=true,
basicstyle=\footnotesize\ttfamily,
showstringspaces=false,
showspaces=false,
numbers=left,
numberstyle=\footnotesize,
numbersep=9pt,
tabsize=2,
breaklines=true,
showtabs=false,
captionpos=b
}
\title{Solidity highlighting in LaTeX documents}
\author{Sergei~Tikhomirov \\ \texttt{[email protected]}}
\date{}
\begin{document}
\maketitle
\edef\ExamplesDir{examples}
\foreach \i in {01, 02, 03, 04, 05, 06, 07, 08, 09, 10} {
\edef\ExampleFile{\ExamplesDir/example\i.sol}
\IfFileExists{\ExampleFile}{
\section{Example \i}
\input{\ExampleFile}
}
}
\end{document}