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

Equation not rendering properly. In case of long equations. How to move equation to the next line if i don't want to use horizontal scrolling. Also latex syntax => /cancel not working #30

Open
iamAliRaza opened this issue Sep 22, 2019 · 8 comments

Comments

@iamAliRaza
Copy link

iamAliRaza commented Sep 22, 2019

long equation like => f(x)=\frac d{dx}{(100+4x)}^{\textstyle\frac12}=\frac12{(100+4x)}^{\textstyle\frac12-1}\;\cdot\frac d{dx}(100+4x)

My Mathview width is "match_parent" and on smaller screens its starting horizontal scrolling
but i want remaining part of this equation in new line instead of horizontal scrolling.

Also

equation : \angle12;=;\mathrm\pi23;=;12;+;\cancel{34}

This equation is working fine online but not working with this lib MathView

@Aiosa
Copy link

Aiosa commented Sep 22, 2019

Hello, when placing such request, you need to learn some things first.

  1. describe your problem and what do you try to achieve
  2. add an example that is causing your problem, the code itself is much appreciated
  3. be polite, that means write full sentences, write meaningful messages

Otherwise, it may happen that such requests are ignored.
How we are supposed to help you? We don't have an oracle to perform miracles. What does the "big equation" means? What if all your problem is somewhere else entirely? Typos? Etc.?

We are not some robots waiting for anyone to help them solve their problems.

@iamAliRaza iamAliRaza changed the title Equation not rendering properly. In case of big equations. How to move equation to the next line. Equation not rendering properly. In case of big equations. How to move equation to the next line. Also latex syntax => /cancel not working Sep 22, 2019
@iamAliRaza iamAliRaza changed the title Equation not rendering properly. In case of big equations. How to move equation to the next line. Also latex syntax => /cancel not working Equation not rendering properly. In case of long equations. How to move equation to the next line if i don't want to use horizontal scrolling. Also latex syntax => /cancel not working Sep 22, 2019
@iamAliRaza
Copy link
Author

Hello, when placing such request, you need to learn some things first.

  1. describe your problem and what do you try to achieve
  2. add an examle that is causing your problem, the code itself is much appreciated
  3. be polite, that means write full sentences, write a meaningful messages

Otherwise, it may happen that such requests are ignored.
How we are supposed to help you? We don't have an oracle to perform miracles. What does the "big equation" means? What if all your problem is somewhere else entirely? Typos? Etc.?

We are not some robots waiting for anyone to help them solve their problems.

See my Comment I hope now that's enough for you 👍 :)

@Aiosa
Copy link

Aiosa commented Sep 22, 2019

About the auto line break, there is some discussion you can read, basically it does support auto break line, when enclosed in $ ... $ KaTeX/KaTeX#1023
However, this android katex support library for some reson forces $ to behave like $$, so nope, this is not possible without the developer's help here. You might email him if he doesn't repond, sometimes he's busy.
Another option is here to hide scroll bars, so the environment is not disturbed by bars, but it's possible to slide to the side so that user sees whole equation. This is something I did using this library.: having white background, nice and clean without ugly borders and sroll bars, only the equation itself is scrollable, but does not disturb the graphics (except it's cut suddenly on the edge). I created my own version of MathView class and modified configurationSettingWebView() method, so it contains (maybe some of these are already there):

 this.getSettings().setDisplayZoomControls(false);
    this.setVerticalScrollBarEnabled(true);
    this.getSettings().setBuiltInZoomControls(false);
    this.getSettings().setSupportZoom(false);

The problem with the rendering is that it contains \cancel function that is for some reason not supported in this library. Some advanced katex function doesn't work here, as I noticed years ago (you may look into issue history, check Accents on https://katex.org/docs/supported.html, half of them will not work). You have exactly three options:

  1. wait for the developer to add support for full katex
  2. find another way to show desired input (and I usually did, though I didnt find anything that would work to replace \cancel)
  3. give up (dont use any \cancel, e.g. xcancel, bcancel..)

Sorry I was so strict above, but it is really annoying to try to guess the meanings in such questions.
Hope I could help a bit.

PS: I wrote this because you might wait for the developer's response weeks. But I am unable to do much, only offer my experience with this lib. I coped with same problems, and solved them as written above. There are other libs as well, but at time this was the best regardless the issues mentioned above.

@balakrishnan1978
Copy link

@Aiosa: Could you please provide complete HTML example with CSS. How to add the lib in KaTeX and your code. Please guide to me.

@Aiosa
Copy link

Aiosa commented Oct 13, 2019

Hello, I am not exactly sure what you want from me. I didn't do anything with custom HTML or CSS here, I only modified a bit MathView.java and for some symbols that weren't supported I've used HTML eqivalent tags or codes. I didn't try to add any katex libraries. I just shared my experience with this library and how I coped with the issues mentioned by @iamAliRaza

@ghost
Copy link

ghost commented Feb 7, 2020

Hello, I am not exactly sure what you want from me. I didn't do anything with custom HTML or CSS here, I only modified a bit MathView.java and for some symbols that weren't supported I've used HTML eqivalent tags or codes. I didn't try to add any katex libraries. I just shared my experience with this library and how I coped with the issues mentioned by @iamAliRaza

Hello Aiosa,

I am going to use this library in my code. Could you please help me by telling which symbols are not supported so that i can handle it on prior.

Thanks.

@Aiosa
Copy link

Aiosa commented Feb 7, 2020

Hmm that will need some investigation as it was some years ago and meanwhile, OS was reinstalled, server shut down (for the app -I closed the development due to lack of the time)... So far I¨ve tried backups on drives and FB messenger files and found nothing... will look a bit more

EDIT: omg I found it! I didn't think i would actually find it but...you're lucky .) It is not exactly a list of symbols that do not work - it is rather a list of symbols that do work. I dont remember, whether it includes all symbols that work or just symbols that I would find useful (and work). At least, you can check only the missing symbols (against https://katex.org/docs/supported.html) and see whether they work, or treat all of the missing ones as if they don't). Looking on the images I probably did it in some paint program - printscreen and deleted all the not-working ones so probably it really includes all working symbols. Also, remember this is 2 or 3 years old list and some things may have changed. Cheers.
001
002

@ghost
Copy link

ghost commented Feb 10, 2020

Hmm that will need some investigation as it was some years ago and meanwhile, OS was reinstalled, server shut down (for the app -I closed the development due to lack of the time)... So far I¨ve tried backups on drives and FB messenger files and found nothing... will look a bit more

EDIT: omg I found it! I didn't think i would actually find it but...you're lucky .) It is not exactly a list of symbols that do not work - it is rather a list of symbols that do work. I dont remember, whether it includes all symbols that work or just symbols that I would find useful (and work). At least, you can check only the missing symbols (against https://katex.org/docs/supported.html) and see whether they work, or treat all of the missing ones as if they don't). Looking on the images I probably did it in some paint program - printscreen and deleted all the not-working ones so probably it really includes all working symbols. Also, remember this is 2 or 3 years old list and some things may have changed. Cheers.
001
002

Thanks a lot for your quick response.
Yes I will check this.

Thanks again.

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

3 participants