Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect latex generated for \notsubset in editor #790

Open
jaltekruse opened this issue Dec 18, 2017 · 8 comments
Open

Incorrect latex generated for \notsubset in editor #790

jaltekruse opened this issue Dec 18, 2017 · 8 comments
Assignees

Comments

@jaltekruse
Copy link
Contributor

Calling .latex() on a Mathquill editor that contains \notsubset will generate \not \subset.

Planning on trying to debug into the library to try to find a cause, but thought it was worth reporting as I saw it.

@kschaefe
Copy link
Member

Is there some visual difference between \notsubset and \not\subset? Or are you just concerned that that LaTeX is being transformed (normalized) and you weren't expecting that?

@jaltekruse
Copy link
Contributor Author

The original symbol is a subset symbol with a line through it. The resultant latex generates a separate "not" and "subset" symbol. It looks like there is some code that is finding subwords in symbol names when generating latex, but I would assume it is already in some tree representation that should have a clear separation between different symbols. So it seems odd that anything would need to be parsed out of the in memory representation to generate the latex.

@jaltekruse
Copy link
Contributor Author

I realized this isn't incorrect latex, it is a compound symbol that isn't being recognized by the parser. The proper latex for the symbol is \not\subset, but these two commands together should become one symbol. Will try to take a look at the parser soon to understand how to fix it. @laughinghan is there support for other cases like this in the parser today that I could look at?

@jaltekruse
Copy link
Contributor Author

This is also an issue for all of the number sets like \R, \N, \Z
They all produce symbols like \mathbb{Z} that are valid latex, but not currently parseable by MathQuill.

@kevinbarabash
Copy link

This also breaks copy/pasting of the \notsubset symbol since when you paste it, what's being pasted is \neg\subset.

Screen Shot 2021-11-21 at 11 06 52 AM

@jaltekruse
Copy link
Contributor Author

jaltekruse commented Jan 25, 2022

Part of this was fixed here the symbols for sets of numbers like \R, \N, \Z - #910

Still need to fix all of the symbols that have a preceding \not, there are several beyond \not\subset. Testing things out on overleaf, it appears you can put a \not before just about any symbol to get a version of it with a line through it. So for compatibility with Latex we may want to look at implementing this in a generic way while fixing it, rather than just fixing it for the few symbols with unicode versions of the symbols with a slash through them. For example, while the spacing kind of sucks, this is apparently valid latex.

\not a

Which produces this:
image

@jaltekruse
Copy link
Contributor Author

And if we do decide to go that route, this is then kind of related to implementing \cancel #953

@sharkx
Copy link

sharkx commented Sep 25, 2022

This also breaks copy/pasting of the \notsubset symbol since when you paste it, what's being pasted is \neg\subset.

Screen Shot 2021-11-21 at 11 06 52 AM

I'm having the same issue in a different context. I have created a very simple plugin for the summernote editor which allows insert and edit of existing elements.

When I enter the symbol, I need to type \nsup, and the latex I get back is \not\subset.
But if I go back and edit and use \not\subset to initialize the input field, it gets transformed to \neg\subset.
Any hints on how to avoid or fix this ?
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants