Exact WordPress.org LaTeX plugin equivalent to LaTeX support in WordPress.com

  • Unknown's avatar

    I’m using WP LaTeX in my .org sandbox and there seem to be syntactical differences between it and the default LateX support in .com. Which .org LaTeX plugin is exactly equivalent to what is contained in .com? This is an issue because post LaTeX text in .org does not parse in .com when I copy and paste. That is the purpose of having a .org sandbox.

    The blog I need help with is: (visible only to logged in users)

  • Hi there – you’ll want to use the Jetpack plugin:
    http://jetpack.me/

    Once you’ve connected Jetpack, be sure to activate the Beautiful Math module:
    http://jetpack.me/support/beautiful-math/

  • Unknown's avatar

    Interesting. I upgraded my cc of JetPack to 2.4 and I saw the Beautiful Math blurb. I expected to have to activate it but there is no activation button. Also, Beautiful Math blurb is rendered in a faint font implying it is not available. How do I activate it? I know some parts of JetPack are working because my contact form, which uses JetPack works correctly. I discovered when getting contact to work I needed an admin account in .org the same as my admin account in .com, namely docheri. Once I created that account in .org contact worked. Obviously, JetPack in .org uses a WordPress.com server. FYI: LaTeX functionality works for me in .com. I have several LaTeX equations in a post there that display correctly. It is getting Beautiful Math to work in .org that is the problem. I also posted my LaTeX source to the appropriate .org forum.

  • Hi there – if you click “Learn More” in the Beautiful Math module, you’ll see either Activate or Deactivate. I believe it’s activated by default.

    If you still have trouble, can you please let me know the full URL of your Jetpack site, so I can make sure your connection is good?

  • Unknown's avatar

    Here is cut and paste from my .org post that fails to render in JetPack LateX:

    Author’s note: equations for falling bodies:
    $latex t = sqrt{frac{2d} {g}} ;text{where}; {g=9.81 ,text{m/s}^2}$
    $latex d = frac{1} {2}gt^2,d ;text{in meters}$

    Beautiful Math module blurb has neither an activate nor a deactivate button, so it must be active by default, but… as you can see, it does not render correctly.

    My .com account is docheri. My WordPress website/blog is thomasdocheri.com. If you go there you can see the LaTeX equation in the post ‘How to get rid of three dead bodies.’ Yes, something is definitely broken with that .org to .com connection. I’m running my .org sandbox in MAMP so on my Mac the server is localhost. However, JetPack contact form uses a connection to .com and it works correctly.

    Thomas

  • Hi there – Jetpack cannot connect to localhost. Your site must be a publicly accessible web site that does not require authentication, with a publicly accessible XML-RPC file. This is why the Beautiful Math is not working – because your site is not connected.

  • Unknown's avatar

    Okay, I can accept that. My .org site is a sandbox, to experiment with WordPress functionality in a non-public environment. It probably will never be public as long as WordPrss.com serves my needs. However, that does not obviate my need for LaTeX support in it. So, I repeat my original question. What is the best .org LaTeX plugin that best mimics the .com LaTeX support? I want to be able to cut and paste from my .org to my .com, without tweaking the syntax after the paste. Clearly, the plugin WP LaTeX uses different syntax and does not copy and paste successfully.

  • Hi there – I see. In that case, I would probably have pointed you to WP LaTeX, which you say isn’t working out for you. We are support only for sites hosted here at WordPress.com, and the Jetpack forum, so you might ask for advice in the WordPress.org forums.

    You might also report the copy/paste problem here:
    http://wordpress.org/support/plugin/wp-latex

    Of course, you can always open a private test blog here on WordPress.com, for a testing environment on our platform.

  • Unknown's avatar

    Well, I can see I’m not going to be able to do exactly what I want. I can see by inspecting the page source that JetPack implements LaTeX similar to the way WP LaTEX does; by generating .png images. Ugh, that’s ugly. And to make matters worse, JetPack does it differently than WP LaTeX, such that they are just different enough that copy and paste fails. It requires tweaking the code after the copy. Well, I’m sufficiently fluent in LaTeX that I can do this but what a pain. I downloaded MathJax-LaTeX and at least it uses a LaTeX rendering engine to format the equations rather than .png files.

    One reason .png sucks is each equation is a separate img file. That means code like this that works in MathJax-LaTex fails in JetPack:

    <strong>Author's note: equations for falling bodies:</strong>
    <p style="padding-left: 30px; font-size: 70%;">
    [latex]begin{align}
    t & = sqrt{frac{2d} {g}} ;text{where}; {g=9.81 ,text{m/s}^2} \
    d & = frac{1} {2}gt^2,d ;text{in meters} \
    end{align}[/latex]</p>

    Therefore, JetPack does not even support the alignment of = signs, basic math equation presentation. And that style expression I can move to my child theme style.css file. Why font-size? Because the &s=-1 expression is not LaTeX; it’s a hack that plugin writers use. My advice to JetPack developers is to scrap the .png approach and use MathJax-LaTex.

    Yes, I know I can have a free sandbox to play in at WordPress.com – my regular account is a premium account – but that does not give me access to the .php files. My sandbox is educational, for understanding the behavior of WordPress, just in case I want to change it. CSS so far is okay but maybe it won’t be. In case you didn’t know this, WordPress docos are good but far from exceptional. Reading the code always answers the questions nothing else does.

    So, thanks for your help.
    Thomas

  • Hi Thomas – Thanks for your feedback on this; I’ve passed it along to our Jetpack developers. Please let us know if there’s anything else we can help you with.

  • Hi Thomas – Just wanted to pass along that our developers tell me we’re actually thinking about switching to MathJax, but we don’t yet have a timeline for when that might happen.

  • Unknown's avatar

    That’s good news. The notion of generating .png images was a great one when browsers lacked LaTeX support. Those days are mostly gone now. Most current browsers contain a LaTeX rendering engine. If they don’t MathJax will download the JavaScript functions they need. Unfortunately, software developers often are stuck supporting the lowest common denominator, dumb browsers and folks that can’t or won’t upgrade their personal platforms. I know it would be challenging for JetPack’s developers to support both dumb and smart browser but that’s what engineers get paid to do, and open source engineers do it for something other than money. A simple PHP call to $HTTP_SERVER_VARS array and then getting the HTTP_USER_AGENT key will allow the plugin to determine whether to send a .png or the LaTeX expression, as in mine: HTTP_USER_AGENT Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:23.0) Gecko/20100101 Firefox/23.0. That’s the way I would do it if I were on the team.

    Thanks for caring enough to follow up on this.
    Thomas

  • Hi Thomas – you’re very welcome! I’ll keep you posted if there’s news on this front. :)

  • The reason begin{align} doesn’t work is not because we use PNGs but because we treat all LaTeX as though it were in inline/math mode. http://en.support.wordpress.com/latex/#latex-error

    That’s the reason we picked the $latex ... $ syntax: to sort of mirror the familiar LaTeX $ ... $ syntax.

    The following is an ugly and not very satisfactory hack to get around the math mode limitation:

    $latex
    begin{matrix}
    t & = & sqrt{frac{2d} {g}} ;text{where}; {g=9.81 ,text{m/s}^2} \
    d & = & frac{1} {2}gt^2,d ;text{in meters} \
    end{matrix}
    $
  • Unknown's avatar

    Hey Michael,

    Interesting bit of LaTeX code. I wonder if you think it’s ugly for the same reason I do? It aligns the = signs but it seems to center the rendered equations, so there’s a whole lot of white space between the = sign and the shorter equation. But, it does work in WordPress.com. I hope implementing MathJax in JetPack rises on the to-do list.

    I too define my LaTeX math delimiters in html the same way; $latex ...$, as in:

    <script type="text/x-mathjax-config">
            MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex','$'], ['\(','\)']]}});
        </script>
        <script type="text/javascript"
            src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
        </script>

    to avoid having to escape $.

    JetPack appears to be a form of glue that binds the .org and the .com forums together. That is a good thing, IMHO.

    Thomas

  • The topic ‘Exact WordPress.org LaTeX plugin equivalent to LaTeX support in WordPress.com’ is closed to new replies.