| 1 |
# EBNF Diagrams in LaTeX |
| 2 |
|
| 3 |
[](https://github.com/yegor256/naive-ebnf/actions/workflows/l3build.yml) |
| 4 |
[](https://ctan.org/pkg/naive-ebnf) |
| 5 |
[](https://github.com/yegor256/naive-ebnf/blob/master/LICENSE.txt) |
| 6 |
|
| 7 |
This LaTeX package helps you typeset an [Extended Backus-Naur Form][EBNF] |
| 8 |
(EBNF) using plain text format. |
| 9 |
|
| 10 |
First, [install it][LaTeX] |
| 11 |
from [CTAN](https://ctan.org/pkg/naive-ebnf) |
| 12 |
and then use in the preamble: |
| 13 |
|
| 14 |
```text |
| 15 |
\documentclass{article} |
| 16 |
\usepackage{naive-ebnf} |
| 17 |
\begin{document} |
| 18 |
\begin{ebnf} |
| 19 |
<Expression> := <Variable> |
| 20 |
| "$\lambda$" <Variable> "." <Expression> |
| 21 |
| "(" <Expression> <Expression> ")" |
| 22 |
\end{ebnf} |
| 23 |
\end{document} |
| 24 |
``` |
| 25 |
|
| 26 |
Otherwise, you can download [`naive-ebnf.sty`][sty] and add to your project. |
| 27 |
|
| 28 |
## How to Contribute |
| 29 |
|
| 30 |
If you want to contribute yourself, make a fork, then create a branch, |
| 31 |
then run `l3build ctan` in the root directory. |
| 32 |
It should compile everything without errors. If not, submit an issue and wait. |
| 33 |
Otherwise, make your changes and then run `l3build ctan` again. If the build is |
| 34 |
still clean, submit a pull request. |
| 35 |
|
| 36 |
[EBNF]: https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form |
| 37 |
[LaTeX]: https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages |
| 38 |
[sty]: https://raw.githubusercontent.com/yegor256/naive-ebnf/gh-pages/naive-ebnf/naive-ebnf.sty |