From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: [bug] latex fragment preview with dvipng ignores :foreground specification Date: Mon, 28 Jan 2013 20:41:18 +1030 Message-ID: <87fw1laa7t.fsf@ucl.ac.uk> References: <878v7g27f7.fsf@ucl.ac.uk> <12554.1359160368@alphaville> <87sj5ncxt2.fsf@ucl.ac.uk> <87622ijg6s.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tzlgj-00052Y-Eg for emacs-orgmode@gnu.org; Mon, 28 Jan 2013 05:11:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tzlgh-00089G-1v for emacs-orgmode@gnu.org; Mon, 28 Jan 2013 05:11:41 -0500 Received: from db3ehsobe003.messaging.microsoft.com ([213.199.154.141]:8184 helo=db3outboundpool.messaging.microsoft.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tzlgg-00087n-PL for emacs-orgmode@gnu.org; Mon, 28 Jan 2013 05:11:38 -0500 In-Reply-To: <87622ijg6s.fsf@gmail.com> (Myles English's message of "Mon, 28 Jan 2013 00:37:31 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Myles English Cc: Nick Dokos , emacs-orgmode@gnu.org Myles English writes: > Hi Eric, > > Eric S Fraga writes: > >> Nick Dokos writes: >> >>> I tried the imagemagick setting, set the options variable to black background >>> and red foreground - lo and behold, that's what I get in the preview. >> >> I was correct in my conclusion last night that I needed to go to >> bed... I was making a silly mistake (and I won't go into details ;-). >> >> This does indeed work! Thanks again. > > Please could you clarify a couple of things for me? > > From your investigations can you say if there is a bug in the orgmode > use of dvipng, or has dvipng changed so that the expected behaviour is > no longer supported? I too use a dark display (emacs theme > zenburn-emacs), get the black fragments in normal latex blocks in org > files (i.e. not beamer), and org-format-latex-options has no visible > effect, how can I have white formulae again? > > Thanks, > > Myles > Hi Myles, Thanks for prompting me on this. I've explored the code a bit further. The two approaches, i.e. dvipng vs imagemagick, differ not only in the tool used to create the image and the source of the image (dvi versus pdf) but also in the latex code actually created to generate the image in the first place. The dvipng route does not specify any colours in the latex and relies on dvipng to change explicitly the background and foreground colours. The imagemagick route, however, creates a latex file that has the colour specifications directly and the conversion does change any colours. So, it could be that dvipng has changed and no longer changes the colours correctly or it may be that latex has changed in how the dvi file specifies colours? However, I have verified that dvipng will work just fine, without asking for colour changes, if the dvi is created using the latex code used for the imagemagick case. This leads me to suggest that both cases (dvipng and imagemagick) use the same latex code and, in fact, it may be possible to fold both functions org-create-formula-image-with-dvipng and org-create-formula-image-with-imagemagick into one... but maybe this has other repercussions. One such repercussion could be the use of transparent colour specifications: dvipng would appear to support this but imagemagick might not (as org appears to use white when transparent is specified for a background colour, if I understood the code. eric -- : Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D : in Emacs 24.3.50.1 and Org release_7.9.3d-891-gf52600