Ask Your Question

user98448's profile - activity

2024-02-12 10:23:43 +0100 received badge  Notable Question (source)
2023-05-29 00:09:15 +0100 received badge  Popular Question (source)
2023-05-20 14:31:06 +0100 received badge  Self-Learner (source)
2023-05-20 14:31:06 +0100 received badge  Teacher (source)
2023-05-20 06:49:56 +0100 answered a question How to substitute a value into an expression without evaluation to convert it to LaTex?

I found another solution, which is better for me. It still requires me to use sympy, which is unfortunate because sympy

2023-05-20 04:38:52 +0100 marked best answer How to substitute a value into an expression without evaluation to convert it to LaTex?

How can I convert an expression to LaTex while substituting a variable value without evaluating the expression after substitution?

For example, I have an expression 5*x*y. The latex(5*x*y) is 5 \, x y as expected. But now I want to substitute a constant instead of a variable. For example 8 instead of x. The LaTex representation (latex((5*x*y).subs(x=8))) of which is would be 40 \, y, so the expression is automatically evaluated. But I want to get something like 5 \\cdot 8 y instead. Is that possible to do with SageMath?

I know something like that exists in SymPy. For example, take a look at the answer to:

It uses sympy.UnevaluatedExpr to wrap an expression to substitute the variable with. Is there anything like that in SageMath?

2023-05-20 04:38:52 +0100 received badge  Scholar (source)
2023-05-20 04:38:49 +0100 received badge  Supporter (source)
2023-05-20 02:34:03 +0100 received badge  Nice Question (source)
2023-05-19 21:27:25 +0100 received badge  Student (source)
2023-05-19 11:00:44 +0100 asked a question How to substitute a value into an expression without evaluation to convert it to LaTex?

How to substitude a value into an expression without evaluation to convert it to LaTex? Hello. How can I convert an expr