| 1 |
# uvlhighlight — Syntax highlighting for Universal Variability Language in LaTeX |
| 2 |
|
| 3 |
**Author:** José Miguel Horcas |
| 4 |
**Email:** [[email protected]](mailto:[email protected]) |
| 5 |
**License:** LaTeX Project Public License (LPPL) 1.3c |
| 6 |
|
| 7 |
--- |
| 8 |
|
| 9 |
## Description |
| 10 |
|
| 11 |
The `uvlhighlight` package provides syntax highlighting support for the **Universal Variability Language (UVL)** in LaTeX documents. It is built on top of the `listings` package and enables expressive and customizable formatting of UVL models. |
| 12 |
|
| 13 |
The Universal Variability Language (UVL) is described in: |
| 14 |
|
| 15 |
Benavides et al., *UVL: Feature modelling with the Universal Variability Language*, Journal of Systems and Software, 2025. |
| 16 |
|
| 17 |
--- |
| 18 |
|
| 19 |
## Features |
| 20 |
|
| 21 |
The package provides: |
| 22 |
|
| 23 |
* Syntax highlighting for: |
| 24 |
|
| 25 |
* Keywords |
| 26 |
* Features |
| 27 |
* Attributes |
| 28 |
* Constraints |
| 29 |
* Strings, numbers, and comments |
| 30 |
* Multiple visual themes: |
| 31 |
|
| 32 |
* Default |
| 33 |
* Flamapy |
| 34 |
* UVLS (dark mode) |
| 35 |
* Black & White (print-friendly) |
| 36 |
* Inline semantic commands for UVL elements. |
| 37 |
* Support for user-defined attributes. |
| 38 |
* Integration with the `listings` package. |
| 39 |
* Inclusion of external `.uvl` files. |
| 40 |
|
| 41 |
--- |
| 42 |
|
| 43 |
## Installation |
| 44 |
|
| 45 |
### Via CTAN / TeX distributions |
| 46 |
|
| 47 |
The package can be installed using standard tools such as TeX Live or MiKTeX. |
| 48 |
|
| 49 |
### Manual installation |
| 50 |
|
| 51 |
1. Download the package |
| 52 |
|
| 53 |
2. Place `uvlhighlight.sty` in your local TeX tree. |
| 54 |
|
| 55 |
3. Refresh the filename database. |
| 56 |
|
| 57 |
--- |
| 58 |
|
| 59 |
## Usage |
| 60 |
|
| 61 |
Load the package in the preamble: |
| 62 |
|
| 63 |
```latex |
| 64 |
\usepackage{uvlhighlight} |
| 65 |
``` |
| 66 |
|
| 67 |
### Minimal example |
| 68 |
|
| 69 |
```latex |
| 70 |
\documentclass{article} |
| 71 |
\usepackage{uvlhighlight} |
| 72 |
|
| 73 |
\begin{document} |
| 74 |
|
| 75 |
\begin{lstlisting}[language=UVL] |
| 76 |
features |
| 77 |
Pizza |
| 78 |
optional |
| 79 |
Cheese |
| 80 |
\end{lstlisting} |
| 81 |
|
| 82 |
\end{document} |
| 83 |
``` |
| 84 |
|
| 85 |
--- |
| 86 |
|
| 87 |
## Package Options |
| 88 |
|
| 89 |
The package supports several options to customize appearance: |
| 90 |
|
| 91 |
* `default` — standard color theme |
| 92 |
* `flamapy` — Flamapy-inspired colors |
| 93 |
* `uvls` — dark theme (VS Code inspired) |
| 94 |
* `bw` — black & white theme (print-friendly) |
| 95 |
* `beramono` — Bera Mono font (default) |
| 96 |
* `inconsolata` — Inconsolata font |
| 97 |
* `nofont` — disables automatic font loading |
| 98 |
|
| 99 |
--- |
| 100 |
|
| 101 |
## Main Commands |
| 102 |
|
| 103 |
* `\UVL` — typesets the UVL acronym |
| 104 |
* `\UVLKeyword{...}` — highlights keywords |
| 105 |
* `\feature{...}` — highlights features |
| 106 |
* `\attribute{...}` — highlights attributes |
| 107 |
* `\constraint{...}` — formats constraint expressions |
| 108 |
* `\uvlattributes{...}` — defines custom attributes |
| 109 |
|
| 110 |
--- |
| 111 |
|
| 112 |
## Environments |
| 113 |
|
| 114 |
* `lstlisting` with `language=UVL` for code blocks |
| 115 |
* `\inputuvl` to include external `.uvl` files |
| 116 |
|
| 117 |
--- |
| 118 |
|
| 119 |
## Documentation |
| 120 |
|
| 121 |
Full documentation is available in: |
| 122 |
|
| 123 |
``` |
| 124 |
uvlhighlight-doc.pdf |
| 125 |
``` |
| 126 |
|
| 127 |
--- |
| 128 |
|
| 129 |
## Requirements |
| 130 |
|
| 131 |
* LaTeX (pdfLaTeX, XeLaTeX, or LuaLaTeX) |
| 132 |
* `listings` package |
| 133 |
* Standard font encodings |
| 134 |
|
| 135 |
--- |
| 136 |
|
| 137 |
## License |
| 138 |
|
| 139 |
This work is distributed under the terms of the |
| 140 |
**LaTeX Project Public License (LPPL), version 1.3c**. |
| 141 |
|
| 142 |
https://www.latex-project.org/lppl/ |
| 143 |
|
| 144 |
--- |
| 145 |
|
| 146 |
## Changelog |
| 147 |
|
| 148 |
### Version 1.3 (2026-04-13) |
| 149 |
|
| 150 |
* Added `\UVL` inline command |
| 151 |
|
| 152 |
### Version 1.2 (2026-02-16) |
| 153 |
|
| 154 |
* Improved typography compatibility |
| 155 |
|
| 156 |
### Version 1.1 (2025-12-02) |
| 157 |
|
| 158 |
* Added inline commands |
| 159 |
|
| 160 |
### Version 1.0 (2025-12-01) |
| 161 |
|
| 162 |
* Initial release |
| 163 |
|
| 164 |
--- |