Skip to main content

A latex's superset

Project description

btex

A latex superset.

How to install

You can simply install btex with the pip package manager

pip install btex

Get started

The language is very similar to latex.
If you want to learn btex, take a look at the examples, I've also made a visual studio code extension for syntax highligthing and snippets.

Macros

Macros are predefined variables in the btex interpreter which will be ignored by the program and instantly converted into the latex alternative.
Macros are surrounded by double $, you can find a list of all the supported macros in the main python file of the interpreter.
Some examples of macros:

$$infinity$$ -> the infinity symbol
$$textwidth$$ -> the \textwidth unit
$$dot$$ -> the dot product symbol for math expressions
$$percent$$ -> since the % symbol is used in latex for comments, you can escape it using this macro

NOTE: if the document doesn't format as you want, you can force it to place some characters:

$$fs$$ -> forces a space
$$fn$$ -> forces a newline (putting \\)

Env

Some latex libraries can have some variables to set for customization. Since btex automatically imports used libraries without needing to include them manually, you can set some variables with the env.
You can set them in the file

@env {
    pdftitle = Document\
    var = value\
}

Or using a file

@env .env\

These are the variables you can change

Var name Description
pdftitle Used in the hyperref package \hypersetup{pdftitle={VAR}

Using components not yet supported

Since this project is open source, if you want to use a component that is not available on btex, you can clone this repository and add it by yourself, or just open an issue asking me to do it.
However, if you do really need a component, you can use the @latex attribute

@latex {
    your latex code
}

Everything you write in this block, will be ignored by the btex interpreter and will be put exactly how it is in the .tex output file.

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

btex-0.4.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

btex-0.4-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file btex-0.4.tar.gz.

File metadata

  • Download URL: btex-0.4.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.5 Windows/10

File hashes

Hashes for btex-0.4.tar.gz
Algorithm Hash digest
SHA256 7312fbb41c62ffd5d369a825628e2c7dc27a9b710b64901ab60adaf40d1e8a34
MD5 7a54591ea9f8f38011bc773f02655d81
BLAKE2b-256 a387fb684edbf4c2c9a05f2933507df22ba6eca60c8945dda0a57094dae53320

See more details on using hashes here.

File details

Details for the file btex-0.4-py3-none-any.whl.

File metadata

  • Download URL: btex-0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.5 Windows/10

File hashes

Hashes for btex-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 86a9da4e9e1f33c61b156b7e567adfaa176aa4b827574ee203100aa1753c30c2
MD5 e6951db71e40d336f401971fa987792c
BLAKE2b-256 673d6c7e126e91f5fbf1f60fecd50a917896570036318cf40f38b2f2e9b015d4

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