Skip to main content

Preprocessor to generate LaTeX/beamer files

Project description


Preprocessor to generate LaTeX-beamer code from a more compact language.

The needs for a new sub language were:

  • compactness: so as to remove type as few formatting informations as possible,
  • expressiveness: allow to format most beamer frames with clear and short syntax,
  • flexibility: allowance for LaTeX without to much overhead.

In TeX environments, are enclosed into \begin{env} and \end{env} tags which makes it unambiguous but requires duplicating the name of the environment. Here, for compactness, the choice is made instead to use indentation as environment markers. Indentation is therefore significant and compulsory.


beamer_gen code has shortcuts for the following current LaTeX/beamer features:

  • sections, using s Section title,
  • frames, using + Frame title,
  • blocks, using b Block title,
  • items, using - item text with automatic environment creation,
  • columns, using c{ratio} (ratio relative to \columnwidth) with automatic environment creation,
  • figures, using f{ratio}{filename} (ratio relative to \columnwidth).

Beamer overlay directives (<...>) are supported for frames, blocks, figures and items. Frames can also have options ([...]), in which case, they must be specified after an optional beamer directive (+<+->[fragile] Title for instance).

Everything else is reproduced verbatim.


Usage is straightforward:

usage: [-h] filename [filename ...]

Generate LaTeX/beamer files from a stub.

positional arguments:
  filename    name of the file to be processed.

optional arguments:
  -h, --help  show this help message and exit

Each file is processed by creating a new file with the original extension replaced by .tex.


The following source:

+[allowframebreaks] Example 1
    b<+-> Example block
        - first item
            - subitem
            - other subitem
        - second item
    b<+-> second block
            Some generic text:
            - and items

translates into:

    \frametitle{Example 1}
    \begin{block}<+->{Example block}
            \item first item
                    \item subitem
                    \item other subitem
            \item second item
    \begin{block}<+->{second block}
            Some generic text:
                \item and items

Project details

Download files

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

Source Distribution

beamer_gen-1.1.0.tar.gz (4.4 kB view hashes)

Uploaded source

Built Distribution

beamer_gen-1.1.0-py3-none-any.whl (5.6 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page