General ⇒ Convert a/b to \frac{a}{b}
-
- Posts: 1
- Joined: Tue Dec 09, 2014 10:36 pm
Convert a/b to \frac{a}{b}
Somebody knows a converter to translate normal math expression like 1+(1/pi) to LateX language 1+\frac {1} {$\pi$}
Thanks in advance.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Convert a/b to \frac{a}{b}
to be honest, i don't know if there is a converter out there. But i know one thing for sure. Everything which is converted automatically to LaTeX needs careful checking and lots of fixing, as a converter cannot understand the equation.
Typing it directly will be more save and hence you will be faster.
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Convert a/b to \frac{a}{b}
welcome to the forum!
There's pretty new TeX engine called ConTeXt. It provides a module with the name
calcmath
, which does what you want, directly within the code. It's implemented in Lua, so it should be possible to make it work with LuaLaTeX, because the ConTeXt syntax is very different.Here is a compilable example:
Code: Select all
\usemodule[calcmath]
\startluacode
function moduledata.calcmath.tex(str,mode)
context(moduledata.calcmath.totex(str,mode))
end
\stopluacode
\starttext
\displaycalcmath{1+(1/pi)}
\stoptext
Already
Code: Select all
\usemodule[calcmath]
\starttext
\displaycalcmath{1+(1/pi)}
\stoptext
Stefan
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Convert a/b to \frac{a}{b}

- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Convert a/b to \frac{a}{b}

Stefan