Advertisement:

Author Topic: Incorporating maths expressions (LaTeX notation) to SMF 2.x  (Read 3012 times)

Offline Ian Wild

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
    • yourmathstutoredinburgh on Facebook
    • iandavidwild on GitHub
    • iandavidwild on LinkedIn
    • @YourMathsTutor on Twitter
    • YourMathsTutor
Hi all,

It's been a while since I was last on here (over 10 years :o) but I'm back with more work on incorporating math notation editors into SMF - in this case SMF 2.0.15 and fMath.

Just for a bit of background, DragMath has "kind of" been abandoned - Chris Sangwin [nofollow], who is responsible for the STACK project (of which DragMath is a part) isn't progressing development of DragMath at the moment so I've been focusing on fMath [nofollow] as an alternative. At the moment this works in conjunction with the MathJax mod.

I have put together a new package mod for SMF 2.0.15, which is currently available from http://luminaconsultancy.com/wp-content/uploads/2018/06/SMF-fMath-0.0.1.zip [nofollow]

The project itself is fully available on GitHub at https://github.com/iandavidwild/SMF2.0-fmath-mod [nofollow]

... I now know how to build a new package :D - see my comments from 2007 at http://www.simplemachines.org/community/index.php?topic=192052.0

I would be grateful to know what you all think.

Thanks,

Ian.
« Last Edit: June 16, 2018, 02:17:08 PM by Ian Wild »

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #1 on: June 16, 2018, 02:24:44 PM »
I think it's great somebody actually did some development in this field, scientific mods ;).

I run an electronics forum, so I don't really need a whole equation editor (maybe in some rare cases, but this is in 2 or 3 posts a year, when some of the members start discussing some theoretical stuff in the audio section :)... audiophiles, go figure ::) :)), but what I actually needed was a modification of this mod, except I needed it to use Greek letters like Ω, μ, ω, Σ, δ, π, τ, φ, ect. I started doing some of the work, but it's not finished yet. I'll make it public when it is ;).

Although, I have to add that the mod is a little large (unpacked 180MB, or so)... the fonts it uses take up a large portion of that. Can't this be cut down to, one or two fonts?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline d3vcho(void)

  • Sempiterno
  • Lead Localizer
  • SMF Hero
  • *
  • Posts: 2,979
  • Gender: Male
    • frandominguez03 on GitHub
    • @_d3vcho on Twitter
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #2 on: June 16, 2018, 02:57:24 PM »
I know about a Spanish mathematics SMF forum that is still running 1.1.x because they are using a LaTeX mod for that version, and couldn't find a way to convert to 2.0.x. I think that this will be an interesting choice for them to finally decide to convert to 2.0.x.

Thanks for your work, and welcome back :)
"Demons are like obedient dogs; they come when they're called"

d3vcho(void)

Offline Ian Wild

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
    • yourmathstutoredinburgh on Facebook
    • iandavidwild on GitHub
    • iandavidwild on LinkedIn
    • @YourMathsTutor on Twitter
    • YourMathsTutor
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #3 on: June 17, 2018, 04:35:01 AM »
Hi GigaWatt and thanks for your message.

I run an electronics forum, so I don't really need a whole equation editor (maybe in some rare cases, but this is in 2 or 3 posts a year, when some of the members start discussing some theoretical stuff in the audio section :)... audiophiles, go figure ::) :)), but what I actually needed was a modification of this mod, except I needed it to use Greek letters like Ω, μ, ω, Σ, δ, π, τ, φ, ect. I started doing some of the work, but it's not finished yet. I'll make it public when it is ;).
Have you taken a look at MathQuill [nofollow]? I have a semi-working mod that will add this to a forum. This should be with us soon and I'll make this one public too. I'm thinking that MathQuill would be a great way for my students to learn LaTeX.
Although, I have to add that the mod is a little large (unpacked 180MB, or so)... the fonts it uses take up a large portion of that. Can't this be cut down to, one or two fonts?
Sadly yes your're right :( the fMath editor itself is very powerful (coming with different themes and so on). I've been trying to reach out to the author of fMath but so far haven't had a response - I don't want this plugin to be based on a dead project :o

