3

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

Rule = Head -> Tail

but when I do this:

\begin{grammar}
<rule> ::=  <head> `$\rightarrow$' <tail>

I get an error saying that Missing $ was inserted.

How can I single-quote a math character?

Thanks

2
  • Ops sorry I'll update the question... This is within that syntax package it seems. Sep 5, 2012 at 16:08
  • 1
    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. Sep 5, 2012 at 16:19

1 Answer 1

3

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

\documentclass{article}
\usepackage{syntax}
\begin{document}
\begin{grammar}
<rule> ::=  <head> \string`$\rightarrow$' <tail>
\end{grammar}
\end{document}
1
  • thanks, I found that lit{$\rightarrow$} also works! Sep 5, 2012 at 17:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .