Syntax highlighting for Flix source code in LaTeX using
the listings package.
Download the latest flix.sty and place it next to your LaTeX document or in your local TeX tree. Then load the package in your preamble:
\usepackage{flix}The package requires listings and xcolor, which it loads automatically.
Select style=flix to use the supplied syntax highlighting, colors, line
numbers, and line wrapping:
\usepackage{flix}
\lstset{style=flix}
\begin{lstlisting}
def main(): Unit \ IO =
println("Hello, world!")
\end{lstlisting}The style can also be selected for an individual listing:
\begin{lstlisting}[style=flix]
enum Shape {
case Circle(Int32)
case Rectangle(Int32, Int32)
}
\end{lstlisting}Select language=flix instead when you want Flix syntax recognition with your
own presentation settings:
\lstset{
language=flix,
basicstyle=\ttfamily\small,
keywordstyle=\bfseries,
numbers=none
}Options specified after style=flix override the packaged defaults:
\lstset{
style=flix,
basicstyle=\ttfamily\small,
numbers=none
}The package colors are named flix-code-color, flix-keyword-color,
flix-effect-keyword-color, flix-type-color, flix-comment-color,
flix-string-color, and flix-linenumber-color.
See example.tex for a complete document. Compile it with:
pdflatex example.texThis project is available under the Apache License 2.0.
