From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Otterson Subject: Bug: Windows-unfriendly filename in org-preview-latex-process-alist customization Date: Sat, 26 Nov 2016 16:41:08 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1134c26ab2a411054236137c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAf6y-00060H-1X for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 10:41:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAf6t-00028z-Vl for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 10:41:56 -0500 Received: from mail-wj0-x229.google.com ([2a00:1450:400c:c01::229]:34586) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cAf6t-00028t-NT for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 10:41:51 -0500 Received: by mail-wj0-x229.google.com with SMTP id mp19so80920888wjc.1 for ; Sat, 26 Nov 2016 07:41:51 -0800 (PST) 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: "Emacs-orgmode@gnu.org" --001a1134c26ab2a411054236137c Content-Type: text/plain; charset=UTF-8 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 where the %o%b part of the customization concatenates two strings that are already quoted. That's OK for *nix but apparently not for Windows. I don't see a way to change the customization to fix this; can anyone take a look at the elisp? Thanks, Scott --- A test org file -------------- * Put cursor in the equation below and type C-c C-x C-l \[ e^{i\pi} = -1 \] --- My setup --------------- Emacs : GNU Emacs 25.1.1 (i686-w64-mingw32) of 2016-09-17 Package: Org mode version 9.0.1 (9.0.1-elpaplus @ c:/Users/scott/OneDrive/scotto/.emacs.d/elpa/org-plus-contrib-20161118/) current state: ============== (too huge to send) --001a1134c26ab2a411054236137c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In my Windows build of emacs, when I put the cursor i= n a latex equation and run

M-x org-toggle-latex-fra= gment

then things chug along for a se= cond but then fail.=C2=A0 In the *Org Preview LaTex Output* buffer, I see t= he 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/Temp/"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 command that's being run is:<= /div>

dvipng -fg "rgb 0 0 0" -bg "r= gb 1 1 1" -D "102.0" -T tight -o "c:/Users/scott/AppDat= a/Local/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 f= ile that's still in the Temp directory.=C2=A0 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 t= ight -o %o%b.png %f

where the %o%b part of = the customization concatenates two strings that are already quoted. That= 9;s OK for *nix but apparently not for Windows.

<= div>I don't see a way to change the customization to fix this; can anyo= ne take a look at the elisp?

Thanks,
Scott

--- A test org file ------------= --

* Put cursor in the equation below and typ= e C-c C-x C-l

\[
e^{i\pi} =3D -1
\]

--- My setup ---------------
Emacs =C2=A0: GNU Emacs 25.1.1 (i686-w64-mingw32) of 2016-09-17
=
Package: Org mode version 9.0.1 (9.0.1-elpaplus @ c:/Users/scott/= OneDrive/scotto/.emacs.d/elpa/org-plus-contrib-20161118/)
<= br>

current state:
=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D
(too huge to send)
<= /div> --001a1134c26ab2a411054236137c--