2021-02-08 11:55:37 +0200 | received badge | ● Famous Question (source) |
2021-02-08 11:55:37 +0200 | received badge | ● Notable Question (source) |
2021-02-08 11:55:37 +0200 | received badge | ● Popular Question (source) |
2015-03-31 11:16:08 +0200 | received badge | ● Good Answer (source) |
2015-03-02 22:21:57 +0200 | commented answer | substitute x*y by u Also interesting, using the above Symbolic ring example, if one factors first to expose two instances of |
2015-02-25 22:52:22 +0200 | commented answer | Solve for variable but variable is still in answer @wzawzdb, from the Sympy solvers documentation Use solve() to solve algebraic equations. We suppose all equations are equaled to 0, so solving x**2 == 1 translates into the following code: Run code block in SymPy Live |
2015-02-21 22:39:27 +0200 | received badge | ● Autobiographer |
2015-02-21 22:14:27 +0200 | answered a question | LaTeX Input I was actually working on something similar recently (Regular Expression Replacement in Sage). I got my function working and modified it to suit your needs. Please see the code and test output below or in this Sage Worksheet. Note that this is just a WIP solution; far from catch all. Your LaTeX will likely be much more complicated than the equation you entered as a sample, and the regular expression parser needs to be made aware of all those syntactic nuances (especially pairs of enclosing delimiters). This can be done by altering the What you really need is an all encompassing grammar for LaTeX equations. As @fredericc said, this is really not a simple thing to do, but if you feel so inclined, in the past I found that pyparsing is quite capable. Other popular parsing packages include PLY and PyBison.
(more) |
2015-02-18 02:41:25 +0200 | received badge | ● Nice Answer (source) |
2015-02-17 22:32:24 +0200 | received badge | ● Editor (source) |
2015-02-17 22:29:54 +0200 | commented answer | re.complile failure in a SageWS (Vertical Bar character) @William Stein Thanks for the quick response and showing multiple solutions to my issue! From the Traceback error I would have been chasing may tail unless you intervened. @kcrisman Ya that's odd to me as well ... maybe someone can share when the preprocessor can and can't handle the coercion. |
2015-02-17 22:24:45 +0200 | received badge | ● Supporter (source) |
2015-02-17 22:24:43 +0200 | received badge | ● Scholar (source) |
2015-02-17 10:51:43 +0200 | received badge | ● Student (source) |
2015-02-17 10:30:31 +0200 | received badge | ● Teacher (source) |
2015-02-17 08:02:37 +0200 | answered a question | How can I print equations just like latex? I was looking for the same thing and found these comments on the issue. This works with a _few_ functions, but not all. This is probably the best answer on why it does this simplification (and why there's no way to stop it) As far as the simplification mechanisms, you can look at this page. There are a number of them spread throughout that highlight different means: If you're looking to just reproduce the same text as your input, unfortunately I have found no better way than writing it out in LaTeX as a initial condition step so Sage doesn't mangle the form. This is a quick latex renderer that I modified from a this post on ask.sagemath |
2015-02-17 07:29:24 +0200 | asked a question | re.complile failure in a SageWS (Vertical Bar character) I was trying to use a Python Cookbook recipe (https://www.safaribooksonline.com/lib...) for multiple regular expression matches and substitutions in a Sagemath Cloud Sage Worksheet (final usage is for altering the __latex_/_repr_ attributes of an object). The code from the cookbook is below: When I run this code in the Worksheet I get the error: If I run the same code on a Sagemath Cloud IPython Notebook, Windows/Linux Python 2.7 session, or Windows/Linux Python 3.4 session the code outputs the correct result. I started debugging and found that Sage doesn't like the Has anyone seen anything like this before? I tried to search for it, but it seems so niche I didn't find any results. Any ideas for a workaround? Thanks Matt |