Skip to content

Anton-4/asciimath2latex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 

Repository files navigation

asciimath_parser

Parse multi-line ascii-math and export to a nice latex document.

syntax

check http://asciimath.org/ to get an overview of all symbols

disclosure

Expect some bugs. I have deviated from the ascii-math standard in some places according to my own preferences.

executing

navigate to the parser folder, put input in src/main/resources/input.fastm, output will be in output.tex, run with sbt run.

purpose

With ascii-math you can type math quickly while maintaining readability!

ascii-math code:

### 1

to prove or disprove: $E[A/B] = (E[A])/(E[B])$

$
A: A sub ZZ
B: B sub ZZ\\ \{0\}
E[B] != 0
$

$
E[A/B] &= sum_{a in A} sum_{b in B} a/b Pr[A=a, B = b]  @ joint of independent vars
&= sum_{a in A} sum_{b in B} a/b Pr[A=a]*Pr[B = b]
$

$
(E[A])/(E[B]) = (sum_{a in A} a*Pr[A=a])/(sum_{b in B} b*Pr[B=b])
$

the above equations are clearly not equal

corresponding latex code:

\subsubsection{  1 }

to prove or disprove: $E\left[\frac{A}{B}\right]=\frac{E\left[A\right]}{E\left[B\right]}$

\begin{align*}
A:A\subset \mathbb{Z}\\
B:B\subset \mathbb{Z}\backslash\{0\}\\
E\left[B\right]\ne 0
\end{align*}

\begin{align*}
E\left[\frac{A}{B}\right]&=\sum_{{a\in A}}\sum_{{b\in B}}\frac{a}{b}Pr\left[A=a,B=b\right]&& \text{ joint of independent vars}\\
&=\sum_{{a\in A}}\sum_{{b\in B}}\frac{a}{b}Pr\left[A=a\right]\cdot Pr\left[B=b\right]
\end{align*}

\begin{align*}
\frac{E\left[A\right]}{E\left[B\right]}=\frac{\sum_{{a\in A}}a\cdot Pr\left[A=a\right]}{\sum_{{b\in B}}b\cdot Pr\left[B=b\right]}
\end{align*}

the above equations are clearly not equal

About

Write math documents fast and easy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages