-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Benjamin Kowarsch edited this page Jul 3, 2020
·
8 revisions
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:
- for PIM : https://github.com/trijezdci/M2-Syntax-Colour/blob/master/LaTeX/lst-m2pim.in-situ.sty
- for ISO : https://github.com/trijezdci/M2-Syntax-Colour/blob/master/LaTeX/lst-m2iso.in-situ.sty
- for R10 : https://github.com/trijezdci/M2-Syntax-Colour/blob/master/LaTeX/lst-m2r10.in-situ.sty
Adjust the line \setfont{DejaVuSansMono-TLF}
to use the desired font in which the source should be rendered.
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)
A statement of the form
\begin{Modula2}
FOR value-- IN [1..99] OF CARDINAL DO
WRITE value, `` bottles of beer, take one down and pass it around.\n``
END; (* FOR *)
\end(Modula2)
iterates over subrange \inl{[1..99] of type \inl{CARDINAL} in descending order.
will render