Math formulas rendering

https://www.phpbb.com/ideas/
Post Reply
Author:
peopleopinion
Posted:
Fri Aug 29, 2014 12:28 am
Rating:
Status:
New
Ideas Bot
Registered User
Posts: 309
Joined: Sat Oct 13, 2012 10:06 am

Math formulas rendering

Post by Ideas Bot » Fri Aug 29, 2014 12:28 am

What about to implement a new feature for writing and rendering math formulas into posts?
I implemented it with the use of an external service, as I talked into this post on my web site: http://peopleopinion.altervista.org/vie ... __EFoF_vUI.

Why?
I think having formulas well formatted and rendered as on paper, will help users (including mods and admins) to express better concepts and readers to understand better what writers wrote.
Having this feature with an external site works but slows the page rendering. So I think it will be a good thing to make things more quick for visitors and readers and more simple for admins implementing the feature into the core and having some option into the ACP to activate / deactivate and configure it.

User avatar
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 23562
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Math formulas rendering

Post by Paul » Fri Aug 29, 2014 7:38 am

The use for this will be really limited for nearly all forums, this is really better as extension in my opinion.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
peopleopinion
Registered User
Posts: 372
Joined: Thu Nov 07, 2013 7:12 pm
Contact:

Re: Math formulas rendering

Post by peopleopinion » Tue Jun 16, 2015 4:02 am

Paul wrote:The use for this will be really limited for nearly all forums, this is really better as extension in my opinion.
Extention? Well I don't know. There are some web sites that offer such a service to integrate in another web site or board as well as external service like I did into mine, here an example: http://peopleopinion.altervista.org/vie ... X-Z24G88-q.

So I was wondering that it could be an idea to evaluate just to insert in ACP an option to activate the reference to such web site (or a better one) while the core of the math formula code is not implemented into the phpbb core at all but just Linked to the external service. There are pretty good services out there. So may be this one could be an alternative solution to evaluate. Also to implement a feature this way could be very easy and it needs very few hardcoding and just one more var in database table to store if the option is active or not.

This scenario is like as doing referring to jquery library directly to the original dev web site instead to import it into own web site. (idea borrowed from "using jQuery with a CDN" article).

But I'm not an expert to evaluate every possible consequence of this scenario.
Please explicate why you voted negative or positive, so it will be possible to better understand each one's point of view.
Please visit and vote my website and express freely your opinion on it (phpbb ver.: 3.0.12):
http://peopleopinion.altervista.org
Thanks. Best Regards, peopleopinion.

User avatar
AmigoJack
Registered User
Posts: 4884
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Math formulas rendering

Post by AmigoJack » Tue Sep 29, 2015 7:31 am

peopleopinion wrote:possible consequence
An unavoidable consequence is that for everybody the board code needs a longer execution time, no matter if they use this feature or not. That's why an extension is by far the better solution.
The worst thing about censorship is ███████████

User avatar
peopleopinion
Registered User
Posts: 372
Joined: Thu Nov 07, 2013 7:12 pm
Contact:

Re: Math formulas rendering

Post by peopleopinion » Wed Sep 30, 2015 3:52 am

AmigoJack wrote:
peopleopinion wrote:possible consequence
An unavoidable consequence is that for everybody the board code needs a longer execution time, no matter if they use this feature or not. That's why an extension is by far the better solution.

Longer execution time that happens only if into the page browsed are present math formulas, though.
Please explicate why you voted negative or positive, so it will be possible to better understand each one's point of view.
Please visit and vote my website and express freely your opinion on it (phpbb ver.: 3.0.12):
http://peopleopinion.altervista.org
Thanks. Best Regards, peopleopinion.

User avatar
AmigoJack
Registered User
Posts: 4884
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Math formulas rendering

Post by AmigoJack » Wed Sep 30, 2015 8:05 am

peopleopinion wrote:only if
No, conditions need to be evaluated always.
The worst thing about censorship is ███████████

User avatar
peopleopinion
Registered User
Posts: 372
Joined: Thu Nov 07, 2013 7:12 pm
Contact:

Re: Math formulas rendering

Post by peopleopinion » Wed Sep 30, 2015 9:58 pm

AmigoJack wrote:
peopleopinion wrote:only if
No, conditions need to be evaluated always.
Evaluating the condition "if there is a formula into the page" is pretty fast than rendering it (if found any into the page).
I have implemented as bbcode formulas rendering feature into my forum/site as external service and the event "render the formula" is triggered only if a "a formula was found" event calls the "render" event. So browsing a page is not quicker or slower if I disable or enable the feature respectively on pages where no formulas are present: the load speed is about the same. If there is any difference, is for the computer timing, not for the the "human timing": humans (me too) don't get any significant differences when browsing pages with or without that function active if in the page isn't present any formula. Of course if some formulas are in the page, then the page is a little bit slower, very few seconds. Maybe it depends on the fact that it is an external plugin to be load from another server that has to be contacted to render the math formulas. I don't know what is its "normal" workload and general server performances. But usually it works pretty well, IMHO, because its loading timing is still acceptable: a little price to see complex formulas rendered well formatted instead the inline version, that was mostly incomprehensible for the majority of people.
And, anyway, in my experience, the external service my site uses, the page isn't as slow as when into is active the adds or the social widget (facebook, twitter, g+ or google analytics, etc.): infact adds and social widgets make pages slower than math formula rendering widget.

The problem with the external widget is that the math formula is not rendered at all if the external server is down or the related web site service closes for any reason. In this (rare) case will be showed an error. This problem will be solved if the feature will be implemented into the same web space and integrated (in the core or as ext).
Please explicate why you voted negative or positive, so it will be possible to better understand each one's point of view.
Please visit and vote my website and express freely your opinion on it (phpbb ver.: 3.0.12):
http://peopleopinion.altervista.org
Thanks. Best Regards, peopleopinion.

User avatar
AmigoJack
Registered User
Posts: 4884
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Math formulas rendering

Post by AmigoJack » Thu Oct 01, 2015 7:59 am

peopleopinion wrote:Evaluating the condition "if there is a formula into the page" is pretty fast
That alone is too simplified - it's a formula per post, hence a condition needs to be evaluated for topics like these at least 15 times. And now add all the other ideas from you where posts should be augmented. Yet only fraction of phpBB administrators will use formulas at all - that's why it is still a rather wasted bloat to the core - no matter how fast the additional code is: it has to be executed and will always affect performance.
The worst thing about censorship is ███████████

User avatar
peopleopinion
Registered User
Posts: 372
Joined: Thu Nov 07, 2013 7:12 pm
Contact:

Re: Math formulas rendering

Post by peopleopinion » Fri Oct 02, 2015 2:23 am

AmigoJack wrote:
peopleopinion wrote:Evaluating the condition "if there is a formula into the page" is pretty fast
That alone is too simplified - it's a formula per post, hence a condition needs to be evaluated for topics like these at least 15 times. And now add all the other ideas from you where posts should be augmented. Yet only fraction of phpBB administrators will use formulas at all - that's why it is still a rather wasted bloat to the core - no matter how fast the additional code is: it has to be executed and will always affect performance.
IMHO we are talking about milliseconds. Which User is interested to milliseconds? (S)He doesn't even notice.
Also, if implemented as internal feature [or as installable ext] (in a lot of boards sooner or later some math is used), it would be possible to use conditional html phpbb template comments (are they called this way lines similar to: <-- IF S_MATH --><javascript to eval the math code><-- ENDIF --> ?). Such kind of implementation will prevent even the insertion of the js code if no [math] tag is in the page. So the evaluation of the code for rendering the math formula is 0 at all.

Any way this happens only if no formula is into the page. If there is some, than some slowness could be present. And not only for just one formula per post, but it could be more and more, depending on the number of formulas to be rendered into the whole page.

Sorry I don't understand the meaning of the following sentence:
AmigoJack wrote:And now add all the other ideas from you where posts should be augmented.
Yet only fraction of phpBB administrators will use formulas at all
I agree with, but admins aren't the lone users of the board.
Last edited by peopleopinion on Fri Oct 02, 2015 2:25 am, edited 1 time in total.
Please explicate why you voted negative or positive, so it will be possible to better understand each one's point of view.
Please visit and vote my website and express freely your opinion on it (phpbb ver.: 3.0.12):
http://peopleopinion.altervista.org
Thanks. Best Regards, peopleopinion.

