Skip to content
Benjamin Kowarsch edited this page Jul 3, 2020 · 8 revisions

Modula-2 Syntax Highlighting

Syntax highlighting in LaTeX

Setup

Copy-paste or include the contents of one of the following files into your LaTeX document, depending on the Modula-2 dialect you want to render:

Adjust the line \setfont{DejaVuSansMono-TLF} to use the desired font in which the source should be rendered.

Usage

For any Modula-2 source code section in your LaTeX document, create a Modula-2 environment:

\begin{Modula2}
(* your source code goes here *)
\end(Modula2)

This will create a square frame with a thin grey border and faint grey background and render your Modula-2 source code using the chosen font with syntax highlighting.

  • Reserved words are rendered in bold
  • Predefined identifiers are rendered normal
  • String literals are rendered in dark grey
  • Comments are rendered in grey italic
  • Pragmas are rendered in bold grey (ISO and R10 dialects only)
Clone this wiki locally