News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Incorporating maths expressions (LaTeX notation) to SMF 2.x

Started by Ian Wild, June 16, 2018, 01:58:42 PM

Previous topic - Next topic

Ian Wild

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.

GigaWatt

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?"..."

d3vcho

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 :)
"Greeting Death as an old friend, they departed this life as equals"

Ian Wild

Hi GigaWatt and thanks for your message.

Quote from: GigaWatt on June 16, 2018, 02:24:44 PM
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.
Quote from: GigaWatt on June 16, 2018, 02:24:44 PM
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.

GigaWatt

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?"..."


Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Biology Forums

@ 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

Ian Wild

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 :)

GigaWatt

Quote from: Study Force on June 18, 2018, 01:22:10 PM
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.

Quote from: Ian Wild on June 18, 2018, 01:56:10 PM
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?"..."

Biology Forums

I was using a Xenforo forum and they had this incredible math editor. I would surely pay for an add-on like that

Ian Wild

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?



GigaWatt

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.

Quote from: Ian Wild on June 19, 2018, 10:25:44 AM
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.

Undefined control sequence \DifferentialDx

This is the LaTeX code.

[latex]y = \int_{- 1}^1 e^x \DifferentialDx[/latex]

But, seems to work with this code.

[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?"..."

Biology Forums

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

GigaWatt

Quote from: Study Force on June 19, 2018, 11:20:07 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.

Quote from: Study Force on June 19, 2018, 11:20:07 PM
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?"..."

Biology Forums

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.

GigaWatt

Quote from: Study Force on June 19, 2018, 11:39:21 PM
In terms of the mod, I feel like it's dated and not fluid.

Agreed.

Quote from: Study Force on June 19, 2018, 11:39:21 PM
That's my main issue with it, though it is highly functional.

=||=

Quote from: Study Force on June 19, 2018, 11:39:21 PM
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?"..."


GigaWatt

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?"..."

Biology Forums

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

Advertisement: