From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Otterson Subject: Re: Bug: Windows-unfriendly filename in org-preview-latex-process-alist customization Date: Sun, 27 Nov 2016 00:15:45 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1145bc907efc8f05423c6d67 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAmCt-0003o2-0i for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 18:16:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAmCp-0001QR-Q2 for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 18:16:30 -0500 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:36342) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cAmCp-0001QJ-Ey for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 18:16:27 -0500 Received: by mail-wm0-x234.google.com with SMTP id g23so173576172wme.1 for ; Sat, 26 Nov 2016 15:16:27 -0800 (PST) In-Reply-To: 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" Cc: "Emacs-orgmode@gnu.org" --001a1145bc907efc8f05423c6d67 Content-Type: text/plain; charset=UTF-8 Thanks Fabrice. After more experimentation, I found that image-converter field of the customization alist should be: ("dvipng -fg %F -bg %B -D %D -T tight -o \"%o%b\.png\" %f") If this also works for *nix, then I hope that the org-mode maintainers will make this string the new default. If it doesn't work on linux, then I hope that it's possible to come up with a string that works in both OS families (and that could be the new default). I'll be back on Linux in a few months, and would love to keep a simple, cross-platform .emacs file. On Sat, Nov 26, 2016 at 5:35 PM, Fabrice Popineau < fabrice.popineau@supelec.fr> wrote: > > > 2016-11-26 16:41 GMT+01:00 Scott Otterson : > >> In my Windows build of emacs, when I put the cursor in a latex equation >> and run >> >> M-x org-toggle-latex-fragment >> >> >> then things chug along for a second but then fail. In the *Org Preview >> LaTex Output* buffer, I see the message: >> >> This is dvipng 1.15 Copyright 2002-2015 Jan-Ake Larsson >> [1 >> dvipng: Fatal error, cannot open output file >> c:/Users/scott/AppData/Local/Temp/"orgtex4628hQG.png >> >> >> The reason for the failure is the leftover quote (...Temp/"orgtex...) in >> the expected png output file. With some hackery, I can see that the >> command that's being run is: >> >> dvipng -fg "rgb 0 0 0" -bg "rgb 1 1 1" -D "102.0" -T tight -o >> "c:/Users/scott/AppData/Local/Temp/""orgtex4628hQG".png >> "c:/Users/scott/AppData/Local/Temp/orgtex4628hQG.dvi" >> >> >> If I paste that into a cygwin xterm, it runs fine on the .dvi file that's >> still in the Temp directory. But the command fails in a Windows cmd >> window; if I remove the extra quotes, then the command works in the cmd >> window too. >> >> The extra quote comes from the default customization for the dvipng >> image-converter field of org-preview-latex-process-alist: >> >> dvipng -fg %F -bg %B -D %D -T tight -o %o%b.png %f >> >> >> > This command should read : > > dvipng -fg %F -bg %B -D %D -T tight -o "%o%b.png" %f > > and the args shouldn't be quoted before. > Unquoting those strings will possibly require to change other command > strings. > > Fabrice > --001a1145bc907efc8f05423c6d67 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks Fabrice.=C2=A0 Aft= er more experimentation, I found that image-converter field of the customiz= ation alist should be:

("dvipng -fg %F -bg %B -D %D -T tight -o \"%o%b\.png= \" %f")

If this also works for *nix, then I hope that the org-mode maintai= ners will make this string the new default.=C2=A0 If it doesn't work on= linux, then I hope that it's possible to come up with a string that wo= rks in both OS families (and that could be the new default).=C2=A0 I'll= be back on Linux in a few months, and would love to keep a simple, cross-p= latform .emacs file.

On Sat, Nov 26, 2016 at 5:35 PM, Fabrice Popineau <fabrice.popineau@supelec.fr> wrote:


2016-11-26 16:41 GMT+01:00 Scott Otter= son <scotto@sharpleaf.org>:
In my Windows build of emacs,= when I put the cursor in a latex equation and run

=
= M-x org-toggle-latex-fragment

then th= ings chug along for a second but then fail.=C2=A0 In the *Org Preview LaTex= Output* buffer, I see the message:

This is dvipng 1.= 15 Copyright 2002-2015 Jan-Ake Larsson
[1=C2=A0
dvipng:= Fatal error, cannot open output file c:/Users/scott/AppData/Local/Tem= p/"orgtex4628hQG.png
=C2=A0
The reason = for the failure is the leftover quote (...Temp/"orgtex...)=C2=A0in the= expected png output file.=C2=A0 With some hackery, I can see that the comm= and that's being run is:

dvipng -fg &quo= t;rgb 0 0 0" -bg "rgb 1 1 1" -D "102.0" -T tight -= o "c:/Users/scott/AppData/Local/Temp/""orgtex4628hQG&qu= ot;.png "c:/Users/scott/AppData/Local/Temp/orgtex4628hQG.dvi"= ;

If I paste that into a c= ygwin xterm, it runs fine on the .dvi file that's still in the Temp dir= ectory.=C2=A0 But the command fails in a Windows cmd window; if I remove th= e extra quotes, then the command works in the cmd window too.
The extra quote comes from the default customization for t= he dvipng image-converter field of org-preview-latex-process-alist:

dvipng -fg %F -bg %B -D %D -T tight -o %o%b.png %f


T= his command should read :
=C2=A0
dvipn= g -fg %F -bg %B -D %D -T tight -o "%o%b.png" %f
and the args shouldn't be quoted before.
U= nquoting those strings will possibly require to change other command string= s.

= Fabrice

--001a1145bc907efc8f05423c6d67--