Hello:
Somebody knows a converter to translate normal math expression like 1+(1/pi) to LateX language 1+\frac {1} {$\pi$}
Thanks in advance.
General ⇒ Convert a/b to \frac{a}{b}
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Convert a/b to \frac{a}{b}
Hi and welcome,
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.
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.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Convert a/b to \frac{a}{b}
Hi Diego,
welcome to the forum!
There's pretty new TeX engine called ConTeXt. It provides a module with the name
Here is a compilable example:
This gives:
Already
would suffice, but the additional code above fixes a problem with scaling of the delimiting parentheses.
Stefan
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
LaTeX.org admin
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Convert a/b to \frac{a}{b}
Oh, that looks interesting. I wonder how powerful it is. Seems like i have something to do this evening. 

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Convert a/b to \frac{a}{b}
Convert it to a package usable with LuaLaTeX. Or introduce it in a blog post on TeXwelt and here in English.
Stefan

Stefan
LaTeX.org admin