WordPress Math Publisher Plugin Support


Ron Fredericks writes: This is just a short post to point my readers to a new mathematics publishing plugin available from ECI’s Blog Center called WP Math Publisher. This plugin offers a simple alternative to the more standard (albeit more complex) approaches: XML’s MathML and Math into LaTeX.

Post your comments, support questions, and feedback to this post if you like. Post your own support suggestions to help others when you can.

WordPress Math Publisher plugin home page
www.embeddedcomponents.com/blogs/wordpress/wpmathpub/

Usage

An example of how it can be used in your blog posts:

code=mathtext
  1. [pmath size=16](a+b)^2=a^2+2ab+b^2[/pmath]
  2. where:
  3. [ pmath size=12]~a[/pmath] is defined as a
  4. [ pmath size=12]~b[/pmath] is defined as b

Results in:

(a+b)^2=a^2+2ab+b^2

where:
~a is defined as a
~b is defined as b

References:
Pascal Brachet’s phpmathpublisher
Home: www.xm1math.net/phpmathpublisher/
Usage: www.xm1math.net/phpmathpublisher/doc/help.html
Matteo Bertini’s WordPress plugin called PHP Math Publisher
www.slug.it/naufraghi/programmazione-web/wpmathpublisher
Randy Morrow’s WordPress plugin called Axiom
wordpress.org/extend/plugins/axiom/#post-2794

Technorati Tags: , , , , , , , , , , ,

