Debian Codegraph @

texmf-dist/doc/latex/uvlhighlight/uvlhighlight-example.tex

raw
1 \documentclass{article}
2
3 % Load your custom package.
4 % Try changing it to: \usepackage[bw]{uvl} to test the black & white mode.
5 \usepackage{uvlhighlight}
6 \usepackage{geometry}
7 \geometry{top=3cm, bottom=3cm}
8
9 \uvlattributes{Kcal, Price}
10
11 \begin{document}
12
13 \section{UVL Code Example}
14
15 % Method 1: Inline code environment
16 \begin{lstlisting}[language=UVL, caption={A simple Pizza Model.}]
17 features
18 /* esto es
19 otro comentario */
20 Pizza {abstract}
21 optional
22 CheesyCrust {Kcal 370, Price 1.00}
23 Integer SpicyLvl
24 String Name // Esto es un comentario
25 mandatory
26 Topping {abstract}
27 or
28 Salami {Kcal 462}
29 Ham {Kcal 115}
30 Mozzarella {Kcal 310}
31 Anchovies {Kcal 210, Price 0.50}
32 Size {abstract}
33 alternative
34 "Normal size" {Price 8.00}
35 Big {Price 12.00}
36 Dough {abstract}
37 alternative
38 Neapolitan
39 Sicilian {Price 0.50}
40 constraints
41 (CheesyCrust & Sicilian) => Big
42 Neapolitan => (!Salami & !Ham)
43 sum(Price) < 12
44 Name => len(Name)<10 & Name=='Margherita'
45 SpicyLvl >= 1 & SpicyLvl <= 5
46 SpicyLvl==5 => SpicyLvl.Price==1.00
47 (SpicyLvl>=1 & SpicyLvl<5) => SpicyLvl.Price==0
48 \end{lstlisting}
49
50 % Method 2: Inline code environment
51 \inputuvl[caption={A simple Pizza Model from a .uvl file.}]{uvlhighlight-example.uvl}
52
53 \end{document}