Thanks again,

Ian.

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #4 on: June 17, 2018, 06:02:07 PM »
No, actually I only searched the SMF mods site. The mod in the link I provided is really close to what I need... with the exception that I have to rework it ;D.

I took a look at what MathQuill is and no, it doesn't actually suit my needs. You can write equations with it it can solve equations (useful, but not too useful on my forum), but you can't set custom symbols (Greek letters in particular) with it. See, I only need to be able to write "the resistance of the resistor is 2.2KΩ" without having to do a copy/paste of the symbol Ω (as I did now). That's why the mod I pasted the link to is exactly what I need... at least in form, I still have to edit the symbols :S. Basically, all I need is a simple symbol insertion tool ;).

I hope you do reach the fMath author because it does seem like a powerfull editor. As I wrote, I don't need this kind of equation edition power ATM, but if you think I can help in any way (code edits, testing, I'll have a test forum up and running in no time ;)), I'll be glad to help ;). My forum is mostly populated by pro/semi pro users in the field of electronics and nobody is actually that much into math (unfortunately ::)), but once (upon a time :D) I was thinking about opening a local forum about math problems, but this was a long time ago and I kind of gave up on the idea since I had to do a lot of things manually (customizations), but if there's a mod that can automate the process, integrate an equation editor inside the regular text editor, this might be incentive enough for me to go back and resurrect my old math forum idea ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,345
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
    • Study Force
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #5 on: June 18, 2018, 01:14:54 PM »
Would love to see this in action, any demos?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 57,233
  • Gender: Male
    • Kindred-999 on GitHub
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,345
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
    • Study Force
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #7 on: June 18, 2018, 01:22:10 PM »
@ Kindred, the first one doesn't support https. While link 2 and 3 are pretty much identical. I was hoping this mod would include an editor

Offline Ian Wild

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
    • yourmathstutoredinburgh on Facebook
    • iandavidwild on GitHub
    • iandavidwild on LinkedIn
    • @YourMathsTutor on Twitter
    • YourMathsTutor
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #8 on: June 18, 2018, 01:56:10 PM »
Hi all,

I've just been putting together a fresh install of SMF for the 'YourMathsTutor' forum at https://forum.yourmathstutor.info [nofollow]. Please do feel free to sign up if you wanted to check out the plugin in action (the fMath button has a 'pi and pencil' graphic on it).

While putting this together I noticed that there were some case sensitivity issues in the package I uploaded previously (the YourMathsTutor forum is deployed on Linux but I built it on Windows - I know: my bad :( ) so I have put together a new package here:

https://luminaconsultancy.com/?attachment_id=178 [nofollow]

If there is any more information anyone needs then please do let me know.

Thanks :)

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #9 on: June 19, 2018, 12:26:43 AM »
I was hoping this mod would include an editor

Exactly the problem I ran into when I had the math forum idea... nobody likes to write codes without seeing what the end result would be. In this particular case, a WYSIWYG editor is really needed.

If there is any more information anyone needs then please do let me know.

How do you use it? It tried using it on your forum, but when I click the Pi button, BBCode doesn't appear (a bug ???).

And, as Study Force asked, does the fMath mod include an editor with a realtime preview? Or is the Preview button the only way to get a preview ???.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,345
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
    • Study Force
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #10 on: June 19, 2018, 12:35:52 AM »
I was using a Xenforo forum and they had this incredible math editor. I would surely pay for an add-on like that

Offline Ian Wild

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
    • yourmathstutoredinburgh on Facebook
    • iandavidwild on GitHub
    • iandavidwild on LinkedIn
    • @YourMathsTutor on Twitter
    • YourMathsTutor
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #11 on: June 19, 2018, 10:25:44 AM »
Thanks GigaWatt for checking out my forum :) The way I have it set up is to have the fMath editor generate the LaTeX and use the MathJax filter to typeset it. That's partly because here in the UK that's how students will be expected to generate math notation. I've just tested it again and it seems to work okay, although the site is a bit of a work in progress so it wouldn't surprise me if there was an issue.

