Advertisement:

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

Online GigaWatt

  • The Smiley Guy
  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,162
  • 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.

Online GigaWatt

  • The Smiley Guy
  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,162
  • 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 »

Online GigaWatt

  • The Smiley Guy
  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,162
  • 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

Online GigaWatt

  • The Smiley Guy
  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,162
  • 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.


Online GigaWatt

  • The Smiley Guy
  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,162
  • 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 :)

Online GigaWatt

  • The Smiley Guy
  • Support Specialist
  • Sophist Member
  • *
  • Posts: 1,162
  • 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 :)