User avatar
peopleopinion
Registered User
Posts: 372
Joined: Thu Nov 07, 2013 7:12 pm
Contact:

Re: Math formulas rendering

Post by peopleopinion » Fri Oct 02, 2015 2:24 am

And also, if present, who makes math formulas saves a lot of time instead because doesn't have to make images any more to communicate his/her thoughts, and images could be complicate (for someone at least) to make the right way and heavy to download.
Also without this feature users are motivated to use the linear notation that is a bit more difficult to interpret and so they are demotivated to write something math and try to write a lot of extended explications to explicate by using words to explicate a thing that a formula could explicate in less space and more exactly and the easier way.
Nevertheless this feature could start a positive stimulation in the direction of starting new board sites based on math topics. And everybody knows how much it will be such useful thing for a world that lacks so much of math passion ;) especially for young students would be really useful to allow them to exchange a lot of infos about this obscure subject that math sometimes is.
In my humble opinion the way to go would be to implement some kind of math editor engine... to place side by side to rendering engine. But this is something yet more complex.
Please explicate why you voted negative or positive, so it will be possible to better understand each one's point of view.
Please visit and vote my website and express freely your opinion on it (phpbb ver.: 3.0.12):
http://peopleopinion.altervista.org
Thanks. Best Regards, peopleopinion.

User avatar
AmigoJack
Registered User
Posts: 4884
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Math formulas rendering

Post by AmigoJack » Fri Oct 02, 2015 6:50 am

peopleopinion wrote:IMHO we are talking about milliseconds
No, it all depends on the underlying system - you don't know on which processor PHP is running and how many processor time it gets. Nowadys people use Raspberry Pis and suddenly it makes sense again to use slimweight software (not rage consuming memory).
peopleopinion wrote:(in a lot of boards sooner or later some math is used)
Even that is something I never experienced, being a user on many boards. Here on phpbb.com I haven't seen one topic with math in it. Not to speak of never having encountered formulas.
peopleopinion wrote:Which User is interested to milliseconds?
The owner. On a frequented board there could be hundreds of users being active at the same time, and suddenly all their "milliseconds" sum up to a remarkable performance hit.
peopleopinion wrote:conditional html phpbb template comments
...
the evaluation of the code for rendering the math formula is 0 at all
Yes, but not the template conditions - they're also processed everytime.
peopleopinion wrote:If there is some, than some slowness could be present
We're talking the whole time about the server side performance. The client side performance is a different subject; and based on how good the client is all the JS execution is no thing to care about.
peopleopinion wrote:Sorry I don't understand the meaning of the following sentence
Sum up all the conditions that would needed to be processed from all your other suggestions that are related to posts and you'll see how much more code needs to be executed. Everytime.
The worst thing about censorship is ███████████

User avatar
david63
Jr. Extension Validator
Posts: 12815
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Math formulas rendering

Post by david63 » Fri Oct 02, 2015 7:36 am

Interesting as this discussion may be, can I ask - "how may people actually use mathematical formulae when posting in a forum"?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email or as they will be ignored

Jocelyn79
Registered User
Posts: 11
Joined: Thu Mar 26, 2009 12:17 am
Location: France
Name: Jocelyn
Contact:

Re: Math formulas rendering

Post by Jocelyn79 » Thu Oct 12, 2017 5:13 pm

MathML was designed for the purpose of rendering mathematical formulas.
So, a better idea would be :
- either to allow the use of MathML in posts
- or create custom BBcodes that render MathML instead of HTML (I'm not sure if it is currently possible)

But again...how many of us need mathematical formulas in phpbb? :?

Click this link to see some examples of what MathML can display.
(it looks like there is good MathML support in Firefox, but not in Google Chrome)

Post Reply

Return to “phpBB Ideas”

Who is online

Users browsing this forum: Elias and 2 guests