spockz/lhs2texhl — Issue #10: Underscores in constructors
Author: mvarela
Created: 2012-01-19 12:29:21+00:00
State: open

Hi, I believe this is a bug in lhs2Tex-hl.
When there is an underscore in a constructor declaration, e.g.:

`data FOO = Bar_A | Bar_B`

the formatting generated is

`%format Bar_A = " {\lhsCHconstructor{Bar_{A}}}"`

which causes LaTeX to choke, as the underscore is not in a math environment.
Maybe outputting an escaped underscore

`%format Bar_A = " {\lhsCHconstructor{Bar\_{A}}}"`

or formatting the whole thing as a subscript

`%format Bar_A = " {\lhsCHconstructor{Bar$_{A}$}}"`

would be possible solutions.

Br,
Martin