Skip to main content

Write LaTeX math quickly.

Project description

FastMathTeX

A quicker way to input math equations with LaTeX syntax.

Installing

You can install it via PyPI:

python3 -m pip install --upgrade fmtex

How to use

You are given a prompt where you can input a custom syntax, after you are done press [Enter] and the LaTeX output will be shown. Additionally it is copied to your clipboard with a dollar sign before and after.

To exit write 'exit in the prompt.

FastMath syntax

In FastMathTeX all words longer than one character are treated as commands, no checking is done to determine wether they are valid commands.

> hello world a b c
\hello \world a b c

Any text inside double quotes is placed inside a \text{} block.

> "such that"
\text{such that}
> "Also, \" can be escaped"
\text{Also " can be escaped}
> "Special \\ {characters} work too!"
\text{Special \\ \{characters\} work too!}

Any text inside percent signs is treated as raw LaTeX and is left unchanged. %\begin{cases}% becomes \begin{cases} and not \\begin{\cases}

> %\begin{cases}% \begin{cases}
\begin{cases} \\begin{\cases}

A number that immediately follows a letter becomes a subscript.

> a1, a2, a 3
a_1, a_2, a 3

There are shortcuts for many commands:

FastMath TeX Mnemonic
NN {\mathbb N}
ZZ {\mathbb Z}
QQ {\mathbb Q}
II {\mathbb I}
RR {\mathbb R}
CC {\mathbb C}
balign \begin{align}
ealign \end{align}
bcases \begin{cases}
ecases \end{cases}
bmat \begin{matrix}
emat \end{matrix}
bsmat \begin{bmatrix} Begin square-bracket matrix
esmat \end{bmatrix} End square-bracked matrix
bcmat \begin{Bmatrix} Begin curly-bracket matrix
ecmat \end{Bmatrix} End curly-bracket matrix
bbmat \begin{vmatrix} Begin beam matrix
ebmat \end{vmatrix} End beam matrix
bdmat \begin{Vmatrix} Begin double beam matrix
edmat \end{Vmatrix} End double beam matrix
lp \left( Left paren
rp \right) Right paren
ls \left[ Left square bracket
rs \right] Right square bracket
lc \left{ Left curly bracket
rc \right} Right curly bracket
lb \left| Left beam
rb \right| Right beam
la \left\langle Left angle bracket
ra \right\langle Right angle bracket
al \alpha
bt \beta
gm \gamma
dl \delta
DL \Delta
impl \implies
et & Latin 'and'
ett &&
el \\ End line
perc \% Percentage

Custom shortcuts

You can add your own shortcuts with the 'sub command.

> 'sub Rmn \mathbb R^{m \cdot n}
added Rmn -> \mathbb R^{m \cdot n}
> Rmn
\mathbb R^{m \cdot n}

You can also add a file that executes commands on startup. On Windows it is located at %LOCALAPPDATA%/_fmtexrc and on Unix-based systems at $HOME/.fmtexrc.

Example

> "Let" \; RR^n = lc (a1, a2, ldots, a_n) mid a_i in RR, 1 le i le n rc
\text{Let} \; {\mathbb R}^n = \left\{ (a_1, a_2, \ldots, a_n) \mid a_i \in \mathbb R, 1 \le i \le n \right\}

Rendered output:

$$ \text{Let} \; \mathbb R^n = \left\{ (a_1, a_2, \ldots, a_n) \mid a_i \in \mathbb R, 1 \le i \le n \right\} $$

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

fmtex-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

fmtex-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file fmtex-0.1.0.tar.gz.

File metadata

  • Download URL: fmtex-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for fmtex-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4bb614b0361ea76e3b12df354647c0cfd92041c19b9529e844b61113483f6ef
MD5 ca21cead6d2cfcead620cdd1609effea
BLAKE2b-256 8f6ec092da245338a9f3725dad09900078d3093be66042078455d8fbdc0c42e6

See more details on using hashes here.

File details

Details for the file fmtex-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fmtex-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for fmtex-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 deb5752a931d44209811a1e8fa01d1e9a9a64dfedf945857a49d010c42ff25e4
MD5 eb84f9172929c4f743c7339ffe9ec514
BLAKE2b-256 d187cddd1fcdc69e71dc6a507c57258b190276497c8f542165173451ffc18162

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