Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Background

Unfortunately, when hosting your blog with WordPress.com you can't use the MathJax-LaTeX pluging, and have to use the default wordpress LaTeX.

The way it works, is by rendering the LaTeX math into an image, and sticks that image into your blogpost. Since it is an image, it has a background color. The feature was designed so that it tries to figure out the proper background color for your theme to fit the LaTeX in naturally. Unfortunately for me, my background color is white, but the LaTeX is rendered with background gray.

There is a way to change the color of a single equation. For instance:

$latex E = mc^2$

would produce the default background color, while

$latex E = mc^2&bg=ffffff$

would force the background to be white.

This is what I want to achieve, but for every equation in my post. I don't want to have to type &bg=ffffff at the end of each LaTeX environment manually (it is already a big enough hassle to write $latex instead of just $!).


Question

Is there a way to change the background color of all the math equations at once?

Alternatively, if no such method exists.

From where does the $latex $ feature guess the background color, and how can I change what it guesses?

Keep in mind that I am on WordPress.com so I can't simple switch to the MathJax-LaTeX plugin.

share|improve this question
add comment

2 Answers

I thought I would provide a work-around that I have used. Using any editor that allows find-and-replace you can just do the following (assuming $ appears only as latex start/end parameter and not as a symbol by itself):

  1. find-and-replace $ by &bg=ffffff$ (replace ffffff by your favourite colour)
  2. then find-and-replace &bg=ffffff$latex by $latex

It is a pretty bad workaround, since you will have to change the background color in a similar way on all posts if you ever change theme. However, it is much faster than going to each latex environment and changing it by hand.

share|improve this answer
add comment

A simple response: You need to do it manually each time. Remember the background color of LaTeX in wordpress.com is theme dependent. It doesn't always look white (#fff). Some themes (e.g. Comet) show a darker background.

share|improve this answer
    
I specifically say in the question that I don't want to do it manually... so unless your answer is "there is no way to do it except manually" then it isn't an answer to the question as stated. –  Artem Kaznatcheev Sep 11 '11 at 8:55
    
Do you have a custom-design upgrade? I can give you a css-code, which you can paste to override default settings. –  gaurav Sep 11 '11 at 9:00
    
.entry-content img { background:#def123 } Change hex colour code to your favourite color. –  gaurav Sep 11 '11 at 9:09
    
There is some free CSS modification that is allowed. Is that enough? But I think you should edit the code into your answer just for others who might have similar questions, your code might help them. –  Artem Kaznatcheev Sep 11 '11 at 9:11
    
wait, seems I was confused about the free CSS modification. You can only preview, but you have to pay if you want it to take effect. –  Artem Kaznatcheev Sep 11 '11 at 10:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.