-
Notifications
You must be signed in to change notification settings - Fork 0
/
verbatim.tex
41 lines (31 loc) · 1.29 KB
/
verbatim.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
\documentclass{article}
\usepackage{verbatim}
\usepackage{fancyvrb}
\usepackage{inconsolata}
\usepackage{fvextra} % allows 'breaklines' as option in custom verbatim environment
\usepackage[dvipsnames]{xcolor}
% custom verbatim environment for Prolog code
\DefineVerbatimEnvironment{code}{Verbatim}
{samepage=true, fontfamily=zi4, fontsize=\small, frame=single, framesep=1mm, framerule=0.1pt, rulecolor=\color{gray}}
\newcommand{\verbcomment}[1]{\textbf{\textcolor{gray}{#1}}}
% same environment but with numbered code lines
\DefineVerbatimEnvironment{codeNum}{Verbatim}
{fontfamily=zi4, numbers=left, numbersep=5pt, numberblanklines=false, firstnumber=last, tabsize=2, fontsize=\footnotesize, frame=single, framesep=1mm, framerule=0.1pt, rulecolor=\color{gray}}
\author{}
\title{}
\begin{document}
Some prolog code
\begin{code}
application(AppId, [Functions], [Services]).
\end{code}
Some prolog code with numbered lines
\begin{codeNum}[firstnumber=1, breaklines]
fogBrain(App, NewPlacement) :-
deployment(App, Placement, AllocHW, AllocBW),
reasoningStep(App, Placement, AllocHW, AllocBW, NewPlacement).
veryveryveryveryveryveryveryveryveryveryveryveryveryveryLongPredicate(A, B, C, D, E, F, G, H, I).
fogBrain(App, Placement) :-
\+deployment(App,_,_,_),
placement(App, Placement).
\end{codeNum}
\end{document}