Study Force: do you know which math editor they had incorporated in the Xenforo forum you were using?
 


Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #12 on: June 19, 2018, 05:27:00 PM »
Not related to this thread, but I'd advise you to use this guide on how to set up some of the registration questions. Not everybody knows that Marry had a little lamb :D.

The way I have it set up is to have the fMath editor generate the LaTeX and use the MathJax filter to typeset it.

You should have mentioned that a popup appears :D. I have an outdated popup blocker that's not really detecting popups as it's supposed to, so had to switch to IE, which also didn't work and finally switch to Chrome, which opened the popup ;).

In any case, the editor itself is pretty impressive ;).







Although, it would be even nicer if a new editor popped up under the regular text editor, in the same window (I guess I'm asking for too much :D). Now that would be really cool ;).

And it's not working for derivatives (differentials), since I tried to input the code for the equation in the pics above and it just kept returning this error.

Code: [Select]
Undefined control sequence \DifferentialDx
This is the LaTeX code.

Code: [Select]
[latex]y = \int_{- 1}^1 e^x \DifferentialDx[/latex]
But, seems to work with this code.

Code: [Select]
[latex]y = \int_{- 1}^1 e^x\;\mathrm{d}x[/latex]


Seems that the generated LaTeX code is not correct ???.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,345
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
    • Study Force
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #13 on: June 19, 2018, 11:20:07 PM »
Mary had a little lamb isn't a good question...

I've downloaded the math editor, it's good but not great. For example, it isn't intuitive, like when you write '^', it doesn't understand that it's a superscript.

Regardless, it's a lot better than what I'm using at the moment.

Thank you

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #14 on: June 19, 2018, 11:30:45 PM »
Mary had a little lamb isn't a good question...

It's not that it's not a good question... well, now that I think about it, you're probably right, it's not a really good question :D.

I was thinking more in the terms of... well, most of native English speakers will probably be able to answer that question, but not non-native English speakers. Not everybody went to sleep with "Marry had a little lamb" while they were kids.

All of the questions are sort of like that. Native English speakers will know the answers, but most non-native English speakers probably won't... or would have to Google the answer.

I've downloaded the math editor, it's good but not great. For example, it isn't intuitive, like when you write '^', it doesn't understand that it's a superscript.

Yeah, I also noticed this. It looks like it doesn't respond well to direct input in the LaTeX translation. The trick is to reload the page... at least that's what worked for me.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,345
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
    • Study Force
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #15 on: June 19, 2018, 11:39:21 PM »
I had to look up the answer! :P

In terms of the mod, I feel like it's dated and not fluid. That's my main issue with it, though it is highly functional. Given our options, it's the best one out there. Mine's a lot more basic but way more fluid.

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #16 on: June 20, 2018, 12:37:40 AM »
In terms of the mod, I feel like it's dated and not fluid.

Agreed.

That's my main issue with it, though it is highly functional.

=||=

Given our options, it's the best one out there.

Yes, it's the best I've seen too... though I've seen only two other, which were better, not as functional, but as you said, more fluid. They were on proprietary scripts though.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,345
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
    • Study Force
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #17 on: June 20, 2018, 12:41:44 AM »
Do you still recall the websites that used them?

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #18 on: June 20, 2018, 01:00:35 AM »
One was on on the department for electronics at the university I attended. It was supposed to be sort of a forum for professor/student relations, questions, etc. You couldn't get in the site without a username and a password thought. If you're a student, the username was your student index ID, the pass was a random string sent to your university email address and you couldn't change it. I think they had some sort of an arrangement with the computer department and they managed it, since I asked once or twice about changing my password and all of the professors and staff kind of looked at me like I was asking for a passing grade for a course I still haven't attended :D... which kind of led me to believe that they didn't know a damn thing about the site :D.

The other one was an IEEE site or a subdomain... can't really remember... I was doing some research on 3G networks, once again, in my student days :), and I ran into this site that I THINK was either a redirect from an IEEE site or a subdomain... can't really recall. In any case, there were some equations on probability theory and statistics and you could edit them, but the changes had to be approved by an admin, so... I just kind of messed around with the editor :D. Really powerful... not as this one, but really responsive and, like you said, fluid.

The one we had on the university site was a bit more powerful than yours. It had more options, like differentials and integrals, but nothing as complex as the one in this thread... I mean, come on, three dimensional curve integrals :D... I've only seen that in magnetism and math theory books, nowhere else :D.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,345
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
    • Study Force
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #19 on: June 20, 2018, 01:12:52 AM »
I got the impression you found them on an SMF forum, that's why I requested the link. I've used Desire 2 Learn before, which is a platform used by most colleges, and their editor is great. I dug into the code and found that they lease a software. Like you said, a paid proprietary solution. I'll install this one on a test website, and I'll try to cut out as much as I can, like the double and triple integrals lol I'm certain it's possible

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #20 on: June 20, 2018, 01:20:49 AM »
Maybe one of the two sites I mentioned used this proprietary solution ???... who knows :). Well, for what it's worth, I hope it was the IEEE redirect :D... that editor was so cool, before it's time... this was back in 2007, 2008... I think... and it was fluid and responsive and the cursor was not just jumping from item to item, it had arrow keys integration and it did exactly what you wanted it to. Very similar to a regular text editor :).

