Latex cannot do addition or other mathematical operations like creating a graph from a sine equation--which program can be used for mathematical operations and then parsing the output to a pdf file--either via tex or pandoc or any other etc
1 Answers
Short one-word answer: Rstudio.
LaTeX alone is able to make some maths and nice plots with TikZ of PGFplots, and there also the possibility of integration with external tools as R, GNUplot, python, Mathematica, etc. that seem that is what you are looking for.
I'm not willing to start a flame war of what option is better because I know enough only one. So, without underestimate in any way stay with Tikz to make a histogram or switch to the emerging python and pythontex for the same or anything else, my suggestion is R.
Without doubt, R is also a well-know, versatile and powerful language as well as healthy major project, and more importantly (for this question), actually have a "smooth" relationship with LaTeX through several packages (Hmisc, xtable, stargazer, TikzDevice, etc.) but specially because knitr
allow a literate programming in Sweave files (.Rnw) or Rmarkdown files (.Rmd) where you can mix normal text and R code chunks to produce a LaTeX document where the R code have changed to plots, tables, any kind of maths/statistics, and almost whatever odd thing for a software primarily oriented to statistics (for instance, download and include bibtex references in the bibliography, make random exams, word clouds, diagrams, etc.)
In both type of files, R interpret the R code chunks, using the R packages knitr (or the older Sweave). The output is respectively a true Latex file (.tex), or a markdown file (.md) than can be exported to LaTeX (using pandoc), so in both cases the compilation might end with a PDF produced by LaTeX. You can make also this process with R and pandoc without RStudio, but is simply harder that just click in the "Compile PDF" button.
There are a lot of examples of Sweave and Rmarkdown files in this site making very different tasks, as plots (for instance, here and here), tables (see here) or a random math problem (here). Just search by knitr, Sweave and Rmarkdown and enjoy it.
- 80,769