## News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

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

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

#### Ian Wild

Hi all,

It's been a while since I was last on here (over 10 years ) 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 - 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

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 .

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

#### Biology Forums

Would love to see this in action, any demos?

#### 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 .

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

$y = \int_{- 1}^1 e^x \DifferentialDx$

But, seems to work with this code.

$y = \int_{- 1}^1 e^x\;\mathrm{d}x$

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 .

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!

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

#### Biology Forums

Do you still recall the websites that used them?