EDIT: I don't think you can cut out anything :S... I think they're vectorized... part of a font :S... that's why the mod is so big :S. You could probably cut down on font solutions (different types of appearance of the same equation), I think that would be doable ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Ian Wild

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
    • yourmathstutoredinburgh on Facebook
    • iandavidwild on GitHub
    • iandavidwild on LinkedIn
    • @YourMathsTutor on Twitter
    • YourMathsTutor
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #21 on: June 21, 2018, 10:25:39 AM »
Thanks again for checking this out. I'll have a look at the issue with the \DifferentialDx tag not rendering properly. I'm suspecting that this is to do with the MathJax plugin (which would render the LaTeX) rather than the LaTeX that's being generated. But, again, I'll check this out.

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #22 on: June 21, 2018, 12:58:46 PM »
I found the mathrm{d}x notation while searching online for "derivative LaTeX code" trying to fix the "Undefined control sequence" error. That is supposed to be the default LaTeX notation tor form a differential at the end of the equation. Has the default notation for a derivative/differential changed in LaTeX? Since that (\DifferentialDx) is the LaTeX code that the equation editor generated.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Ian Wild

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
    • yourmathstutoredinburgh on Facebook
    • iandavidwild on GitHub
    • iandavidwild on LinkedIn
    • @YourMathsTutor on Twitter
    • YourMathsTutor
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #23 on: June 23, 2018, 05:20:50 PM »
Hi GigaWatt,

As mentioned previously, I'm using the MathJax plugin to render LaTeX but, just looking quickly through the list of supported commands [nofollow], I can't see \DifferentialDx. How you typeset the dx is a bit of a minefield anyway (for example see this tex.stackexchange.com thread [nofollow])

I still haven't heard from the author of the fMath plugin so I think I'm going to put together another mod based on MathQuill (I should be able to refactor the most of the code).

EDIT: I've changed the verification questions on the YourMathsTutor forum. Thanks for that advice!
« Last Edit: June 23, 2018, 05:32:42 PM by Ian Wild »

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #24 on: June 23, 2018, 05:39:53 PM »
Yeah, I can't find the command on the MathJax list either, but that's what the editor wrote when I automatically (through the buttons of the editor) chose an integral with an exponent.

And this is what your second link (regarding typesetting) suggests.

Code: [Select]
operatorname{d}
Which is exactly what I did manually.

Code: [Select]
mathrm{d}x
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Ian Wild

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
    • yourmathstutoredinburgh on Facebook
    • iandavidwild on GitHub
    • iandavidwild on LinkedIn
    • @YourMathsTutor on Twitter
    • YourMathsTutor
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #25 on: July 03, 2018, 10:06:59 AM »
Hi again,

