Mathics icon indicating copy to clipboard operation
Mathics copied to clipboard

Better rendering for Conjugate [post 1.1]

Open suhr opened this issue 3 years ago • 9 comments

Currently it is rendered as Conjugate[x], but it would be nice to render it as x^{*} instead.

suhr avatar Oct 07 '20 14:10 suhr

@suhr Is this something Mathematica does?

GarkGarcia avatar Oct 13 '20 20:10 GarkGarcia

It seems so. At least it has x^{*} syntax: https://reference.wolfram.com/language/ref/Conjugate.html.

suhr avatar Oct 13 '20 21:10 suhr

image

I just checked, and Mathematica doesn't do the formatting.

We already have the conjugate symbol btw:

https://github.com/mathics/Mathics/blob/27a0907abb98e37fd652c162084bcdee69716862/mathics/core/characters.py#L183-L185

Works as expected too:

image

but it would be nice to render it as x^{*} instead.

I agree, but I also think that might be confusing. Might be better if we stick with what Mathematica does.

Maybe we can close this issue?

weakit avatar Oct 17 '20 17:10 weakit

So we need to implement TraditionalForm.

suhr avatar Oct 17 '20 18:10 suhr

TraditionalForm is the pretty much rendered TeXForm:

image

TeXForm in mathics is kinda incomplete, there's a lot of formatting that's missing—including conjugate:

mathematica mathics
image image

The only thing I think TeXForm properly formats is Sqrt, Power, Times and Plus. I don't think it does anything else.

image

I actually tried to get TeXForm to work a long time ago (before @GarkGarcia started working on it and mathics dev was kinda dead) and couldn't. I don't really know/understand (I'm kinda stupid lol) the internals well enough to help with that. I do know a bit more now that I've done some research, and I'm pretty sure this is going to be a lot of work.

Good Luck, and I'll try to help as much as I can.

weakit avatar Oct 18 '20 16:10 weakit

To set expectations on getting stuff like this fixed, it is much harder find people to fix problems than it is to find problems.

https://github.com/mathics/Mathics/issues/912 has my views of the biggest, and most worthy problems to address (at least for me) as of about a month ago. You can also use that as a gauge for how fast progress has been (although most of these are post 1.1.0 items)

Personally, I can't imagine I'd ever personally desire a need for better rendering of conjugate or using/improving TeXForm, or TraditionalForm. But hey, I don't have a crystal ball, so you never know.

If there is something that is broken and it bothers you, the most likely way to get it fixed is to work on it.

rocky avatar Oct 18 '20 17:10 rocky

Personally, I can't imagine I'd ever personally desire a need for better rendering of conjugate or using/improving TeXForm, or TraditionalForm. But hey, I don't have a crystal ball, so you never know.

The mathics web interface uses TeXForm to display results, iirc. Maybe that's important enough for someone to consider patching up TeXForm.

Also, I think we should probably swtich from using TeXForm to something else for the web interface. We should be using StandardForm instead.

weakit avatar Oct 21 '20 07:10 weakit

The mathics web interface uses TeXForm to display results.

If I have it correct, at least for graphics, Django interface uses XML which is MathML

Also, I think we should probably swtich from using TeXForm to something else for the web interface. We should be using StandardForm instead.

In general, if you look at #912, unless someone is interested in that, this will be fading in favor of a Jupyter interface, and mathicsscript which are each in their own repositories.

There is a lot of talk about what we could be doing. As I've said before, to turn this in to something that is done, just start working on whatever it is that interests you.

For myself, the backlog for getting things I am interested in done is already too long and already has too many things that need to be unblocked before I can get to what I am more interested in.

rocky avatar Oct 21 '20 12:10 rocky

If I have it correct, at least for graphics, Django interface uses XML which is MathML

Eh, guess I was wrong, They both have the same amount of functionality tho. It would be pretty easy to extend the other if you could figure out how to get either one working.


For myself, the backlog for getting things I am interested in done is already too long and already has too many things that need to be unblocked before I can get to what I am more interested in.

It's ok lol I don't think that there's really any expectation of you, or any of us to help out. It's great that you are. We're all doing this for our own individual reasons, but that doesn't really matter—either way, it's helping the project out.

Mathics was pretty much dead a while ago, so development is going to be slow, and it will take a good while before it picks up pace.

There is a lot of talk about what we could be doing. As I've said before, to turn this into something that is done, just start working on whatever it is that interests you.

Even making an issue, and active discussion counts as progress imo. This isn't something that I can work on, especially right now. But this issue and the discussion that happened here might be useful to someone else that's trying to fix this in the future. That someone might even end up being me.

weakit avatar Oct 22 '20 18:10 weakit