Skip to main content

Elegant TeX script in YAML style

Project description

Yet most Elegant TeX

PyPI Version License

Elegant TeX script in YAML style

Introduction

(Note: the below paragraph is opinionated, and so is this project)

Doubtless, documents typeset with TeX are elegant from their beginning. However, TeX script are usually not. That's why you need YeT.

  • You Only Write Once: Just environ:. No more \begin{environ}~\end{environ}!
  • Syntactical Definition: Works out-of-box for any TeX packages without configuration
  • Easy Fallback: TeX script can be easily mixed into YeT script
  • Intuitive: Reading the below example will be enough for you to get the most out of YeT

Install

YeT can be installed from PyPI. (supports python>=3.6)

$ pip install YeT

Example

# examples/front.yml
documentclass: article[a4paper]
usepackage: amsmath
usepackage: amssymb

title: YeT Example
author: BayMinimum

document:
  - \maketitle  # or maketitle: ""
  - Let's begin with some math.
  - equation:
    - F = \frac{1}{4 \pi \epsilon_0} \frac{q_1 q_2}{r^2}
  - enumerate:
      item: This is enumerate
      item: Write items in dict or list
  - some_custom_environment{arg}[optional]:
    - Key with dict or list value is interpreted as environment.
    - This works syntactically, without semantics.

Compile the above YeT file with command:

$ yet examples/front.yml

Then, examples/front.tex will be generated as below.

\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\title{YeT Example}
\author{BayMinimum}
\begin{document}
\maketitle

Let's begin with some math.

\begin{equation}
F = \frac{1}{4 \pi \epsilon_0} \frac{q_1 q_2}{r^2}
\end{equation}

\begin{enumerate}
\item{This is enumerate}

\item{Write items in dict or list}
\end{enumerate}

\begin{some_custom_environment}{arg}[optional]
Key with dict or list value is interpreted as environment.

This works syntactically, without semantics.
\end{some_custom_environment}
\end{document}

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

YeT-0.1.2.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

YeT-0.1.2-py3-none-any.whl (6.2 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