Skip to main content

Python tools for LaTex

Project description

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.

Usage

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

\end{GKDBNF}

capture

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:

<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.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

gkd-0.1-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page