↓ Skip to main content

lhs2TeX-hl released

I’m proud to an­nounce the first re­lease of my lhs2TeX-hl tool. For us who fancy us­ing col­ours in our present­a­tions or pa­pers this should now go a whole lot easier. Go to the lhs2TeX-hl homepage!

In­stall it like this:

[bash] > cabal in­stall lhs2TeX-hl [/bash]

lhs2TeX-hl is run be­fore you run lhs2TeX and you sup­ply it with the in­put file and the out­put file. A typ­ical ex­e­cu­tion would look like this:

[bash] > lhs2TeX-hl -o MyPaper.fmt MyPaper.lhs > lhs2TeX -o MyPaper.Tex MyPaper.lhs > pd­flatex MyPaper.tex [/bash]

It’s im­port­ant to note here that you should’ve ad­ded the fol­low­ing line to your MyPaper.lhs file:

%include MyPaper.fmt

And that you have the fol­low­ing com­mands defined in your latex file:

  • \lhsCHkeyword
  • \lhsCHprelude
  • \lhsCHtype
  • \lhsCHlitNumber
  • \lhsCHconstructor
  • \lhsCHfunction
  • \lhsCHinfixoperator
For example, like this:
\definecolor{datatype}{RGB}{42,0,217}
\definecolor{class}{RGB}{197,11,16}
\definecolor{fieldname}{RGB}{0,0,162}
\definecolor{prelude}{RGB}{64,80,117}
\definecolor{numeral}{RGB}{0,0,205}
\definecolor{infixoperator}{RGB}{42,0,217}
\definecolor{constructor}{RGB}{0,161,0}
\definecolor{keyword}{RGB}{229,120,0}
\definecolor{special1}{RGB}{159,138,0}

\newcommand{\lhsCHfunction}[1]{\color{infixoperator}{{#1}}} \newcommand{\lhsCHinfixoperator}[1]{\color{infixoperator}{{#1}}} \newcommand{\lhsCHprelude}[1]{\color{prelude}{\mathbf{#1}}} \newcommand{\lhsCHkeyword}[1]{\color{keyword}{\textbf{#1}}} \newcommand{\lhsCHconstructor}[1]{\color{constructor}{\textbf{#1}}} \newcommand{\lhsCHlitNumber}[1]{\color{numeral}{{#1}}} \newcommand{\lhsCHtype}[1]{\color{datatype}{{#1}}}

And then you might end up with something that looks like this:

Archived im­age un­avail­able: Lit­er­ate High­lighter Code v0.1.0.2.