I've just had a response back from the developer of the fMath editor (Ionel Alexandru) to say that he's happy with the way I'm using it (along with the well-deserved attribution to his work, of course) so I'll have a go at submitting the mod back to the community at the mod site now...

Thanks all :D

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #26 on: July 03, 2018, 10:10:43 AM »
Did you check the problem with the differential at the end of an integral?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Ian Wild

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
    • yourmathstutoredinburgh on Facebook
    • iandavidwild on GitHub
    • iandavidwild on LinkedIn
    • @YourMathsTutor on Twitter
    • YourMathsTutor
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #27 on: July 03, 2018, 10:28:24 AM »
Hi GigaWatt,

Oh yes you're right: I'd forgotten about that. Also, I need to make sure there are no redundant files in there and that the JS is minimised.

I'll let you know when I get those issues sorted.

Thanks again,

Ian.


Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #28 on: July 03, 2018, 10:31:28 AM »
OK ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Ian Wild

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
    • yourmathstutoredinburgh on Facebook
    • iandavidwild on GitHub
    • iandavidwild on LinkedIn
    • @YourMathsTutor on Twitter
    • YourMathsTutor
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #29 on: July 03, 2018, 01:01:04 PM »
So I've been taking a deeper look into the issue with '\DifferentialD' and I think the issue is that the MathML specification says we should be using the ⅆ entity but the rest of the world (it seems  ::) ) says that really we should be using 'upright d'. I'm using the MathJax mod to render the math notation and the issue with 'DifferentialD' has been discussed there too (see https://github.com/mathjax/MathJax/issues/1237 [nofollow])

For example, in LaTeX an anti-derivative would, usually, be something like:

Code: [Select]
\int x^4 \mathrm{dx}
... although there doesn't seem to be an agreement on this.

Internally the fMath editor is using MathML so the move away from the DifferentialD entity to '\mathrm' markup was looking tricky :o so I replaced it with the letter 'd' ;D

I'll send an email to Ionel (the fMath editor's author) later to see what he thinks about all of this. I guess the other alternative is to filter the LaTeX returned by the editor but that just seemed a little bit clunky.

Anyway, I've updated the plugin on the Your Maths Tutor website. There are a couple more configuration improvements I'd like to make and then I'll try submitting it to the mod site.

Thanks again guys for your help :)

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,441
  • Gender: Male
    • Macedonian electronics forum
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #30 on: July 03, 2018, 06:20:54 PM »
No problem, happy to help ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Ian Wild

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
    • yourmathstutoredinburgh on Facebook
    • iandavidwild on GitHub
    • iandavidwild on LinkedIn
    • @YourMathsTutor on Twitter
    • YourMathsTutor
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #31 on: July 04, 2018, 04:27:35 AM »
Hi all,

I now have a new version of the fMath plugin, available from https://luminaconsultancy.com/?attachment_id=184 [nofollow], that not only uses 'Latin d' instead of the &DifferentialD entity for derivatives but also includes the following changes:

1) New configuration options to allow an administrator to specify 'open', 'inline open' and 'close' tags - what these are will depend on the LaTeX filter you have installed.
2) A checkbox on the editor to allow you to specify if you want inline notation.





I've also minified the main fMath script which will obviously speed things up for end users but didn't make a lot of difference to the overall size of this mod  :o

I'll have a go later at submitting it to the mod site :)

Cheers,

Ian.

Offline Ian Wild

  • Semi-Newbie
  • *
  • Posts: 20
  • Gender: Male
    • yourmathstutoredinburgh on Facebook
    • iandavidwild on GitHub
    • iandavidwild on LinkedIn
    • @YourMathsTutor on Twitter
    • YourMathsTutor
Re: Incorporating maths expressions (LaTeX notation) to SMF 2.x
« Reply #32 on: July 04, 2018, 05:03:11 PM »
After a discussion here about how stupidly big this mod was originally (due to fMath editor's 50Mb footprint) I've split the package into a wrapper mod (which is a standard SMF package) and a separate editor repository, available on GitHub, which will need to be installed separately.

I've submitted it to the mod folks so hopefully everything will be okay with it!

Thanks again guys for your help :)