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

Preserve whitespace in math mode #49

Open
notjagan opened this issue Aug 16, 2016 · 9 comments
Open

Preserve whitespace in math mode #49

notjagan opened this issue Aug 16, 2016 · 9 comments
Labels

Comments

@notjagan
Copy link

As of now, whitespace (under the _ rule) is consumed in its entirety. However, newlines in math mode should be preserved. I'm not really certain how to make this change.

@HowardCohl
Copy link
Member

HowardCohl commented Aug 16, 2016

@physikerwelt Do you have any idea about this? Carriage returns are getting eaten. How should we preserve them?

Example

x=a+b+c
+d+\sum_{n=0}^\infty a_n

becomes

x=a+b+c+d+\sum_{n=0}^\infty a_n

The carriage returns should be preserved.

@physikerwelt
Copy link
Member

I don't get the context.
texvc does not allow equation
https://en.wikipedia.org/wiki/User:Physikerwelt/cases

@HowardCohl
Copy link
Member

@physikerwelt Ok. I changed the above example.

The carriage returns are important.

@physikerwelt
Copy link
Member

@HowardCohl the example you give still does not render for me.

@HowardCohl
Copy link
Member

@physikerwelt I don't know what happened. I changed the markup, but the change did not appear.

I have updated the math source and also edited https://en.wikipedia.org/wiki/User:Physikerwelt/cases to demonstrate.

@HowardCohl
Copy link
Member

Of course, I know a way to fix the issue, but I don't know if you would be happy with this.
Everytime you have a carriage return, you could insert a special string such as <_> and after texvcjs has processed the code, every time you find a <_> you then replace it with a carriage return.

@physikerwelt
Copy link
Member

I'm not sure about the problem. Both expression look the same for me on my userpage. What's the significance of the the newline. And why do you want to preserve the newline.

Let me guess:

You want to present the string that was processed by texvc to a human being?

@HowardCohl
Copy link
Member

@physikerwelt I think we've had this discussion along the lines of conversations with Bruce in one of our GitHub issues regarding LaTeXML (I might be able to find the discussion if I was able to search for GitHub issues I've participated in a certain GitHub repo).

Of course, the rendered result is the same.

The formatting (with return characters) is a good thing, and has been chosen carefully by a human
so that it is easier to read (as a human). We do not want to lose that information.

@HowardCohl
Copy link
Member

@physikerwelt I don't remember the name of the Deyan's GitHub repo for LaTeXML servers that we had that long discussion about line breaking. I thought it was something like tlxpgsi or something like that.

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

No branches or pull requests

3 participants