有没有 LaTeX 语法的计算器? [英] Is there a calculator with LaTeX-syntax?

查看:35
本文介绍了有没有 LaTeX 语法的计算器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 LaTeX 中编写数学时,我经常需要对我的 LaTeX 源代码中的数字执行简单的算术运算,例如 515.1544 + 454 = ???.

When I write math in LaTeX I often need to perform simple arithmetic on numbers in my LaTeX source, like 515.1544 + 454 = ???.

我通常将 LaTeX 代码复制粘贴到 Google 中以获取结果,但我仍然需要手动更改语法,例如

I usually copy-paste the LaTeX code into Google to get the result, but I still have to manually change the syntax, e.g.

frac{154,7}{25} - (289 - frac{1337}{42})

frac{154,7}{25} - (289 - frac{1337}{42})

必须改为

154,7/25 - (289 - 1337/42)

154,7/25 - (289 - 1337/42)

为最常用的操作编写一个程序来执行此操作似乎微不足道.有能理解这种语法的计算器吗?

It seems trivial to write a program to do this for the most commonly used operations. Is there a calculator which understand this syntax?

我知道这样做完美是不可能的(因为停机问题).为我需要的简单案例做这件事是微不足道的.frac、cdot、sqrt 和其他一些标签可以解决问题.程序可能会在它不理解的情况下返回错误.

I know that doing this perfectly is impossible (because of the halting problem). Doing it for the simple cases I need is trivial. frac, cdot, sqrt and a few other tags would do the trick. The program could just return an error for cases it does not understand.

推荐答案

LaTeXCalc 项目就是为此而设计的.它将读取一个 TeX 文件并进行计算.如需更多信息,请查看主页 http://latexcalc.sourceforge.net/

The LaTeXCalc project is designed to do just that. It will read a TeX file and do the computations. For more information check out the home page at http://latexcalc.sourceforge.net/

这篇关于有没有 LaTeX 语法的计算器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