I wanted to know which standard symbol should be used as a delimiter when recursively defining a (formal) language, such as this fragment of arithmetic expressions :
X ::= 0 | 1 | X+X | X*X |
I use |, but I have to put by hand the spaces between the bar and the left and right symbols. Moreover, in other documents or papers, the bar looks like bigger than the standard one, so I wondered if there was a particular symbol or a best practice.
Edit : Here a short version of the kind of code I'm using right now :
\documentclass[11pt,letterpaper]{report}
\usepackage{amssymb,amsmath,amsfonts,amsxtra,amsthm}
% etc...
\begin{document}
% ...
\[ A ::= 0 | 1 | A+A | A \times A \]
%...
\end{document}
While I'm looking for spacing more like the definition at page 4, around the end of 1.1 in http://perso.ens-lyon.fr/olivier.laurent/folgames.pdf for example. I think its called Backus-Naur Form or something like that.
\documentclass{...}
and ending with\end{document}
. Thanks :-)\mid
, but probably you want to define\newcommand{\bnfor}{\mid}
so you can easily change your mind.\mid
prints the same symbol as\vert
or|
(these two are the same), but treats it as a relation symbol.