Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Underscores in constructors #10

Open
mvarela opened this Issue · 3 comments

2 participants

@mvarela

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

@mvarela

Btw, uncommenting line 14 in Language/LaTeX.hs seems to make it work, though I haven't been able to test whether it breaks something else.

. replace "_" "\\_"

@spockz
Owner

The idea is that the system takes care of some formatting for you when you insert a _. Apparently that is broken now, I will look into it.

@mvarela

Ok, I had understood that from the documentation as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.