1

For a context free grammar I need to write:

A -> a | b 

My code for this is

$ A \rightarrow a | b $

however this gives me something like

A -> a|b // wanted: a | b, note the space before and after the |

meaning there is no space between a|b.

How can I fix this?

Thanks for any hint!

| improve this question | | | | |
  • 1
    Use \mid that will produce the same spacing as \rightarrow – egreg Mar 7 '13 at 16:00
  • works perfect, thanks! Please add it as answer. – stefan.at.wpf Mar 7 '13 at 16:07