WordPress.org

Forums

Jetpack by WordPress.com
LaTeX not parsing (7 posts)

  1. Xexyz
    Member
    Posted 2 years ago #

    I want to include equations in my posts, and Jetpack says that it allows LaTeX formatting by surrounding the equation with "$latex " and "$". But no matter what I put inside, I get the "Formula does not parse" box.

    I've even tried just copying and pasting the code from http://en.support.wordpress.com/latex/ into a blank post, and that doesn't work. I then tried:

    $latex i$

    And still no joy. I've also tried surrounding the code with [latex] and [/latex].

    Any assistance gratefully received.

    http://wordpress.org/extend/plugins/jetpack/

  2. docheri
    Member
    Posted 2 years ago #

    I have JetPack 2.4 installed and I'm trying without success to include LaTeX math equations. Here is sample:

    $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}$

    JetPack fails to render this code as LaTeX equations. Instead, the code string is displayed. The plugin WP LaTeX renders these equations perfectly. I am trying to use JetPack so I disabled WP LaTeX. I'm trying to use JetPack because my .org implementation is a sandbox the specific purpose of which is to support my .com site, thomasdocheri.com. WP LaTeX has syntactic differences that prevent copy and paste between .org and .com. Any ideas why this code does not work with JetPack?

    Thanks
    Thomas

  3. Michael Adams (mdawaffe)
    Member
    Plugin Author

    Posted 1 year ago #

    Xexyz,

    When you go to your WordPress' admin → Jetpack (/wp-admin/admin.php?page=jetpack), is the "Beautiful Math" feature activated? If you see a blue "Activate" button, click that button and try again.

  4. Michael Adams (mdawaffe)
    Member
    Plugin Author

    Posted 1 year ago #

    docheri,

    Hm... Same questions :) Is the "Beautiful Math" feature activated?

    Also - are you trying to add this LaTeX to a post or a comment?

    $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}$
    
    [latex]t = \sqrt{\frac{2d} {g}} \;\text{where}\; {g=9.81 \,\text{m/s}^2}[/latex]
    [latex]d = \frac{1} {2}gt^2,d \;\text{in meters}[/latex]

    All of the above works for me in a post. Oddly, the [latex][/latex] syntax does not work in comments for me, but the $latex$ syntax does.

    Lastly, what syntactic differences do you see between WP LaTeX and Jetpack?

  5. docheri
    Member
    Posted 1 year ago #

    [ Moderator note: post and link fixed. ]

    JetPack does not work for me in my .org instance but now I know why. Rather than rehash a long discussion I had on the .com JetPack forum, please read this:

    http://en.forums.wordpress.com/topic/exact-wordpressorg-latex-plugin-equivalent-to-latex-support-in-wordpresscom?replies=13#post-1419978

    Now that we are on the same page, the JetPack implementation for .org is brain dead. Most folks, me included, will run a dev server behind a firewall and thus make that platform inaccessible as a server to the cloud. Yes, it is a server but it's meant to be used internally, on an Intranet. My implementation is inside MAMP on my Mac so the server is localhost. I would no more make my Mac visible to XML-RPC than I would ftp nor would I make a Linux dev server visible if I chose that platform for LAMP. I think Automattic needs to rethink JetPack.

    As to diffs between WP LaTeX and JetPack, I never got Beautiful Math to work because of that XML-RPC issue. I was able to activate JetPack but many modules, including Beautiful Math were unavailable. They do not offer the activate/deactivate buttons without a working XML-RPC service. The diffs between WP LaTeX and WordPress.com LaTeX, which I assume is a superset of what's in JetPack, are minor but annoying. In WP Latex we can use the short code to say [latex size="-1"]my LaTeX expression[/latex]. In .com we have to say... $latex my LaTeX expression&s=-1$. You just have to be aware of this and add the extra step after the paste.

    I have not tried LaTeX in a comment, only in posts.

    It must be obvious from what I wrote in the .com piece that I am not a fan of generating .png image files to render LaTeX. I'm now using MathJax-Latex and it is doing what I want it to do. Remember too, I may never deploy a .org version of WordPress. Mine is as a sandbox to better understand the WordPress platform. I wanted access to the php code and the only way to get it is to run a .org sandbox. I think the .png approach was correct before browsers were made smart with the inclusion of LaTeX rendering engines. Can you still make a case for a .png design? Which approach would you say is best for mobile devices? And message to you too, as I said to the JetPack audience, you could make WP LaTeX rally smart and inspect the browser before deciding whether to send a .png or let the browser do the rendering.

    Man, LaTeX is such an interesting notion. I really enjoyed hacking it and discussing it.

    Thomas

  6. Michael Adams (mdawaffe)
    Member
    Plugin Author

    Posted 1 year ago #

    Developers can add the following line to the top of their wp-config.php file to put Jetpack into development mode. In dev mode, you don't need to be connected to WordPress.com (you don't need XML-RPC available), but not all features will work.

    define( 'JETPACK_DEV_DEBUG', true );

    See http://jetpack.me/2013/03/28/jetpack-dev-mode-release/ for more details.

    Unfortunately, it appears that Beautiful Math is one of those features that won't work in dev mode. I think that's a bug. I'll confer with the rest of the team and get it working in dev mode for the next release.

    WP LaTeX, WordPress.com, and Jetpack all accept both LaTeX syntaxes in posts. That is, you should be able to use both[latex]...[/latex] and $latex ... $ everywhere. If you have a specific problem, please let me know and I'll try to sort it out.

    I agree that the LaTeX → PNG isn't very flexible. Depending on your theme, it can look downright ugly. Also, the PNG images we generate don't do a good job of vertically aligning with one another.

    Thanks for the input on MathJax. I'm a big fan. I'd really love to see WordPress.com and Jetpack move to MathJax (probably falling back to PNG). We just haven't had the time to make it happen.

    I'll read through your WP.com forums post and reply there too if there's anything I can add.

  7. docheri
    Member
    Posted 1 year ago #

    There's never enough time. I spent five years at DoubleClick and 18 months at Google. There was always really neat stuff that never rose above the cut line. If I wasn't up to my eyeballs writing fiction I'd volunteer to help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Jetpack by WordPress.com
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic