TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the syntax package, and I want to define a grammar like:

Rule = Head -> Tail

but when I do this:

<rule> ::=  <head> `$\rightarrow$' <tail>

I get an error saying that Missing $ was inserted.

How can I single-quote a math character?


share|improve this question
Ops sorry I'll update the question... This is within that syntax package it seems. – drozzy Sep 5 '12 at 16:08
possibly \hbox{'$\rightarrow$'} (with a left quote on the left) but if that doesn't work please (always) edit your question to have a complete small document that shows the problem. – David Carlisle Sep 5 '12 at 16:19
up vote 3 down vote accepted

The backquote ` is a special character in the grammar environment. Precede it by \string if you want an opening quote:

<rule> ::=  <head> \string`$\rightarrow$' <tail>
share|improve this answer
thanks, I found that lit{$\rightarrow$} also works! – drozzy Sep 5 '12 at 17:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.