Skip to main content

Preprocessor to generate LaTeX/beamer files

Project description

beamer_gen

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.

Features

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). Columns can also have a placement option (e.g. [c]), which needs to be specified before the size.

Everything else is reproduced verbatim.

Usage

Usage is straightforward:

usage: beamer_gen.py [-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.

Example

The following source:

+[allowframebreaks] Example 1
    b<+-> Example block
        - first item
            - subitem
            - other subitem
        - second item
    b<+-> second block
        c{0.4}
            f<3->{0.8}{figure1.png}
        c[t]{0.6}
            Some generic text:
            - and items

translates into:

\begin{frame}[allowframebreaks]
    \frametitle{Example 1}
    \begin{block}<+->{Example block}
        \begin{itemize}
            \item first item
                \begin{itemize}
                    \item subitem
                    \item other subitem
                \end{itemize}
            \item second item
        \end{itemize}
    \end{block}
    \begin{block}<+->{second block}
        \begin{columns}
            \column{0.4\columnwidth}
            \includegraphics<3->[width=0.8\columnwidth]{figure1.png}
            \column[t]{0.6\columnwidth}
            Some generic text:
            \begin{itemize}
                \item and items
            \end{itemize}
        \end{columns}
    \end{block}
\end{frame}

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.2.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beamer_gen-1.2.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file beamer_gen-1.2.0.tar.gz.

File metadata

  • Download URL: beamer_gen-1.2.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for beamer_gen-1.2.0.tar.gz
Algorithm Hash digest
SHA256 0d689fbc2d48f25c8f88a6db38faf7650642e5e76671e68a9cb60af8ee2e9598
MD5 3866f2a28aca1b68087ce67617448e05
BLAKE2b-256 b97f5acfeb0556af619138634158686ffc066b2ab9b223b4e090609a2bd6094b

See more details on using hashes here.

File details

Details for the file beamer_gen-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: beamer_gen-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for beamer_gen-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36da76618a4eb4e4f078f4354ac547df036e7c6ee44cd5574ccea0c40ec642aa
MD5 7be1782e0cb407c967b1fc9cee54ea55
BLAKE2b-256 b9069a33825b70dd382c038e4dc329a078fd06955931046292b85f12c3b0358d

See more details on using hashes here.

Supported by

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