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

How do you wrap the content ? #21

Closed
sumesh1993 opened this issue Dec 24, 2019 · 8 comments
Closed

How do you wrap the content ? #21

sumesh1993 opened this issue Dec 24, 2019 · 8 comments

Comments

@sumesh1993
Copy link

I have big question, it is rendering in one line. How do i wrap it such that it comes on the next line

Screenshot 2019-12-24 at 9 11 26 PM

@ShaMan123
Copy link
Owner

Well, that's a question. A very complicated one.
The simplest approach would be to render this math into 3 MathViews, then apply styling on the parent container view.

@sumesh1993
Copy link
Author

sumesh1993 commented Dec 27, 2019

i figured out a way, but \begin{flushleft} and \end{flushright} doesnt seem to be working

@ShaMan123
Copy link
Owner

Try looking into mathjax docs

@sumesh1993
Copy link
Author

Does your library use mathjax under the hood for iOS and Android ? Because on web the latex is rendering perfectly using mathjax, but on iOS its not working as expected.
This is the latex When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

@ShaMan123
Copy link
Owner

ShaMan123 commented Jan 8, 2020

On the web it surely wraps content with no issues. MathJax is designed mainly for web and not long ago they started supporting nodejs rendering. This library is an adaption of the node version, therefore lacking a true renderer, defaulting to svg.
This is why you can't wrap content, it's svg.
iOS might manage this once rendering will be done by a native library (=no svg, can't say yet, haven't had the time to test) and there might be a very complex way to do this with svg (or component mirroring from web to RN) but it isn't on the roadmap.
PRs are welcome.

@ShaMan123
Copy link
Owner

ShaMan123 commented Jan 8, 2020

BTW the android version has a resizeMode prop that might help in some manner.

@ShaMan123
Copy link
Owner

A final thought:
If it's crucial you could use a WebView and some internals of the mathjax adaptor to render html string.
This should work

@ShaMan123
Copy link
Owner

#22

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

2 participants