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

LaTeX Support in mobile #2660

Closed
Yoshi8765 opened this issue Jun 10, 2018 · 14 comments · Fixed by #4005
Closed

LaTeX Support in mobile #2660

Yoshi8765 opened this issue Jun 10, 2018 · 14 comments · Fixed by #4005

Comments

@Yoshi8765
Copy link

Yoshi8765 commented Jun 10, 2018

The Zulip app currently does not render LaTeX formatting correctly.

A simple example from a user in my realm:

  • Correctly rendering visual of post in desktop app:
    image

  • Incorrect render on Android:
    image

  • source code:

\text{DRYLAB WEEK OF 6/10/18} 
```
```latex
General
```
- These updates will either come in the form of Hardware/Software/Simulations or Chromastat/Simulations or Chromastat/Game/Simulations

```latex
Chromastat
```
We will be meeting on Tuesday to talk about expectations, deadlines, and get started with work. We have gone in depth with how the device is built and programmed so far. 

```latex
Simulations
@timabbott
Copy link
Member

What's the status on this? I just got a report about it from a friend.

@gnprice
Copy link
Member

gnprice commented Sep 24, 2018

There's some work in #2690 on the underlying infrastructure in the app to enable us to support this. It's a bit tricky, and it's been stalled for a while; I expect we'll return to it after we complete some other significant upgrades like #2788 .

@timabbott
Copy link
Member

I just got another request for LaTeX support in mobile (I think I've seen at least 4 people ask for it), so we might want to think about picking this up now that #2788 is done.

@borisyankov
Copy link
Contributor

I expect we'll return to it

I think that day is today :) (for the PR review part)

@vladp
Copy link

vladp commented Nov 30, 2018

Thx for taking up the challenge of figuring out how to do this for react native.

Nobody is able to solve this problem, within react-native (to add the capability to display latex or MathML).

I have been researching this on and off for a couple of months, and the only thing I could find is that this need is listed in React-native feature request tracker:

https://react-native.canny.io/feature-requests/p/latex-or-mathml-rendering-in-reactnative

It seems like rendering latex/mathML from a Webview is the only viable path at the moment.

@jainkuniya
Copy link
Member

hey @vladp!
Yup, we will be rendering latex in the webview itself. In fact our whole message list is webview. :)

@gnprice
Copy link
Member

gnprice commented Feb 16, 2019

Bumping the priority because we just got another request for this feature -- with Tim's comment above, I guess that means at least 5 different people asking for it :-) , which is quite a lot.

@parthi2929
Copy link

After trying multiple platforms I just settled for zulip only because it supported latex.. now I discover it does not yet in mobile.. Please add this support ASAP.. any road map?

@berceanu
Copy link

I second this request.

rk-for-zulip added a commit to rk-for-zulip/zulip-mobile that referenced this issue Oct 4, 2019
At present, when loading content into the WebView, we inject all
non-image assets as part of the generated HTML. This is more than a
bit wasteful, considering that large swaths of the supporting CSS and
JavaScript is entirely static from invocation to invocation;
additionally, it makes KaTeX support somewhere between "nontrivial"
and "impossible".

This commit creates a build subsystem which can inject static
webview-supporting assets into the application bundle, into a
`webview` directory.

We also create a stub directory for the subsystem copy assets from; at
present this contains only a README.md file (which will *not* be
copied), but this will be expanded in the following series of commits.

Inspired by zulip#2690. Assists with zulip#2660, zulip#3595, and potentially many
other issues.
rk-for-zulip added a commit to rk-for-zulip/zulip-mobile that referenced this issue Oct 4, 2019
At present, when loading content into the WebView, we inject all
non-image assets as part of the generated HTML. This is more than a
bit wasteful, considering that large swaths of the supporting CSS and
JavaScript is entirely static from invocation to invocation;
additionally, it makes KaTeX support somewhere between "nontrivial"
and "impossible".

This commit creates a build subsystem which can inject static
webview-supporting assets into the application bundle, into a
`webview` directory.

We also create a stub directory for the subsystem to copy assets from;
at present this contains only a README.md file (which will *not* be
copied), but this will be expanded in the following series of commits.

Inspired by zulip#2690. Assists with zulip#2660, zulip#3595, and potentially many
other issues.
rk-for-zulip added a commit to rk-for-zulip/zulip-mobile that referenced this issue Oct 9, 2019
At present, when loading content into the WebView, we inject all
non-image assets as part of the generated HTML. This is more than a
bit wasteful, considering that large swaths of the supporting CSS and
JavaScript is entirely static from invocation to invocation;
additionally, it makes KaTeX support somewhere between "nontrivial"
and "impossible".

This commit creates a build subsystem which can inject static
webview-supporting assets into the application bundle, into a
`webview` directory.