to “WordPress Math Publisher Plugin Support”

  1. LectureMaker Says:

    How to Display Math Symbols in WordPress…

    Ron Fredericks writes: Haveテつyou ever wanted to include math equations in your blog posts or lecture materials?テつ Here isテつan easy and slick way to get the job done.テつテつUse Embedded Components new WordPress plugin called WordPress Math Publisher, or wp…

  2. Ron Fredericks Says:

    The difference between MathML, LaTeX, and PHP Math Publisher…

    Each of these methods may be used to display mathematical equations on a web page. Both MathML and LaTeX follow standards that have communities of users around them. Unfortunately they both require some significant overhead to use and/or view.

    My new plugin called WordPress Math Pub, is based on the PHP Math Publisher library by Pascal Brachet. MathML and LaTeX are not used. This library is an open-source library that converts plain text into image links to mathematical PNG images. The PHP Math Publisher library is a relatively new method for publishing mathematic equations and symbols. It has its own simple text-based syntax that is easy to learn and embed into any web page. New math images are created automatically on the fly from within your WordPress main loop as needed during content display.

  3. rjmatm Says:

    Sorry for not getting back to you. I’ve been out of the loop for a while. The thing with word press is the it’s tough for me to figure out how to post the plug-in on their site. I want to give my plug-in away for free (Free Software style). So please don’t think I’m hiding, I’ve just been having trouble with subversion.

    Randy

  4. Roderik Says:

    I tried the plugin but it interferes somewhat with the editor (both tinymce as well as fckeditor). The

  5. Ron Fredericks Says:

    Hi Roderik:

    Can you provide some detail on how wpmathpub plugin interferes with your use of the editors?

    So far the only issue has been in the use of greater than “>” and less than “<” symbols – as these are converted by html aware editors to “&amp gt;” and “&amp lt;”. This conversion of html symbols can be circumvented by switching from “edit” mode to “code” mode. Bes regards, Ron

  6. Roderik Says:

    Switching to code mode does not circumvent it for me. When you edit in code, click save and check what is there, < and > were inserted. The only way might be to turn of the visual editor as a whole in the user settings. However that is quite annoying since I want to write the articles itself in the visual editor.
    I think it might work if you write a filter for wordpress that converts the html encoded characters if they are inside a math block.

  7. Roderik Says:

    & lt; and & gt; instead of in last message

  8. Ron Fredericks Says:

    Hi Roderik:

    Thank you for your polite and accurate feedback.

    I agree with you that it should be fairly simple to implement the html entities replacement – as you suggest above. I will use our conversation here to drive the next release. It will take me a week or so to get back to this project with a formal update release on the wordpress.org site.

    Ron

  9. Oliv Says:

    Hi,

    Following the previous comments, when using > or < it breaks the post display.

    But I am posting comment here to suggest to had math support for comments.
    For example by adding that:

    add_filter('comment_text', 'to_phpmath', 5);

    at the end of wpmathpub.

    @+Oliv

  10. Ron Fredericks Says:

    Hi Oliv:

    Adding math support to comments is a great idea. I am adding this to the list of TODO’s for a new release comming soon.

    Best regrards,

    Ron

  11. Ron Fredericks Says:

    I just checked wpmathpub plugin against WordPress 2.5.1. It works just fine. This change to the readme file will be added to the next release comming soon – too.

    Best regards,

    Ron

  12. Oliv Says:

    Re-,

    Correction from my previous comment:

    The following sequence between pmath tags breaks either comment either post:

    } >

    as for:

    sum{i=1}{n}{C(q_i)}>C(sum{i=1}{n}{q_i})

    Best regards,

    Oliv,

  13. Writing Mathematical Formula With WordPress Math Publisher Plugin Says:

    […] WordPress Math Publisher plugin is really exciting for me, especially I am now able to write formula in WordPress. It works almost […]

  14. jnetter Says:

    Hi Ron,

    Very cool plugin, but I’m having a problem. Wpmathpub installed and ran fine on my localhost server, but when installed on my website, posts don’t load past the post heading (title, date, etc.). Page loading just hangs at this point. No error message, just fails to complete loading.
    Tried the normal stuff: deactivate/activate, disable other plugins, switch to default theme, delete and reinstall the plugin files, no luck. Images are not being written to img directory (which is 755).
    wpmathpub 1.06, wp 2.51
    Any suggestions?

  15. Ron Fredericks Says:

    Hi Craig:

    As you can see from the display, your [pmath …] tag works fine on my blog. As you point out, I am using WordPress 2.5.1. I have tested several prior versions but have not yet had a chance to verify compatibility with 2.6 yet. It could take another two weeks before I make this test.

    In the meantime I do have a diagnostic version of the plug-in that helps identify potential sources of error based on installation and damaging effects from other plug-ins. I could email this version to you if you like?

    Best regards,

    Ron

  16. Tyler Says:

    Hi there.. i really like this plugin, but i have what i hope is a simple question.

    my blog’s background is black, and the theme i am using is trying to put the output in a light grey and is messing things up. is there a way to have the output in white? or any color for that matter….

    -tyler

  17. Ron Fredericks Says:

    Hi Tyler:

    What you ask for seems obvious in hindsight, thanks for the suggestion. Control of forground color, background color, and both of these color transparencies, is very “do-able” since all controls are handled by the PHP GD library. The necessary step is to add these color controls as seen on http://www.php.net into the wpmathpub.php plugin code:

    imagecolorallocate
    imagecolortransparent
    imagecolorallocatealpha

    I will put this feature request on the list for next release.

    Best regards,

    Ron

  18. AB Says:

    Besides being able to control the background (I believe transparent background is the most useful), we also need the plugin to add a special CSS image style so that we can control the appearance of the math separate from the style of the rest of the images.

    In my blog I have my images surrounded by a frame so the math shows up with the frame as well.

    Ideas?

  19. AB Says:

    What I am proposing is that the math images are (maybe optionally) tagged as some class=”mathpub_img” or something so that we can control their CSS style separately from the “img” class.

    Maybe you have a better idea. What I want is for my equations to show as transparent BG (or at least BG color) while my regular images show with a frame around them.

  20. Ron Fredericks Says:

    Oops:

    One new user posted a message explaining how wpmathpub failed to configure itself properly. The user was very clear in showing the path details and what he did to solve this error. This type of error caught my attention after 1000 new uers have downloaded my plugin with nearly all having an error free experience.

    Sorry but I deleted you by mistake. Please post again if you get a chance. In the mean time, I will try a few combinations on my own. If I find any issue in my config system, I will roll a fix into the next release.

    Best regards,

    Ron

  21. Ron Fredericks Says:

    Hi AB:

    Thanks for clarifying the CSS style feature you are proposing. I will be experimenting with this over the next few weeks.

    Best regards,

    Ron

  22. Ahmet Temiz Says:

    Hi,
    Very good plugin.
    I can’t find how to change the color of the formula text. Is it possible?
    Best regards.

  23. Brenton Says:

    Hi There.

    I found a slight bug in my install. I was finding that it would work when I went to a page directly but not from my root directory.

    The way my website runs is that the wordpress install is not in the public_html directory. Instead it runs from a ./blog directory under it with my index.php pulling up the wordpress header using

    What I needed to do to make it work was change the code where you set up the depth and dirimg etc

    $depth=(end(explode(“/”,getcwd())) == “wp-admin”) ? “..”: “.”;

    To

    $depth=(end(explode(“/”,getcwd())) == “blog”) ? “.”: “./blog”;

    What I couldn’t work out was the scenario when you would be calling the script from wp-admin. Would you ever be in that directory?

    Anyway the script change works for me. A general fix would need to identify the name of the install dir under public_html and use that.

    Thanks for the script by the way. Makes life a lot easier

  24. Ron Fredericks Says:

    Hi Brenton:

    Interesting work, thanks for sharing your situation. When making changes, I suggest testing these use cases:
    1) math symbol creation in body of post (most common case)
    2) math symbol creation in comment to a post
    3) math symbol display from RSS feeds (posts and comments)
    4) math symbol display from admin dashboard view of comments

  25. Brenton Says:

    Thanks I didn’t think of the comments.

    The solution which works for me using all the use cases you mentioned is as follows. It is a hack I am afraid. My php is many years rusty. Couldn’t even remember how to concatenate doh! :-(

    It will need a longer term fix to automatically identify the directory that wordpress is installed in.

    I am using public_html/blog, but there is no guarantee that anyone else is using this.

    //*************************************************
    //BT Hack to handle wordpress in a sub directory under public_html
    //
    //To use replace this line in the original code with this whole hack block
    //
    // ——- Original Code —–
    //$depth=(end(explode(“/”,getcwd())) == “wp-admin”) ? “..”: “.”;
    // ——- End Original Code ——-
    //
    // To refer to your install directory replace “WP_INSTALL_DIRECTORY”
    // below with the relative path to your install under public_html. So if you
    // are public_html/blog replace it with “blog”

    $BTinstalldir=”WP_INSTALL_DIRECTORY;
    $BTcwd=getcwd();
    $BTend=end(explode(“/”,$BTcwd));

    if ($BTend==”wp-admin”)
    {
    $depth=”..”;
    }
    else
    {
    $depth=(($BTend == $BTinstalldir) ? “.” : “./$BTinstalldir”);
    }
    //End BT Hack
    //*************************************************

  26. Brenton Says:

    Actually I lie, I haven’t tried the rss feed

  27. Brenton Says:

    to complete this the RSS feed does not bug out. simply nothing appears.

    While I was at it I tried math in a post title. It simply came out as text.

    Anyway thanks again for the plugin, it does all I want

  28. corvi42 Says:

    your plugin is great! however it doesn’t seem to play nicely with the cross-linker plugin. Both define a function mt_add_pages() – so I can’t load both plugins together.

  29. sriniK Says:

    hi, i have downloaded and installed this great plugin on wordpress 2.7. actually i am testing the site on stand alone server-xampp lite. i am running windows vista ultimate. my problem is i cant access the img directory. i mean i cant get the permission to read and write to that img directory. how can i change the folder attributes so that i can get it accessed from my blog. please help me. thanks

  30. Ned Says:

    I am very excited about this plug-in and I am going to use it on the my blog. There are some things that have been overlooked however, which might be to do with the available fonts. Is their support for vectors or bold characters?
    Also missing characters often used by physicists, such as the dell or nabla operator and hbar.

  31. Ron Fredericks Says:

    Hi sriniK:

    You may be the first known user of my plugin on a windows server. I will look for the time to set up and test a wordpress.org blog plus my plugin on a windows Vista + apache + php environment. Can you confirm that this is what you are trying to do?

    Ron

  32. Bob Says:

    Hmmm … that’s interesting. The code was rendered correctly in my comment above. Different version of wordpress?? My web host provides v. 2.5.1. Any other ideas?

  33. Jason Says:

    Is there a quick workaround for changing the colors?

  34. Bob Says:

    Hi Ron

    Thanks for the reply. Although your plugin helps a great deal, it looks like math in html is no cakewalk. I will keep in mind your suggestion to use tables to “nudge” the formatting.

    For simple stuff like my letter mu &mu or the right arrow in your example, it seems simpler to use the Html 4.0 symbols, &mu and &rarr , although they are not by supported older browsers.

    Bob

  35. Jeremy Says:

    Hi Ron,

    i cant seem to get the plugin to work. I was really excited when I found this plugin because now i can add formulas online!

    However, i cannot get the same result as what you got in screenshot 5.

    i.e. “img directory readable” -> “mathfilter” does not appear for me.

    Please help! I am currently using WP version 2.7…

    Also, when I attempt to key in the formulas and publish the blog, no content appears. Only the blog title.

    I hope to hear from you regarding this issue soon!
    Thanks in advance Ron!

  36. Jeremy Says:

    Hi there Ron,

    Thanks alOt for your reply!

    Im tried changing the autochmod to false but still no change. However, because I am not very experienced with this, Im not too sure how to do the SSH BASH thing.

    What else can be done? Please advise! Thank you!

    Jeremy

  37. Devin Says:

    Hi,
    Your plugin works great, except that when I add text in between two pmath tags, the text doesn’t seem to show up. For example:

    S_n=a(1-r^n)/(1-r) , r1

    Consider the geometric sequence 2, 4, 8, 16, …

    S_4=2(1-2^4)/(1-2)

    On my site, the text “Consider the geometric sequence…” is not there.

    It simply has the two lines of math equations, but does not display the text.

    What am I doing wrong? Thanks.

  38. Ron Fredericks Says:

    Hi Devin:

    As you can see from your own comment just above this one – text entered between two math graphics generated with [pmath … /pmath] tags displays just fine.

    What might have happened during your blogging experience is that you did not choose an HTML tag to enclose your text. Sure wordpress makes it a little easier and a lot more automatic to enter text into a blog post. But when you experience a problem, such as missing text as Devin has encountered, here is a simple solution to enforce correct display of your text….

    Put your text into an HTML paragraph tag like this:
    <p >Consider the geometric sequence 2,4,8, 16, 16…</p>

    Choose one of these two approaches to get these paragraph tags into your blog post yourself:
    1) Use your editor’s raw HTML mode to enter the “less than” and “greater than” symbols manually or
    2) use the editor’s “paragraph” menu option from your editor’s VISUAL mode.

    If you view the HTML source code for this page using your browser’s view->source feature you would see that that is exactly what WordPress automatically choose to correctly format his text string in the comment above.

    The problem /solution I describe here has more to do with HTML text entry for a web page (like a blog post) than with my wpmathpub graphics publication. I hope this helped Devin,

    Ron Fredericks
    Technical Community Developer

  39. robert Says:

    Hi Ron,

    Can you help with installation of phpmathpublisher on phpBB forum?

    I’ve tried a few solutions, but i really cannot get it to work. I only come here because i’m really lost.

    Thanks

  40. Farid Says:

    Hi Ron,

    thanks for the great plugin. I’ve tried 1.0.7 on WP 2.9.1 and I had two issues:

    1. I had to chmod 777 the img directory, because the web server apparently ran under a different userID than my account.

    2. There’s no diagnostic/settings/manage entry in the Plugins->Manage menu. Only the points to activate and deactivate the plugin.

    But everything else seems to work just fine. Thanks a lot.

  41. lucane Says:

    Greetings Ron,

    Thanks for the great plugin! I am trying to use it to create mathematical quizzes using the Quizzin Plugin, but currently the [pmath] tag does not work. I assume it is because the publisher filter is not being applied to the Quizzin plugin. Do you have any idea how I can make it such that this filter is used in Quizzin too?

    Thank you for all your great work!

    Luke

  42. Ron Fredericks Says:

    Hi Luke:

    I am too busy to look into the subject of how to integrate these two plugins at this time. Yet quizes are an important aspect in teaching so it is a good idea to integrate math publishing technology. I will let you know if I get around to it. If you have a budget to undertake this type of project, let me know as well.

    Ron

  43. Grテゥgory LEOCADIE Says:

    Hi Ron,
    I’m writing a patch to be able to adjust generated pictures background. Could you tell me how I can contribute (if you are ok) please? (sending a patch, commit it to the svn tree…)

    Gregory

  44. Julio Strack Says:

    I saw this article from Facebook (a friend of mine posted it). After reading, I clicked Like then reshared it myseld.

  45. albert Says:

    this is more of a request than a question, are you planning to do a choose notation C(a,b) where a appears above b in a bracket.
    thank you.

  46. wol Says:

    Hi there,
    what is the likelihood, or road map for the addition of new symbols? for example the del or inverted delta symbol, fraktur, script and further double struck letters geometry symbols or negated logic symbols?

    @albert: use the tabluar method with no borders and enclose in brackets. eg your example is: C(tabular{000}{00}{a b})

  47. Ron Fredericks Says:

    Hi Wol:

    Thanks for the roadmap suggestion. I will take it under consideration. Others have asked for Div, Grad, and Curl, for physics oriented math in the past. So I understand your pain.

    Any chance you can arrange for some funding for this update?

  48. Laura Laing Says:

    Hi Ron,

    So glad I found wpmath pub! It’s a great tool.

    I’d love to be able to customize the font and color. Is there any way to do this? I’ve been playing around with adding it via html coding, but so far, it’s not working. Any ideas?

    Laura

  49. hacker news Says:

    hacker news…

    […]Embedded Components and Tools Blog Center » Blog Archive » WordPress Math Publisher Plugin Support[…]…

  50. # Says:

    I wanted this very much.how can i obtain them!

  51. Ron Fredericks Says:

    I liked Albert’s answer to Wol’s question above:

    @albert: use the tabluar method with no borders and enclose in brackets. eg your example is: C(tabular{000}{00}{a b})

    using wpmathpub syntax, it would be formatted like this (without the spaces in the pmath tags):
    [ pmath ]C(tabular{000}{00}{a b})[ /pmath ]

    Here is the final result:
    C(tabular{000}{00}{a b})

    Nice one Albert!

  52. Filipe Says:

    Hi,

    Your plugin is great.

    I only have a problem I cant find the logic or \/ and the logic not (like this http://www.math.csusb.edu/notes/logic/lognot/img3.gif) in the symbol list.

    Thanks and great work :)

  53. Ryan Says:

    is the plugin updated for WordPress 3? I just installed and tried to use it, but for some reason the equation isn’t rendering. What gets displayed on my blog is the full input string, including the … tags. Any ideas? Appreciate the help.

    I have tried typing the full equation into the visual mode, and the HTML mode, of wordpress. Neither works.

    Here is the equation I am trying to display:

    Active Share = 1/2 sum{i=1}{N}{ delim{|}{ wfund, i – windex,i}{|} }

  54. Ron Fredericks Says:

    Yes, plugin works fine for WordPress 3. I am using it on this blog which is using current release of WordPress. just use the correct pmath tags as described in the help.

Leave a Reply

What is 6 + 11 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)