LaTex formatting: WordPress blog

  • Unknown's avatar

    If WP uses the amsmath package, how come it doesn’t support equation numbering with the ‘begin{equation}…end{equation}’ format?

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

  • Hi there,

    What exactly is the LaTeX code you’re trying to use, and can you give a link to a post or page where you’re trying to use it so we can take a look?

    What is using that code supposed to do?

  • Unknown's avatar

    Hi. Thanks for your reply. The above syntax (“begin{equation}…end{equation}”) numbers equations automatically, usually along the far-right margin, so they can be easily referenced (e.g., “see equation (3),” etc.). It’s impossible to number them manually when centering the equations due to the ugly and hopelessly unmanageable offset that results.

    It should be noted, too, that there seem to be several issues with LaTeX formatting in WordPress. The “begin{array}…end{array}” command, for example, doesn’t properly align the sides of the (in)equality. Here’s a link I created that shows the problem in this instance:

    https://thecriticalstrip.wordpress.com/2019/12/04/formatting-alignment-issues/

    The blog post where numbering would be helpful:

    The (Half-)Life of Han van Meegeren

    Thanks very much for your time.

  • Hm, would you mind adding the example code as LaTeX in that private post, so we can pass this on to our developers?

  • Unknown's avatar

    No problem.

    $latex displaystylebegin{array}{lcl}
    a-at_u-p_u & < & ar_x-ar_xt_c-text{PPI}cdot p_u \
    a(1-t_u)-p_u & < & ar_x(1-t_c)-p_c \
    p_c & < & a((1-t_c)r_x-(1-t_u))+p_u
    end{array}$

    The “align,” “eqnarray,” and “IEEEEeqnarray” commands also do not parse. Examples:

    $latex begin{align}
    a & = b + c \
    & = d + e + f + g + h + i
    + j + k + l nonumber \
    & + m + n + o \
    & = p + q + r + s
    end{align}$

    $latex begin{eqnarray}
    a & = & b + c \
    & = & d + e + f + g + h + i
    + j + k + l nonumber \
    && +: m + n + o \
    & = & p + q + r + s
    end{eqnarray}$

    $latex begin{IEEEeqnarray}{rCl}
    a & = & b + c
    \
    & = & d + e + f + g + h
    + i + j + k nonumber\
    && negmedspace {} + l + m + n + o
    \
    & = & p + q + r + s
    end{IEEEeqnarray}$

    These are basic examples taken right from a popular LaTeX manual.

    Thanks.

  • Okay, the /begin{equation} support is a known issue. I’ve added your report to that, but there hasn’t been active work on our LaTeX implementation in years, so I cannot promise you that someone will work on this soon. LaTeX is, unfortunately, an extremely niche feature, that’s used by very few people, which makes it a difficult thing for our developers to prioritise to work on.

    The “begin{array}…end{array}” command, for example, doesn’t properly align the sides of the (in)equality.

    Okay, so it should right-align operations on the left side of the equation instead of left-align as it’s doing currently? I think that might be due to the parameters you’re adding there, specifically {lcl}, which is left center left if I understand the documentation at http://texdoc.net/texmf-dist/doc/latex/tools/array.pdf correctly. If I change that to {rcl} it aligns like your Online LaTeX editor example in that post.

    The “align,” “eqnarray,” and “IEEEEeqnarray” commands also do not parse.

    begin{align} does not work on WordPress.com, as mentioned here:

    LaTeX

    I don’t know what the other two options are supposed to do or whether they “work inside the math environment” as its stated in our support page, but I think it’s a reasonable assumption that they don’t work for the same reason.

  • Unknown's avatar

    Sounds good. Thanks a lot for looking into this.

  • The topic ‘LaTex formatting: WordPress blog’ is closed to new replies.