We also create a stub directory for the subsystem to copy assets from;
at present this contains only a README.md file (which will *not* be
copied), but this will be expanded in the following series of commits.

Inspired by zulip#2690. Assists with zulip#2660, zulip#3595, and potentially many
other issues.
rk-for-zulip added a commit to rk-for-zulip/zulip-mobile that referenced this issue Oct 10, 2019
At present, when loading content into the WebView, we inject all
non-image assets as part of the generated HTML. This is more than a
bit wasteful, considering that large swaths of the supporting CSS and
JavaScript is entirely static from invocation to invocation;
additionally, it makes KaTeX support somewhere between "nontrivial"
and "impossible".

This commit creates a build subsystem which can inject static
webview-supporting assets into the application bundle, into a
`webview` directory.

We also create a stub directory for the subsystem to copy assets from;
at present this contains only a README.md file (which will *not* be
copied), but this will be expanded in the following series of commits.

Inspired by zulip#2690. Assists with zulip#2660, zulip#3595, and potentially many
other issues.
gnprice pushed a commit that referenced this issue Oct 11, 2019
At present, when loading content into the WebView, we inject all
non-image assets as part of the generated HTML. This is more than a
bit wasteful, considering that large swaths of the supporting CSS and
JavaScript is entirely static from invocation to invocation;
additionally, it makes KaTeX support somewhere between "nontrivial"
and "impossible".

This commit creates a build subsystem which can inject static
webview-supporting assets into the application bundle, into a
`webview` directory.

We also create a stub directory for the subsystem to copy assets from;
at present this contains only a README.md file (which will *not* be
copied), but this will be expanded in the following series of commits.

Inspired by #2690. Assists with #2660, #3595, and potentially many
other issues.
@gnprice gnprice assigned rk-for-zulip and unassigned borisyankov Oct 31, 2019
@gnprice
Copy link
Member

gnprice commented Oct 31, 2019

With #3636 landed, our app infrastructure is now in much better shape to be able to implement this feature! So I'm hoping we'll have this done sometime soon.

@thosgood
Copy link

thosgood commented Dec 4, 2019

I've just started using Zulip mobile and LaTeX rendering half works: the maths is correctly rendered, but then there's a unicode approximation that follows the rendered maths immediately afterwards.

gnprice pushed a commit to gnprice/zulip-mobile that referenced this issue Mar 27, 2020
This incorporates the same KaTeX library we use in the Zulip webapp.
We add the dependency, add a build-webview step to copy the needed
files, and apply the stylesheet in our WebView HTML.

There are a couple of cases where the resulting HTML and CSS
doesn't quite look right.  We'll go on to take care of those in
upcoming commits.

[greg: adapted to this build-webview structure]

Fixes: zulip#2660
@gnprice
Copy link
Member

gnprice commented Mar 27, 2020

More voices of people eager for this feature, over on #3744:

I'd just like to comment that this is a really compelling feature for the many research groups that grumble daily about Slack lacking math and language-specific code. "That all works in Zulip" is a much stronger pitch than "it works with some clients". Thanks, @ray-kraesig, for implementing, and thanks in advance for the review, @gnprice.

and

We've been waiting for this for a long time. Looking forward to it!

@cortner
Copy link

cortner commented Mar 29, 2020

I get the same problem as thosgood on the iPad app. It is fine in the browser.

gnprice pushed a commit to gnprice/zulip-mobile that referenced this issue Mar 31, 2020
This incorporates the same KaTeX library we use in the Zulip webapp.
We add the dependency, add a build-webview step to copy the needed
files, and apply the stylesheet in our WebView HTML.

There are a couple of cases where the resulting HTML and CSS
doesn't quite look right.  We'll go on to take care of those in
upcoming commits.

[greg: adapted to this build-webview structure]

Fixes: zulip#2660
gnprice added a commit to gnprice/zulip-mobile that referenced this issue Mar 31, 2020
This incorporates the same KaTeX library we use in the Zulip webapp.
We add the dependency, add a build-webview step to copy the needed
files, and apply the stylesheet in our WebView HTML.

There are a couple of cases where the resulting HTML and CSS
doesn't quite look right.  We'll go on to take care of those in
upcoming commits.

Fixes: zulip#2660
@gnprice gnprice closed this as completed in 54e597d Apr 2, 2020
@gnprice
Copy link
Member

gnprice commented Apr 4, 2020

LaTeX support in the mobile app is now released! The new version is 26.24.147 if you're on iOS, and 26.25.148 on Android. (They're the same app built from the same code, just different version numbers due to a hiccup in the build.)

@Yoshi8765 @parthi2929 @berceanu @thosgood @jedbrown @pyrocto @cortner and everyone else who's been wanting this -- please update, try it out, and don't hesitate to file new issues if you find something that doesn't look right 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment