Bug 646632 - Generating previews for equations fails
Summary: Generating previews for equations fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: emacs-auctex
Version: 13
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Jonathan Underwood
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-25 19:22 UTC by James Ettle
Modified: 2011-03-18 11:52 UTC (History)
4 users (show)

Fixed In Version: emacs-auctex-11.86-6.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-17 18:51:52 UTC


Attachments (Terms of Use)
Fix bug in Auctex previews not working in Emacs in Fedora 13/14 (2.64 KB, patch)
2011-02-21 04:14 UTC, Sato Ichi
no flags Details | Diff

Description James Ettle 2010-10-25 19:22:43 UTC
Description of problem:
Generating previews of equations etc. in LaTeX documents doesn't work with Emacs-AucTeX. After I try to generate previews for the buffer, the messages buffer is left with:


Saving file /home/james/docs/_region_.tex...
Wrote /home/james/docs/_region_.tex
Wrote /home/james/docs/prv_mydoc.ini
Type `C-c C-l' to display results of compilation. [2 times]
locating previews...
Mark set
Type `C-c C-l' to display results of compilation.


but the editor is left with untypeset equations with red "No Entry" icons besides them. Inspecting _region_.prv/ reveals a PS file containing all the typeset equations, but they don't seem to make it back to the editor.

If I right-click on one of the "No Entry" icons and select View error, I see something like:


gs -dOutputFile\=\(_region_.prv/tmp16143D-x/pr1-11.png\) -q -dSAFER -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 -sDEVICE\=png16m -r94.2656x94.3773
GS>{DELAYSAFER{.setsafe}if}stopped pop/.preview-BP currentpagedevice/BeginPage get dup null eq{pop{pop}bind}if def<</BeginPage{currentpagedevice/PageSize get dup 0 get 1 ne exch 1 get 1 ne or{.preview-BP }{pop}ifelse}bind/PageSize[1 1]>>setpagedevice/preview-do{[count 3 roll save]3 1 roll dup length 0 eq{pop}{setpagedevice}{ifelse .runandhide}stopped{handleerror quit}if aload pop restore}bind def [(_region_.prv/tmp16143D-x/preview.ps)(r)file]aload exch dup 0 setfileposition 24763()/SubFileDecode filter cvx .runandhide aload pop dup dup 24763 setfileposition 102()/SubFileDecode filter cvx<<>>preview-do
Error: /typecheck in --setfileposition--
Operand stack:
   --nostringval--   (_region_.prv/tmp16143D-x/preview.ps)   (r)   (r)   (r)   25807   25807   25807   25690   25690   25690   25557   25557   25557   25456   25456   25456   25355   25355   25355   25253   25253   25253   25151   25151   25151   25029   25029   25029   24865   24865   24865   24763
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   %loop_continue   --nostringval--   --nostringval--   false   1   %stopped_push   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1157/1684(ro)(G)--   --dict:0/20(G)--   --dict:72/200(L)--
Current allocation mode is local
Current file position is 30
GS<33>


I've seen elsewhere that this may be a ghostscript problem, but I've reported it against auctex as a starting point.

Version-Release number of selected component (if applicable):
tex-preview-11.86-2.fc13.noarch
ghostscript-8.71-19.fc13.x86_64
emacs-auctex-11.86-2.fc13.noarch
emacs-23.2-4.fc13.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. Write LaTeX document in auctex-enabled Emacs.
2. Go to Emacs menu, select Preview, for buffer.
  
Actual results:
Equations still in $$ input form with "No Entry" icons to the left.

Expected results:
Typeset previews.

Comment 1 Sato Ichi 2011-02-21 03:57:23 UTC
I had the same problem in Fedora 13 and 14.

There is a patch for this bug in the cvs version of auctex 11.86:

http://cvs.savannah.gnu.org/viewvc/auctex/preview/preview.el?root=auctex&r1=1.284&r2=1.285&view=patch

I applied that patch to /usr/share/emacs/site-lisp/auctex/preview.el, from the emacs-auctex-el package, then recompiled that elisp file into a .elc file, and it worked. Previews now work in Emacs with auctex.

When applying the patch, there was a message that 1 of the 6 patch hunks failed. Namely, the fifth hunk:

---------------------------------------------------------
@@ -3512,7 +3519,7 @@

 (defconst preview-version (eval-when-compile
   (let ((name "$Name:  $")
-   (rev "$Revision: 1.284 $"))
+   (rev "$Revision: 1.285 $"))
     (or (when (string-match "\\`[$]Name: *release_\\([^ ]+\\) *[$]\\'" name)
      (setq name (match-string 1 name))
      (while (string-match "_" name)
---------------------------------------------------------

It looks like the '(let ((name "$Name:  $")' line didn't quite match what was in the old preview.el, so I just manually changed the revision number from 1.284 to 1.285 in preview.el before recompiling it. In the patch it should read:

---------------------------------------------------------
@@ -3512,7 +3519,7 @@
 
 (defconst preview-version (eval-when-compile
   (let ((name "$Name: release_11_86 $")
-   (rev "$Revision: 1.284 $"))
+   (rev "$Revision: 1.285 $"))
     (or (when (string-match "\\`[$]Name: *release_\\([^ ]+\\) *[$]\\'" name)
      (setq name (match-string 1 name))
      (while (string-match "_" name)
---------------------------------------------------------

Comment 2 Sato Ichi 2011-02-21 04:14:59 UTC
Created attachment 479813 [details]
Fix bug in Auctex previews not working in Emacs in Fedora 13/14

Modified patch for /usr/share/emacs/site-lisp/auctex/preview.el from the emacs-auctex-el package.

Save as preview-el.patch then run:

patch /usr/share/emacs/site-lisp/auctex/preview.el preview-el.patch

Then open /usr/share/emacs/site-lisp/auctex/preview.el in Emacs, select the Emacs-Lisp menu and select the "Byte-compile this File".

Comment 3 Hendrik Richter 2011-03-08 19:32:26 UTC
This bug is also present in current Fedora 15 alpha. The patch from comment 2 fixes this.

Comment 4 Fedora Update System 2011-03-08 23:37:46 UTC
emacs-auctex-11.86-6.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/emacs-auctex-11.86-6.fc15

Comment 5 Fedora Update System 2011-03-08 23:38:48 UTC
emacs-auctex-11.86-6.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/emacs-auctex-11.86-6.fc14

Comment 6 Fedora Update System 2011-03-08 23:41:51 UTC
emacs-auctex-11.86-6.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/emacs-auctex-11.86-6.fc13

Comment 7 Fedora Update System 2011-03-17 18:51:46 UTC
emacs-auctex-11.86-6.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2011-03-17 18:53:02 UTC
emacs-auctex-11.86-6.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2011-03-18 04:01:24 UTC
emacs-auctex-11.86-6.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Jonathan Underwood 2011-03-18 11:52:21 UTC
Sato Ichi - many thanks for the patch.


Note You need to log in before you can comment on or make changes to this bug.