I'm using the backnaur package to write the BNF of a simple programming language I made. But now I have a fairly long definition and it gives an overflow. I tried adding newlines using \\
but this results in an odd alignment. I've also tried \newline
but this doesn't do anything. I can't anything about newlines in the package documentation (http://ctan.sharelatex.com/tex-archive/macros/latex/contrib/backnaur/backnaur.pdf). This is my code:
\documentclass[dutch]{arabart}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
\usepackage{amsmath}
\usepackage{amsthm}
\makeatletter
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\usepackage{backnaur}
\makeatother
\usepackage{babel}
\begin{document}
\section{Syntax van de taal}
\begin{bnf*}
\bnfprod{function\_call\_void}{
\bnfts{setLight} \bnfpn{expression} \bnfpn{light} \bnfpn{expression} \bnfpn{expression} \bnfpn{expression}
\bnfor
\bnfts{drive} \bnfpn{expression} \bnfpn{direction} \bnfpn{expression}
\bnfor
\bnfts{closeBot} \bnfpn{expression}
\bnfor
\bnfts{print} \bnfpn{expression}
\bnfor
\bnfts{printLn} \bnfpn{expression}
\bnfor
\bnfts{sleep} \bnfpn{expression}
}\\
\end{bnf*}
\end{document}
And this is an image showing my problem: