From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Popineau Subject: Re: Bug: Windows-unfriendly filename in org-preview-latex-process-alist customization Date: Sat, 26 Nov 2016 17:35:17 +0100 Message-ID: References: Reply-To: fabrice.popineau@centralesupelec.fr Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1144364c277f57054236d430 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAfxD-0002WX-24 for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 11:35:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAfx9-0001mh-UO for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 11:35:55 -0500 Received: from smtp2.supelec.fr ([160.228.120.31]:37022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAfx9-0001jU-JY for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 11:35:51 -0500 Received: from localhost (localhost [127.0.0.1]) by smtp2.supelec.fr (Postfix) with ESMTP id 2F2BC8014D for ; Sat, 26 Nov 2016 17:35:39 +0100 (CET) Received: from smtp2.supelec.fr ([127.0.0.1]) by localhost (smtp2.supelec.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cQeD9mYMlK5b for ; Sat, 26 Nov 2016 17:35:38 +0100 (CET) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by smtp2.supelec.fr (Postfix) with ESMTPSA id D86DD8016C for ; Sat, 26 Nov 2016 17:35:38 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id a197so168280509wmd.0 for ; Sat, 26 Nov 2016 08:35:38 -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" To: Scott Otterson Cc: "Emacs-orgmode@gnu.org" --001a1144364c277f57054236d430 Content-Type: text/plain; charset=UTF-8 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 --001a1144364c277f57054236d430 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


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

M-x org-toggle-latex-fragment

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

This is dvipng 1.15 Copyright 2002-2015 Jan-Ake Lar= sson
[1=C2=A0
dvipng: Fatal error, cannot open output f= ile c:/Users/scott/AppData/Local/Temp/"orgtex4628hQG.png
=C2=A0
The reason for the failure is the leftover qu= ote (...Temp/"orgtex...)=C2=A0in the expected png output file.=C2=A0 W= ith 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/Loc= al/Temp/""orgtex4628hQG".png "c:/Users/scott/AppDa= ta/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.=C2=A0 But the command fail= s in a Windows cmd window; if I remove the extra quotes, then the command w= orks in the cmd window too.

The extra quote c= omes 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 :
=C2= =A0
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 co= mmand strings.

Fabrice
--001a1144364c277f57054236d430--