Zim

Change color of dvipng Equation Images?

Asked by ArielSonique

Hi,

I successfully followed the directions in one of the Wiki threads for changing the background and text color of Zim using the gtkrc file in the /use/share/themes folder.

However, dvipng still generates black on white equation images. Is there any way to invert the color of dvipng images?

Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
Zim Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#1

Can you double check the images really have white background - or are they
rendered in zim with a white background ?

Reason for asking is that the plugin uses the command "dvipng -q -bg
Transparent -T tight -o", which should result in images with a transparent
background. You can open them in an image editor to verify.

If they really have white background maybe there is something wrong with the
version of dvipng you have or something similar.

However if they do have transparent background, but zim is not showing the
correct background maybe I need to fix something in the code. In that case
please file a bug report.

Regards,

Jaap

Revision history for this message
ArielSonique (sonic-notes) said :
#2

Thanks for your reply! The dvipng images have a transparent background. Zim shows them with their transparent background so your plugin works well. However, I chose a dark grey background and light grey text when I modified the the gtkrc file in the /use/share/themes folder. The equations remain as black on transparent -> which appears as black on dark grey. As a result, I was wondering if it was possible to change the font and background of the equation pngs to match the background and font of the new the gtkrc file... or even just switch the black text to white.

I am sure this is not a bug as it works well in the default set up. Thanks once again.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#3

Please do report it as a bug. This may well cause issues on high contrast
themes that are used by people with impaired vision.

The quick hack would be to open up the source of the plugin and add an
option for the dvipng command. Will only work for new equations though.

On Sat, Oct 29, 2011 at 11:40 PM, ArielSonique <
<email address hidden>> wrote:

> Question #176239 on Zim changed:
> https://answers.launchpad.net/zim/+question/176239
>
> ArielSonique posted a new comment:
> Thanks for your reply! The dvipng images have a transparent background.
> Zim shows them with their transparent background so your plugin works
> well. However, I chose a dark grey background and light grey text when
> I modified the the gtkrc file in the /use/share/themes folder. The
> equations remain as black on transparent -> which appears as black on
> dark grey. As a result, I was wondering if it was possible to change the
> font and background of the equation pngs to match the background and
> font of the new the gtkrc file... or even just switch the black text to
> white.
>
> I am sure this is not a bug as it works well in the default set up.
> Thanks once again.
>
> --
> You received this question notification because you are an answer
> contact for Zim.
>

Revision history for this message
Stephen Lowry (the-corn-flake86) said :
#4

I just wanted to post a work around;

You can specify a particular color to be used by the equation editor in Zim by specifying a color scheme and the appropriate code.
The supported color schemes (atleast, that I've gotten to work on my computer) are rgb, RGB, cmyk.
The format to do so inside the editor is:

\color[color scheme]{color code}

The unfortunate thing is you'll need to specify the color you want the equation to appear as <u><i>everytime</i></u> you open the equation editor.

You'll want to find the appropriate code for the 'font colour' that is being used by your theme.
A 'color picker' program/tool such as 'gcolor2' or 'Gimp' should be able to sort you out.
There are also plenty of HEX to RGB converters available on the internet.

My example: (I'm using a particular dark-grey back ground with a lighter grey font color)
\color[RGB]{77,77,77}

Some useful reading:
http://en.wikibooks.org/wiki/LaTeX/Colors

Can you help with this problem?

Provide an answer of your own, or ask ArielSonique for more information if necessary.

To post a message you must log in.