Skip to content

Latest commit

 

History

45 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flix Listings Package

Syntax highlighting for Flix source code in LaTeX using the listings package.

Flix listings preview

Installation

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.

Usage

Packaged Style

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}

Syntax Only

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
}

Customization

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.

Example

See example.tex for a complete document. Compile it with:

pdflatex example.tex

License

This project is available under the Apache License 2.0.

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages