3 ms·
Kind of tangential, but it's also kind of surprising how difficult it is in LaTeX to make a plot of an equation. Say I have Equation \ref{eq}. Why can't I just
by semi-extrinsic 3y ago
Kind of tangential, but it's also kind of surprising how difficult it is in LaTeX to make a plot of an equation.
Say I have Equation \ref{eq}. Why can't I just say "plot \ref{eq} for x from -6 to 11" and get my graph?
And yes, I know about pgfplots, PSTricks, TikZ etc. But in all those cases, I need to define the same equation twice, in different syntax to boot. It's kind of unsatisfying.
- fsh 3y agoTeX is a very arcane language, and it doesn't support floating point numbers. Few languages would be less suited for making a plotting library.
- semi-extrinsic 3y agoBoth pgfplots and PSTricks and TikZ are plotting libraries. It seems like it shouldn't be that hard to let them plot an equation written elsewhere in different syntax.
- IlliOnato 3y ago> Say I have Equation \ref{eq}. Why can't I just say "plot \ref{eq} for x from -6 to 11" and get my graph? Pretty much for the same reason you cannot press a word and get a pop-up dictionary definition in a paper book.
- semi-extrinsic 3y agoTo be clear, I meant in the LaTeX source code. And there I can already write code that plots equations, I just have to re-type the equation in a new syntax.
- IlliOnato 3y agoTeX is about representation, not semantics, by design. To do anything useful with a function (like plotting) you need to get semantics. An often cited example: what is f(x+y) ? Is it function f with x+y as its argument, or constant f multiplied by (x+y) ? TeX gives you no clue. Or what is this i in your equation? Is it an index variable, or a square root from minus one? You as a human figure this out by looking at the context and using domain knowledge. So does a "TeX to HTML/MathML converter". It is ultimately built on heuristics, and cannot be otherwise. That's why I said basically "for the same reason a paper page is not interactive". It was designed this way! The goal of TeX was to generate beautiful printed page. The need for semantic structure was not anticipated. To do semantics you need a "semantic version of MathML", or a language used by Wolfram's product, etc.