Is there a way to put a formula in a variable (as in like a programming language variable) so that it can be referred to and rendered later? I was able to do this in Mathematica, but I'm moving away from Mathematica because I don't want to pay for it. I want to change to something more openly available like LaTex for displaying math formulas.
Note: I'm using Jupyter Notebook, which happens to use MathJax for LaTex rendering.
Though I mentioned programming language variables, Mathematica, and Jupyter Notebook, I am asking about doing this purely in LaTex (MathJax in my case).
I didn't have a lot of time with Mathematica, but here's an example of something that could be done in Mathematica
some_function = a/b
x = some_function/c
Display[x];
The result would be something like this:


\newcommand, which could go in the right direction.\pgfmathdeclarfunctioncould also be an option for you. – Gunter Jun 04 '21 at 14:17I did also wonder about putting the LaTex string in the Jupyter Notebook's kernel language (Python or whatever chosen) and then somehow output that for Mathjax, but I realize that's out of the scope of this site, and thus I will avoid that for this question.
– Frank Henard Jun 04 '21 at 22:17$so mathjax sees them then the posted answer should work. – David Carlisle Jun 04 '21 at 22:28