Metadata-Version: 2.1
Name: gkd
Version: 0.1
Summary: Python tools for LaTex
Home-page: https://github.com/thautwarm/gkd
Author: thautwarm
Author-email: twshere@outlook.com
License: mit
Keywords: LaTex
Platform: any
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.7.0
Description-Content-Type: text/markdown
Requires-Dist: paperbnf (>=1.0)

## gkd

A set of tools to help programming in LaTex.

`pip install gkd`, and append contents of `gkd.tex` to your Tex sources.

### GKDBNF: The best LaTex BNF package you've ever seen?

This relies on [paperbnf](https://github.com/thautwarm/paperbnf).

**Usage**

```tex
\begin{GKDBNF}{some_unique_id}
!Expressions! <e> ::= <e> ( <e>  )
| let <n> = <e> in <e>
| !$\lambda$! <n> . <e>
| <\mathtt{atom}>

\end{GKDBNF}
```

![capture](Capture.PNG)

**Remember to place a blank line in the end of GKDBNF block**.

How to write this BNF?


Follow the syntax and lexer rules:

Valid BNF Syntax:
```bnf
<atom> ::= NONTERMINAL
       | TERMINAL
       | TERMINAL2
       | '|'



<prod> ::= NONTERMINAL '::=' <atom>+ NEWLINE
       | TERMINAL NONTERMINAL '::=' <atom>+ NEWLINE
       | TERMINAL2 NONTERMINAL '::=' <atom>+ NEWLINE
       | '|' <atom>+ <NEWLINE>
```


Lexer rule by regex:
```
NEWLINE     = [\r\n]+
NONTERMINAL = <.*?>
TERMINAL2   = !.*?!
Term        = \S+
```

Whitespace tokens are ignored.

