Crates.io | am-parse |
lib.rs | am-parse |
version | 0.99.6 |
source | src |
created_at | 2021-11-01 06:27:07.440773 |
updated_at | 2021-12-02 16:37:43.147535 |
description | Simple library for converting asciimath to other formats |
homepage | |
repository | https://github.com/gudn/am-parse |
max_upload_size | |
id | 475035 |
size | 66,592 |
Simple library for converting asciimath to other formats
use am_parse::{convert, OutputFormat};
fn main() {
println!("{}", convert("1/2", OutputFormat::Latex, vec![]));
}
convert
accepts three arguments:
f
, g
and others. This will be parsed as brace functions.This is not original AsciiMath. Some symbols is not
included (like TT
, |--
, etc); spaces is important -- they split input into
blocks. For example, 1+2/3
renders to 1+\frac{2}{3}
, but 1+2 / 3
renders
to \frac{1+2}{3}
. This works with functions arguments, fractions, superscripts
and subscripts. Also it includes brace functions: they are enforced to be Matrix
or expression in brackets.
root 3 x /4
-> \frac{\sqrt[3]{x}}{4}
sin 3*x
-> \sin{3\cdot x}
, sin3*x
-> \sin3\cdot x
fr"text"
-> \mathfrak{text}
ubrace^3 32
-> \underbrace{32}^3