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.5.tar.gz (7.2 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.5-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: btex-0.5.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.7 Linux/6.17.0-22-generic

File hashes

Hashes for btex-0.5.tar.gz
Algorithm Hash digest
SHA256 7fe2bf041ecf2d05b2b2e617952c24758453516aef616b36488b49eed371a344
MD5 96edd52b7005558be17e38e4b18621f2
BLAKE2b-256 d5ccdf9ddba3498efbd09000f85dd7cde203199ebc135f4f70d508cc81325afc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: btex-0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.7 Linux/6.17.0-22-generic

File hashes

Hashes for btex-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6b8bedf65ec3acbabfda721819c5328b0d3d0a8008d4ba49750508fe563cb6b2
MD5 4486851ae24bf38ed581f42c1cde1aad
BLAKE2b-256 6aeb164d1a66146f765c8e92cbd4449c676b4c56351eb0e44557bdf85f24b759

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