Is there a calculator with LaTeX-syntax?

前端 未结 17 1980
北海茫月
北海茫月 2020-12-12 17:00

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

I usually copy-paste the

相关标签:
17条回答
  • 2020-12-12 17:57

    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/

    0 讨论(0)
  • 2020-12-12 17:57

    This is not exactly what you are asking for but it is a nice package that you can include in a LaTeX document to do all kind of operations including arithmetic, calculus and even vectors and matrices:

    The package name is "calculator"

    http://mirror.unl.edu/ctan/macros/latex/contrib/calculator/calculator.pdf

    0 讨论(0)
  • 2020-12-12 17:58

    There is none, because it is generally not possible.

    LaTeX math mode markup is presentational markup and there are cases in which it does not provide enough information to calculate the expression.

    That was one of the reasons MathML content markup was created and also why MathML is used in Mathematica. MathML actually is sort of two languages in one:

    • presentation markup
    • content markup

    To accomplish what you are after you'll have to have MathML with comibned presentation and content markup (see MathML spec).

    In my opinion your best bet is to use MathML (even if it is verbose) and convert to LaTeX when necessary. That said, I also like LaTeX syntax best and maybe what we need is a compact syntax for MathML (something similar in spirit to RelaxNG compact syntax).

    0 讨论(0)
  • 2020-12-12 17:58

    Emacs calc-mode accepts latex-input. I use it daily. Press "d", followed by "L" to enter latex input mode. Press "'" to open a prompt where you can paste your tex.

    Anyone saing it is not possible is wrong.

    0 讨论(0)
  • 2020-12-12 18:01

    You can run an R function called Sweave on a (mostly TeX with some R) file that can replace R expressions with their results in Tex.

    A tutorial can be found here: http://www.scribd.com/doc/6451985/Learning-to-Sweave-in-APA-Style

    0 讨论(0)
提交回复
热议问题