WordPress Math Publisher Plugin Home Page

Description

The “WordPress Math Publisher” plugin for WordPress, or wpmathpub for short, displays mathematical equations within your posts, comments, and pages. It’s a simple plugin that takes advantage of Pascal Brachet’s PHP Math Publisher version 0.3 library – bundled with this plugin.

The Video

Introduction to Math Blogging with WordPress.org

How it works

Put your plain text mathmatical expressions between custom tags that look like this:

[pmath size=xx]…[/pmath]

The optional size attribute controls how large the images will be displayed. Useful xx integer values range from 8 to 24. Size defaults to 12 when the size attribute is omitted.

I created the first version of the plugin by starting with Matteo Bertini’s wpmathpublisher version 1.0.3 WordPress plugin source code. This is why my first version (v. 1.0.4) was just a plus 1 increment to Matteo’s version; while, my current version is still backward compatible with his tagging scheme too.

Here’s an example:

code=mathtext
  1.  
  2. [pmath](a+b)^2=a^2+2ab+b^2[/pmath]

Results in:

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

In the example above, pmath is the tag to indicate to my plugin that the text that follows up to the /pmath tag, should be automatically submitted to Pascal’s PHP Math Publisher library for creation of a transparent graphic image. Finally, the tags and its encompassed text are replaced by the graphic image for display in this blog post.

I built upon Matteo’s pmath tag by adding an optional size attribute. Pascal’s PHP Math Publisher Library supports a size parameter as shown on his demo page: here>

Here is a simple continuation of Matteo’s example – with size attribute included:

code=mathtext
  1. [pmath size=16](a+b)^2=a^2+2ab+b^2[/pmath]
  2.  
  3. where:
  4. [pmath size=12]~a[/pmath] is defined as a
  5. [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

But perhaps this is a more stunning example:

code=mathtext
  1. [pmath size=8]f(x)~left~ sum{kappa=1}{infty}{delim{[}{{1/(x_kappa)^kappa}}{]}}[/pmath] ; size=8
  2.  
  3. [pmath size=12]f(x)~left~ sum{kappa=1}{infty}{delim{[}{{1/(x_kappa)^kappa}}{]}}[/pmath] ; size=12 (same as default)
  4.  
  5. [pmath size=16]f(x)~left~ sum{kappa=1}{infty}{delim{[}{{1/(x_kappa)^kappa}}{]}}[/pmath] ; size=16
  6.  
  7. [pmath size=24]f(x)~left~ sum{kappa=1}{infty}{delim{[}{{1/(x_kappa)^kappa}}{]}}[/pmath] ; size=24

Results in:

f(x)~left~ sum{kappa=1}{infty}{delim{[}{{1/(x_kappa)^kappa}}{]}} ; size=8

f(x)~left~ sum{kappa=1}{infty}{delim{[}{{1/(x_kappa)^kappa}}{]}} ; size=12 (same as default)

f(x)~left~ sum{kappa=1}{infty}{delim{[}{{1/(x_kappa)^kappa}}{]}} ; size=16

f(x)~left~ sum{kappa=1}{infty}{delim{[}{{1/(x_kappa)^kappa}}{]}} ; size=24

Source code for version 1.0.7

code=php
  1. < ?php
  2. /***************************************************************************************
  3. Plugin Name: WP Math Publisher
  4. Plugin URI: http://www.embeddedcomponents.com/blogs/wordpress/wpmathpub/
  5. Description: Display mathematical equations within your posts and comments. Put your plain text <a href="http://www.xm1math.net/phpmathpublisher/doc/help.html">mathmatical expressions between [pmath size=xx]…[/pmath] tags. The optional size attribute controls how large the images will be displayed. Useful xx integer values range from 8 to 24. Size defaults to 12 when attribute omitted. Pascal Brachet’s PHP Math Publisher <a href="http://www.xm1math.net/phpmathpublisher/">library</a> is included.
  6. Version: 1.0.7
  7. Date: Sept. 6, 2008
  8. Author: Ron Fredericks, Embedded Components
  9. Author URI: http://www.embeddedcomponents.com/blogs/
  10.  
  11. Easy install notes:
  12.         Just copy the wpmathpub directory and all its contents into your WordPress plugins directory.
  13.  
  14. Platforms tested:
  15.         1) Linux Apache web server, php 4.4.4, WordPress 2.0.4, default theme, installed in subdirectory,
  16.         2) Linux Apache web server, php 4.4.4, WordPress 2.3.3, clasic theme, installed in root directory,
  17.         3) Linux Apache web server, php 4.4.4, WordPress 2.6.2, default theme, installed in subdirectory.
  18.        
  19. References:
  20.         Pascal Brachet’s phpmathpublisher
  21.                 Home: http://www.xm1math.net/phpmathpublisher/
  22.                 Usage: http://www.xm1math.net/phpmathpublisher/doc/help.html
  23.         Matteo Bertini’s WordPress plugin called PHP Math Publisher
  24.                 http://www.slug.it/naufraghi/programmazione-web/wpmathpublisher
  25.         Randy Morrow’s WordPress plugin called Axiom
  26.                 http://wordpress.org/extend/plugins/axiom/#post-2794
  27.        
  28. ***************************************************************************************/
  29. /***************************************************************************************
  30.  
  31.     Copyright 2008  Ron Fredericks, Embedded Components, Inc.  (email : ronf@EmbeddedComponents.com)
  32.        
  33.         GNU General Public License
  34.     This program is free software; you can redistribute it and/or modify
  35.     it under the terms of the GNU General Public License as published by
  36.     the Free Software Foundation; either version 2 of the License, or
  37.     (at your option) any later version.
  38.  
  39.     This program is distributed in the hope that it will be useful,
  40.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  41.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  42.     GNU General Public License for more details.
  43.  
  44.     You should have received a copy of the GNU General Public License
  45.     along with this program; if not, write to the Free Software
  46.     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  47. ***************************************************************************************/
  48. //                     ** Begin wpmathpub Code **
  49. define("WPMATHPUBVERSION", ’1.0.7′);
  50.  
  51. //
  52. // Control automatic test and set feature for write access to ‘img’ directory.
  53. //           Automatic test and set feature when define("AUTOCHMOD", true);
  54. //           Manual automatic test and set feature when define("AUTOCHMOD", false);
  55. define("AUTOCHMOD", true);
  56.  
  57. // Control support for [pmath] tag in blog comments
  58. //            Engage the [pmath] tag support in blog comments when define("ENGAGECOMMENTS", true);
  59. //            Disengage the [pmath] tag support in blog comments when define("ENGAGECOMMENTS", false);
  60. define("ENGAGECOMMENTS", true);
  61.  
  62. // Include Pascal’s php math publisher library.
  63. define("PHPMATHLIB", ‘phpmathpublisher’, true);
  64. require_once(PHPMATHLIB.‘/mathpublisher.php’) ;
  65.  
  66. // Determine depth of relative addressing based on location of current running script: default value is that of WordPress install directory.
  67. $depth=(end(explode("/",getcwd())) == "wp-admin") ? "..": ".";
  68.  
  69. // Overwrite mathpublisher.php’s default pointers to /img and /fonts subdirectories with a flexible relative addressing scheme.
  70. $basedir = ‘/wp-content/plugins/’.basename(dirname(__FILE__), ".php").‘/’.PHPMATHLIB;
  71. $dirfonts=$depth.$basedir.‘/fonts’;
  72. $dirimg=$depth.$basedir.‘/img’;
  73.  
  74. // Create a seperate absolute pointer to the phpmathpublisher /img/ subdirectory because our relative address scheme won’t work when called from the "apply filter" php module within the WordPress Loop.
  75. $abs_dirimg = get_bloginfo(‘url’).$basedir.‘/img/’;
  76.  
  77. // test for proper installation and a known run-time environment
  78. $abs_dirimg_readable = is_readable($dirimg);
  79.  
  80. // Attempt to make $dirimg writable if it is not writable already.
  81. $abs_use_mathfilter = true;
  82. if (AUTOCHMOD && $abs_dirimg_readable) {
  83.         if (!is_writable($dirimg)) {
  84.                 if (!chmod($dirimg, 0755)) {
  85.                         $abs_use_mathfilter = false;
  86.                 }
  87.                 clearstatcache();
  88.         }
  89. }
  90.  
  91. // Returns with <img src=http://www.yoursite.com/yourblog/wp-content/pluglins/wpmathpub/phpmathpublisher/img/some_unique_image.png/> HTML tag.
  92. // Makes reference to mathfilter function included from PHPMATHLIB/mathpublisher.php code.
  93. function wpmathfilter($ascii_math, $size_math)
  94. {
  95.         global $abs_dirimg;
  96.         global $abs_use_mathfilter;
  97.         global $abs_dirimg_readable;
  98.                
  99.         // Define the default font size.
  100.         if (empty($size_math)) $size_math = ’12′;
  101.        
  102.         if ($abs_use_mathfilter && $abs_dirimg_readable) {
  103.                 // html_entity_decode() converts HTML entities like ">" back to standard text like ">", when present.
  104.                 $phpmath = mathfilter("<m>".html_entity_decode($ascii_math)."</m>", $size_math, $abs_dirimg);
  105.         } else if ($abs_dirimg_readable) {
  106.                 $phpmath = ‘<span style="color: red">Error:</span>’." $abs_dirimg must have write access".‘ <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use ‘."’chmod 755 img’".‘ to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a>’;
  107.         } else {
  108.                 $phpmath = ‘<span style="color: red">Error:</span>’." wpmathpub plugin not usable under these conditions: $abs_dirimg";
  109.         }
  110.         return $phpmath;
  111. }
  112.  
  113. // Create a WordPress text filter
  114. function to_phpmath($content)
  115. {
  116.         // Add an new optional font size attribute size=xx to Matteo’s original preg_replace.
  117.         $content = preg_replace(‘#\[pmath(\s+size=|\s?)(\d*)(\])(.*?)\[/pmath\]#sie’, ‘wpmathfilter(\’\\4\’, \’\\2\’);’, $content);
  118.         return $content;
  119. }
  120.  
  121. // action function for above hook
  122. function mt_add_pages() {
  123.     // Add a new submenu under Manage:
  124.     add_management_page(‘wpmathpub’, ‘wpmathpub’, 8, ‘wpmathpubmanage’, ‘wpmathpub_manage_page’);
  125. }
  126.  
  127. // wpmathpub_manage_page() displays the page content for the Test Manage submenu
  128. function wpmathpub_manage_page() {
  129.         global $abs_dirimg;
  130.         global $dirimg
  131.         global $abs_use_mathfilter;
  132.         global $abs_dirimg_readable;
  133.         global $abs_addfilter_test;
  134.  
  135.         $abs_dirimg_executable = is_executable($dirimg);
  136.         if ($abs_use_mathfilter)
  137.                 $abs_use_mathfilter = is_writable($dirimg);     // make sure img directory really is writable
  138.        
  139.         $arraytemp = gd_info(); // collect details on server’s support of GD graphics library
  140.        
  141.         $tabcolor = array(‘#dddddd’, ‘#ffffcc’);
  142.         $tabcnt = 0;   
  143.         echo "<table width=’700′ border=’0′ cellspacing=’1′ cellpadding=’1′>";
  144.        
  145.         echo "<tr>";
  146.     echo "<th scope=’col’> </th><th scope=’col’><span style=’color: blue’><h3>wpmathpub plugin status: ".WPMATHPUBVERSION."</h3></span></th>";
  147.         echo "</tr>";
  148.        
  149.         echo "<tr>";
  150.         echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>Operating system:</span></th>";
  151.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".PHP_OS."</td>";
  152.         echo "</tr>"
  153.                
  154.         echo "<tr>";
  155.         echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>PHP version:</span></th>";
  156.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".phpversion()."</td>";
  157.         echo "</tr>";  
  158.        
  159.         echo "<tr>";
  160.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>PHP GD library:</span></th>";
  161.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".((strlen($arraytemp["GD Version"])>1) ? ("version ".$arraytemp["GD Version"]) : "<span style=’color: red’> ERROR: GD library not found on this server</span>") .(($arraytemp["PNG Support"]===true) ? " with PNG format supported" : "<span style=’color: red’> ERROR: PNG format not supported</span>")."</td>";
  162.         echo "</tr>";
  163.        
  164.         echo "<tr>";
  165.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>Ownership:</span></th>";
  166.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".((getmyuid()==fileowner($dirimg)) ? "" : "<span style=’color: red’>WARNING </span>")." script owner=".getmyuid().", img file owner=".fileowner($dirimg)."</td>";
  167.         echo "</tr>"
  168.        
  169.         echo "<tr>";
  170.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>Blog’s url:</span></th>";
  171.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".get_bloginfo(‘url’)."</td>";
  172.         echo "</tr>"
  173.        
  174.         echo "<tr>";
  175.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>WordPress version:</span></th>";
  176.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".get_bloginfo(‘version’)."</td>";
  177.         echo "</tr>"
  178.        
  179.         echo "<tr>";   
  180.         echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>WordPress plugin name:</span></th>";
  181.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".basename(dirname(__FILE__), ".php")."</td>";
  182.         echo "</tr>";  
  183.  
  184.         echo "<tr>";
  185.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>Relative img path:</span></th>";
  186.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".$dirimg."</td>";
  187.         echo "</tr>"
  188.        
  189.         echo "<tr>";
  190.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>Working directory:</span></th>";
  191.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".getcwd()."</td>";
  192.         echo "</tr>";  
  193.  
  194.         echo "<tr>";
  195.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>Absolute img path:</span></th>";
  196.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">$abs_dirimg</td>";
  197.         echo "</tr>";
  198.        
  199.         echo "<tr>";
  200.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>img directory readable:</span></th>";
  201.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".(($abs_dirimg_readable) ? "yes" : "<span style=’color: red’>error</span>")."</td>";
  202.         echo "</tr>";
  203.        
  204.         echo "<tr>";
  205.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>img directory writable:</span></th>";
  206.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".(($abs_use_mathfilter) ? "yes" : "<span style=’color: red’>error</span>")."</td>";
  207.         echo "</tr>";
  208.        
  209.         echo "<tr>";
  210.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>img directory executable:</span></th>";
  211.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".(($abs_dirimg_executable) ? "yes" : "<span style=’color: red’>error</span>")."</td>";
  212.         echo "</tr>";
  213.                
  214.         echo "<tr>";
  215.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>Content filter added:</span></th>";
  216.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".(($abs_addfilter_test) ? "yes" : "<span style=’color: red’>error</span>")."</td>";
  217.         echo "</tr>";
  218.                
  219.         echo "<tr>";
  220.     echo "<th scope=’row’ width=’240′ align=’right’><span style=’color: blue’>mathfilter(y=mx^2+b):</span></th>";
  221.     echo "<td bgcolor=".$tabcolor[$tabcnt++ %2].">".mathfilter("<m>".html_entity_decode("y=mx^2+b")."</m>", ’12′, $abs_dirimg)."</td>";
  222.         echo "</tr>"
  223.        
  224.         echo "</table>";
  225. }
  226.  
  227. // Register our WordPress text filter, to_phpmath, into the two hook routines, the_content and comment_text.
  228. if (!ENGAGECOMMENTS) {
  229. //           Register comment_text updates after all priorty comment processing filters.
  230. //            Note: calling the comment filter first, before the content filter, fixed comment_RSS feed errors.
  231.         remove_filter(‘comment_text’, ‘to_phpmath’);
  232. } else {
  233.         add_filter(‘comment_text’, ‘to_phpmath’);
  234. }
  235. //           Register the_content updates after all priorty content processing filters.
  236. $abs_addfilter_test = add_filter(‘the_content’, ‘to_phpmath’, 5);
  237.  
  238. // Hook for adding admin menus
  239. add_action(‘admin_menu’, ‘mt_add_pages’);
  240. //
  241. //                     ** End wpmathpub Code **
  242. ?>

Changes in version 1.0.7

  • Improve compatibility with streaming video plugins that would otherwise monopolize the WordPress built-in add_filter() function which in turn cause wpmathpub [ pmath ] tagging to fail
  • Add a new menu into for the WordPress blogger using the Site Admin -> Manage menu to display operating status of the wpmathpub plugin

Download plugin

The wpmathpub math publisher plugin for WordPress.org blogs is now available directly from WordPress.org’s plugin site. The WordPress.org hosted version manages several promotional and support features:

  • Overview of the plugin here>
  • Overview of the PHP Math Publisher library here>
  • Installation instructions here>
  • Example of how wpmathpub works, and how to install it here>
  • Frequently Asked Questions and their answers too here>
  • Metrics here>
  • Download from WordPress.org here>

Support:
Share your problems, thoughts, or success with the community here:
www.embeddedcomponents.com/blogs/2008/03/wpmathpubsupport/

Donations accepted

Do you like the engineering work we do in creating better components for your reuse? Are you satisfied with this plugin? Are you using this effort to help you or your company make profit? If the answer is yes to any of these questions, perhaps you might consider making a voluntary donation.




61 Responses to “WordPress Math Publisher Plugin Home Page”

  1. Ron Fredericks Says:

    This is a test of an open ended start tag embedded in a comment [pmath size=14] along with some text…

  2. Ron Fredericks Says:

    …and some more text e=sum{infty}{n=0}{1/{n!}}[/pmath] with an end tag to insure the new comments-enabled feature works without breaking something.

  3. Ron Fredericks Says:

    Comments seem to work fine, even when the tag is not used correctly. But it works even better when the math text and end tag from the previous comment are used together like this:

    [ pmath size=14 ]e=sum{infty}{n=0}{1/{n!}}[ /pmath ]

    or with the spaces removed from around the pmath brackets to form valid tags, like this:

    e=sum{infty}{n=0}{1/{n!}}

    to create a real equation.

  4. Diseño Web Says:

    Well done job, the size attribute are great.

    Still testing,

    Keep the work!

  5. martialarts Says:

    Hi all great information here and good thread to comment on.

    Can I ask though – how did you get this picked up and into google news?

    Very impressive that this blog is syndicated through Google and is it something that is just up to Google or you actively created?

    Obviously this is a popular blog with great data so well done on your seo success..

  6. Philix Says:

    This is a great plug in :)

  7. ipang Says:

    Maybe it is good plugin,

    but,the mathematics equation is wrong:(

  8. Ron Fredericks Says:

    Thanks for the recognition, ipang. You point out one of the key advantages to my plug-in – you can make fixes to equations very easily. I could go back and fix the original very easily by changing the math text, but then readers of my blog would not understand the value of your comment. So I will fix it here:

    The fix only requires a reversal of the initial to finial summation values. from this:

    [ pmath size=14 ]e=sum{infty}{n=0}{1/{n!}}[ /pmath ]

    To this:

    [ pmath size=14 ]e=sum{n=0}{infty}{1/{n!}}[ /pmath ]

    Which then gets automatically published, like this via the wpmathpub plug-in itself:

    e=sum{n=0}{infty}{1/{n!}}

  9. TuXWeb Says:

    Good plug-in !
    but there is a mistake in your example…

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

  10. noufal Says:

    Good post.

  11. romina Says:

    Keep up the good work! :)

  12. bayaraa86 Says:

    Good post.

  13. Time Synchronisation Says:

    This is a great plugin

  14. Chman Says:

    Thanks for this plugin, that’s exactly what I was looking for. Works great with WordPress 2.7 by the way. Keep up the great work !

  15. Sabuj Kundu aka manchumahara Says:

    The main library is great. but when I saw that this can be used as wordpress plugin and u did that I am really happy to get this plugin. Thanks for your effort…

  16. tip Says:

    I really like the layout and colors that you chose for this website! It certainly is incredible! :)

  17. test Says:

    [ pmath size=14 ]e=sum{infty}{n=0}{1/{n!}}[ /pmath ]

    Editor’s note: A person calling themselves “test” posted this message with a wpmathpub string that included spaces between the brackets “[" and the "pmath" / "/pmath" tags. The use of space allows a person to post the text and as such the conversion to a math graphic does not take place. Below is the same text string but without the spaces.

    e=sum{infty}{n=0}{1/{n!}}

  18. Photowork Says:

    Amazing plugin, nice work, thanks for share!

  19. Ron Fredericks Says:

    Hi Vinicius:

    LaTEx and mathml are both official standards for publishing. Yet many I have talked to find the server overhead more complex with these all inclusive standards. So my plug-in meets the needs of mathmaticians and math enthusiasts that are not web server experts or can not afford to maintain server support for these larger tools.

    That’s why wp-latex has a similar number of downloads at 2,058 total downloads compared to wpmathpub at 1,544 – as seen on the wordpress.org/extend/plugins site today.

  20. Blogszok Says:

    Good plugin, very helpful and easy to use, thanks.

  21. Ramoonus Says:

    Is it compatible with WordPress 2.8?

  22. Ron Fredericks Says:

    What WordPress 2.8? Latest version of WordPress.org blog software is version 2.7.1.

  23. kafechew.info Says:

    Great. Let me try here:

    [ pmath ] {{250*(80a+1)+2b]-250} / 2 [ /pmath ]

  24. drdee Says:

    Great plugin and it seems to work with WP 2.8

  25. Ron Fredericks Says:

    Thanks drdee:

    for the update on WP version 2.8 and your nice comment.

    Ron

  26. robert Says:

    can you get it to work on phpBB forum?

  27. photowork Says:

    Thank you for a great plugin. I’m very appreciate it. Cheers!

  28. MaheshT Says:

    Hi , Very good plugin. It started working without additional installation, like other plugin.
    I am wondering if there is way to simplify following expression.
    For example.

    Present value of future cash flow

    Pv = A[ (1  -  (1+r)^(- N))/r]

    If i remove space between – N, result looks odd
    Pv = A[ (1  -  (1+r)^(-N))/r]

    editor’s note: I added “size=20″to MaheshT’s pmath code like this:
    [ pmath size=20] Pv = A[ (1 - (1+r)^(- N))/r] [ /pmath]
    and
    [ pmath size=20] Pv = A[ (1 - (1+r)^(- N))/r] [ /pmath]
    to highlight this example. See Phil’s comment on March 30′th for a possible workaround.

  29. Jeff Bushong Says:

    How ya doing? You picked the ones closed to my heart too, despite the fact I know I am guilty of #1 when I don’t pay attention.

  30. Luis Says:

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

  31. Phil Says:

    Testing the following expression to see if it works:

    1 – 2 = -1

    editor’s note: Phil’s code looks like this: [ pmath size=20]1 – 2 = -1[ /pmath], I added the “size=20″ to expand the visual point Phil is making here.

    Basically I’m on WordPress 2.9.2 and wpmathpub has problems rendering expressions containing . Apparently this happens because all instances of has been wptexturized into & #8211; which got fed into wpmathpub.

    However this only happens in my comments and I suspect it’s the same issue as described by MaheshT above. This did not happen in my WordPress 2.3.3 installation even though comments in 2.3.3 seem to be wptexturized in the same manner as well.

    I worked around this via a crude hack by adding a

    remove_filter(‘comment_text’, ‘wptexturize’);

    within the plugin but would like a more elegant solution.

  32. Phil Says:

    Yup the above seems to have confirmed my suspicion about the problem of [space][minus sign][space] being wptexturized into [space]& #8211;[space] in later versons of WordPress, prior to being fed into wpmathpub.

    Strange enough, all instances of [space][minus sign][space] are also wptexturized within the main content of my blog entries but the equations show up fine there, but the problem only occurs in my comments.

  33. Phil Says:

    Thanks for your quick reply Ron.

    On the contrary I think my workaround is far from neat as it simply disables WordPress’ inherent formatting capabilities (though admittedly many developers have been tearing their hair out over this controversial wptexturize function).

    So to summarize:

    1. & #8211; do not show up in my WP 2.3.3 and wpmathpub works in both blog entries and comments. (Note: wptexturize is supposed to be running as early as WP 1.5 so I have no clue why the [space][minus][space] is not converted to & #8211; in WP 2.3.3)

    2. [space][minus][space] is converted to & #8211; in my WP 2.9.2 in both blog entries and comments. However wpmathpub renders these cases properly in the blog entries.

    This problem will manifest itself in any expression that contains [space][minus][space]. Some further examples just to verify:

    delim{|}{30(2)^2 – 240(2) + 210}{|} = 150
    v = int{}{}{a} dt = int{}{}{(60t – 240)} dt = 30t^2 – 240t + c
    int{0}{10}{delim{|}{30t^2 – 240t + 210}{|}}dt

    I suspect it may not be limited to just [space][minus][space] but any of the character combos that are listed under the wptexturize function in wp-includes/formatting.php

    Before we artificially prevent the wptexturizing of [space][minus][space] (and certain character combos), perhaps the key issue is to find out why expressions with & #8211; can be successfully rendered by wpmathpub in the blog content but not in comments.

    Meanwhile I’ll try to do some investigation on my end …

    P.S. Ron’s blog is on WP 2.8.4 and the issue occurs so it’s not only 2.9.2. Maybe users of other versions can try this just to ascertain if this is indeed universal and which version of WP did this issue first surface.

    P.P.S. To check whether your [space][minus][space] has been converted to & #8211;, deactivate wpmathpub and ‘view source’ the relevant section(s) of your HTML code. I notice the alt/title text of those problematic equation images will have their minus sign(s) represented by & #8211;

  34. Kendall Lembo Says:

    I must say that your current blogging site is particularly topical. I have been shelling out a lot of free time during the last couple weeks scouting around at what is out there consistent with the fact that I will be planning to launch a blog. The info you have place on here is essentially to the point. It just appears so challenging when it comes to all the web sites that are out there, but I really like the way your looks. Gotta take delight in where modern technology has come over the past nine yrs.

  35. Jan Says:

    Hi,
    I cannot seem to get your plugin operating on our website. When I look at the statistics page of the plugin the last line where it says mathfilter(y=mx^2+b): does not show the necessary maths equation that is shown in your image guide. Our operating system is SunOs. Do you think this is the problem. I look forward to some advice please.
    Thanks

  36. posicionamiento web Says:

    I’d like to see that actually working need one for one of my websites contact me if possible

  37. Maxwell Says:

    Is this plugin working anymore..because I am unable to make it work

  38. Carpet Shampooer  Says:

    wordpress is the best blogging platform ever-~-

  39. lars Says:

    Works great except “>” or “y[/pmath]

  40. lars Says:

    As you saw there is a problem with greather or smaller than

  41. lars Says:

    The problem is that “>” inside the pmath tags make it eat the rest of the page.

  42. Sudeep Says:

    Hi Ron,

    I have seen this plugin working beautifully with some of thw wordpress installation, however somehow it has not worked for me giving an errr ” the mathpub is not usable under this condition”. I have trried to disable all plugin and see mathpu… it does not work… in the option page the image is not displayed… but all the conditions like dir. writeable etc is ok. would it possible to get any pointer to make changes in the settings. Look forward for an early response., regards Sudeep

  43. Talisha Orlandi Says:

    Fantastic website, Wanted in order to comment that i can not necessarily connect with the rss or atom stream, you may choose install the best wordpress tool for that to be able to workthat.

  44. creacion paginas web Says:

    Is it compatible with WordPress 3.1?

  45. Magaly Renzo Says:

    Serious pack:

  46. socrates Says:

    Great plugin really help a lot of bloggers and webmaster out there. thank you for providing and sharing us your hard work.

  47. Sascha Says:

    Hi is this possible

    f(x)=e ^-x
    i want – and the x as exponent.

    Thanks :)

  48. sanovnik Says:

    Excellent post. I want to thank you for this informative read. Keep up your great work.

  49. Hotels Says:

    You actually make it appear really easy together with your presentation but I in finding this matter to be really one thing which I believe I might never understand. It kind of feels too complex and extremely wide for me. I am taking a look forward in your next publish, I will attempt to get the grasp of it!

  50. Ron Fredericks Says:

    Hi Sascha:

    To learn how to use wpmathpub, you can look at the help file offered by the math font engine provider: http://www.xm1math.net/phpmathpublisher/doc/help.html

    I used “invisible parenthesis” to group the “-” sign with the “x” in the exponent like this:
    [ pmath ]f(x)=e^{-x}[ /pmath ] only without the spaces in the pmath tags.

    f(x)=e^{-x}

  51. Ron Fredericks Says:

    Yes creacion,

    wpmathpub is compatible with WordPress 3.1 – see it in action on http://www.lecturemaker.com

  52. phil Says:

    Hi Ron,
    Is wpmathpub compatible with wordpress 3.2.1 ??

    I get this error message…

    Warning: chmod() [function.chmod]: Operation not permitted in /mnt/vhosts/otherjobsforteachers.com/httpdocs/wp-content/plugins/wpmathpub/wpmathpub.php on line 85

    I am using the graphene theme

    thanks,
    phil

  53. Ron Fredericks Says:

    Hi Phil:

    Yes wpmathpub works just fine on wordpress 3.2.1 I use it on my other website with wordpress 3.2.1 without any problem: http://www.lecturemaker.com

    The warning message seems pretty clear, your web host does not allow you to usethe chmod function. The function is used in wpmathpub.php to automatically make one sub-directory called “./img” available for both read and write operations. In this way, new math graphics images can be created to replace the math text during the math publishing process in your blog posts.

    This issues with chmod has come up to my attention from would-be users a few times. So there is a simple but manual fix already baked into the php code. Change the line listed below in your copy of the php code from “true” to “false” so that “AUTOCHMOD” is defined as “false”. Then have your administrator make the subdirectory “./img” be writeable and readable. If security is very restricted, then your admin may have to create this sub-directory as well. Have him/her read the php code comments to see where this directory should be located.

    //
    // Control automatic test and set feature for write access to ‘img’ directory.
    // Automatic test and set feature when define(“AUTOCHMOD”, true);
    // Manual automatic test and set feature when define(“AUTOCHMOD”, false);
    define(“AUTOCHMOD”, true);

  54. Ron Fredericks Says:

    Hi Phil,

    I just updated http://www.lecturemaker.com web site to wordpress version 3.3. It too is fully compatible with wpmathpub version 1.0.8. See it in action here:
    http://www.lecturemaker.com/2011/01/introduction-to-math-blogging/

  55. ??????? ??????? Says:

    Wow! This can be one particular of the most useful blogs We’ve ever arrive across on this subject. Basically Magnificent. I’m also an expert in this topic therefore I can understand your hard work.

  56. WordPress plugin Says:

    Looks like great plugin. Just what I need, thank you.

  57. Download Free Fonts Says:

    thanks for the Plugins…It worked and helped me

  58. James Chun Says:

    I installed it and it worked great. But when I installed a custom post type, and tried it in the custom post, it doesn’t work, I just see the text line with the pmath tag. How do I make it work for all regular and custom posts.

  59. rmaths Says:

    Thanks you,
    It’s great plugin, It worked fine.
    Can I change folder
    http://www.mysite.com/wp-content/plugins/wpmathpublisher/img
    to
    http://www.mysite.com/img ?
    Thanks you,

  60. http://steadfastswindl70.shutterfly.com/steadfastswindl70 Says:

    Good blog yoou have got here.. It’s hard to find good quality writing like yours nowadays.
    I truly appreciate individuals like you! Take care!!

    Here is my page :: social media managemesnt Hitchin (http://steadfastswindl70.shutterfly.com/steadfastswindl70)

  61. consumer lending Says:

    One part of the e-mail that was sent to all Play – Station Network
    Users really rubbed me the wrong way. Having been an ID theft victim,
    I can tell you first hand the value of having someone in your corner when you find your information has been compromised.
    Applicajts receive points for items such as occupation, length of employment and annual income.

Leave a Reply

What is 13 + 6 ?
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) :-)