Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 267930 - app-emacs/auctex-11.85: preview-latex fails
Summary: app-emacs/auctex-11.85: preview-latex fails
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: GNU Emacs project
URL: http://lists.gnu.org/archive/html/bug...
Whiteboard:
Keywords: NeedPatch
: 691820 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-29 23:26 UTC by paolo muratore-ginanneschi
Modified: 2019-09-05 10:23 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
preview build log (_region_.log,7.99 KB, text/plain)
2009-05-07 09:10 UTC, paolo muratore-ginanneschi
Details
Log file for test.tex (test.log,8.69 KB, text/plain)
2009-05-07 16:26 UTC, paolo muratore-ginanneschi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description paolo muratore-ginanneschi 2009-04-29 23:26:31 UTC
app-emacs/auctex-11.85 (emerged with use-flag preview-latex) fails to 
generate preview on emacs. Preview-latex seems to try to execute
gs -dOutputFile\=\(_region_.prv/tmp12704_yN/pr1-1.png\)
whilst the file
pr1-1.png
has not been generated, (only  _region_.prv/tmp12704_yN/preview.ps exists).

Reproducible: Always

Steps to Reproduce:
1. open tex file with emacs
2. open menu preview
3. select generate previews for environment (section, buffer etc.) 

Actual Results:  
No preview appear.

Expected Results:  
Preview appears.

The error message is:

gs -dOutputFile\=\(_region_.prv/tmp12704_yN/pr1-1.png\) -q -dSAFER -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 -sDEVICE\=png16m -r112.607x112.33
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 0.996109 0.996109 0.996109 setrgbcolor clippath fill 0.101564 0.101564 0.101564 setrgbcolor}{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/tmp12704_yN/preview.ps)(r)file]aload exch dup 0 setfileposition 42791()/SubFileDecode filter cvx .runandhide aload pop dup dup 42791 setfileposition 880()/SubFileDecode filter cvx<<>>preview-do
Error: /undefined in --execute--
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   %loop_continue   1753   2   3   %oparray_pop   --nostringval--   --nostringval--   false   1   %stopped_push   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   false   1   %stopped_push   1148   --nostringval--   %end_runandhide   --nostringval--
Dictionary stack:
   --dict:1154/1684(ro)(G)--   --dict:0/20(G)--   --dict:76/200(L)--   --dict:181/300(L)--   --dict:19/200(L)--
Current allocation mode is local
Last OS error: 2

Customizations loaded by Emacs at the moment of the failure:
Loading /usr/share/emacs/site-lisp/site-gentoo.el (source)...done
Loading /usr/share/emacs/site-lisp/site-gentoo.d/50auctex-gentoo.el (source)...done
Loading /usr/share/emacs/site-lisp/site-gentoo.d/60auctex-gentoo.el (source)...done
Loading paren...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading latexenc...done
Loading tex...
Loading regexp-opt...done
Loading advice...done
Loading tex...done
Loading latex...
Loading edmacro...done
Loading easy-mmode...done
Loading latex...done
Loading font-latex...
Loading bytecomp...done
Loading font-latex...done
Applying style hooks...
Loading /usr/share/emacs/etc/auctex/style/article.elc...done
Applying style hooks... done
Sorting environment...
Removing duplicates... done
Loading tex-bar...done
Loading reftex...done
Loading reftex-dcr...done
Automatic display of crossref information was turned on
Loading preview...
Loading byte-opt...done
Loading preview...done
Applying style hooks... done
Applying style hooks...
Loading /home/paolo/RESEARCH/NS/auto/_region_.el (source)...done
Applying style hooks... done
Sorting environment...
Removing duplicates... done
Applying style hooks... done
Wrote /home/paolo/RESEARCH/NS/_region_.tex
Type `C-c C-l' to display results of compilation.
locating previews...
Comment 1 paolo muratore-ginanneschi 2009-04-30 14:50:57 UTC
The problem occurs only if the source tex file invokes

\usepackage{import}

With the same init emacs file the problem does not occur
is auctex is run with ubuntu-linux.
Comment 2 Christian Faulhammer (RETIRED) gentoo-dev 2009-05-04 14:51:10 UTC
\documentclass{article}
\usepackage{import}
\begin{document}
\begin{displaymath}
x = a  
\end{displaymath}
\end{document}

This does not show any errors to me when previewing.  Please provide a "working" minimal example (see minimalbeispiel.de) and attach it to the bug. What Ghostscript version are you using and what other Emacs packages?  What is your TeX distribution?  TeXLive?
Comment 3 paolo muratore-ginanneschi 2009-05-05 13:42:13 UTC
(In reply to comment #2)

Thanks for your reply!

> \documentclass{article}
> \usepackage{import}
> \begin{document}
> \begin{displaymath}
> x = a  
> \end{displaymath}
> \end{document}
>

Indeed this work for me as well. However if I create
a file named importfile.tex with only entry

\usepackage{hyperref}

then

 \documentclass{article}
 \usepackage{import}
 \import{somepath/}{importfile}
 \begin{document}
 \begin{eqnarray}
 x = a  
 \end{eqnarray}
 \end{document}

gives the above mentioned error message. Same if I use equation instead of eqnarray or if I add options to hyperref ( e.g. \usepackage[pagebackref,breaklinks,linktocpage]{hyperref}). Only the displaymath environment is previewed. 

I have installed:

[I] app-text/texlive-2008  
     with use flags: X extra graphics humanities music omega png pstricks
                  publishers science tex4ht truetype xetex

[I] app-editors/emacs-22.3-r2
     with use flags: X alsa gtk jpeg motif png spell tiff xpm 

[I] app-emacs/emacs-common-gentoo-1.0
     with use flags: X

[I]  virtual/emacs-22

[I] app-emacs/auctex-11.85
     with use flags: preview-latex

[I] app-text/ghostscript-gpl-8.64-r2
     with use flags: X cairo cups djvu gtk jpeg2k
 
[I] virtual/ghostscript-0

My .emacs is:
-------------
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(TeX-source-specials-mode t)
 '(TeX-source-specials-view-start-server t)
 '(case-fold-search t)
 '(current-language-environment "English")
 '(global-font-lock-mode t nil (font-lock))
 '(octave-auto-indent t)
 '(preview-dvipng-command "dvipng -picky -noghostscript %d -o \"%m/prev%%03d.png\"")
 '(preview-dvipng-image-type (quote png))
 '(preview-dvips-command "dvips -Pwww -i -E %d -o %m/preview.000")
 '(preview-fast-conversion t)
 '(preview-image-type (quote png))
 '(show-paren-mode t nil (paren)))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )


;; Math mode by default
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
------------------------

Thanks again for your time.
Comment 4 Christian Faulhammer (RETIRED) gentoo-dev 2009-05-06 07:14:27 UTC
I don't have any problems, even with your example.  Please disable all customisation files (~/.emacs, /usr/share/emacs/site-lisp/site-start.el) by commenting for example and only load

;;; auctex site-lisp configuration

(add-to-list 'load-path "/usr/share/emacs/site-lisp/auctex")
(require 'tex-site)

;; detect needed steps after rebuild
(setq TeX-parse-self t)
(load "preview-latex.el" nil t t)

there.  Then try again.
Comment 5 paolo muratore-ginanneschi 2009-05-06 14:22:20 UTC
I tried what you suggested but the result is the same as described in 
- Comment  #3 -: only the displaymath evironment is previewed correctly.

However I now noticed that the problem is not the import package itself 
but really hyperref. In the customization setting you suggested the file

 \documentclass{article}
 \usepackage{hyperref}
 \begin{document}
 \begin{eqnarray}
 x = a  
 \end{eqnarray}
 \end{document}

generates an error if hyperref is invoked. Again, no problem for displaymath. 
I also tried to run the script above on a different gentoo box
with the same ".emacs" (and same packages installed) as in comment 3. Again
I observe the same problem. 

Hyperref afaik belongs to 

dev-texlive/texlive-latex

I have 2008-r1 installed with (-doc -source)

I tried to reinstall, run  "texconfig font rw" and to repeat all tests. Unfortunately, same problem. The same after trying "texconfig font ro".

Thanks again for your time.
Comment 6 Christian Faulhammer (RETIRED) gentoo-dev 2009-05-07 06:58:43 UTC
Ok, actually I have not the slightest idea what causes your problems.  As I am not able to reproduce, helping you is hard.  In the beginning I don't understand the Ghostscript error, so I have no place to start.
 Anyway, please attach the preview build log (called _region_.log).
Comment 7 paolo muratore-ginanneschi 2009-05-07 09:10:36 UTC
Created attachment 190600 [details]
preview build log 

Please find in attachment the _region_.log file

Thanks anyways for your help. I use LaTeX a lot (with hyperref) so I really
would like to understand what causes the problem.
Comment 8 Christian Faulhammer (RETIRED) gentoo-dev 2009-05-07 13:31:46 UTC
(In reply to comment #7)
> Created an attachment (id=190600) [edit]
> preview build log 
> 
> Please find in attachment the _region_.log file

 Great...what hits me first is:

Could not find \expanded.
(etexcmds)             That can mean that you are not using pdfTeX 1.50 or
(etexcmds)             that some package has redefined \expanded.
(etexcmds)             In the latter case, load this package earlier.

 Could you please process the file with \listfiles as the first command (even before \documentclass) and attach the logfile (the normal log file) to this bug.  Do you have any packages installed in your local tree?  Or self-modified files?

> Thanks anyways for your help.

 One thanks is enough...really. :)

> I use LaTeX a lot (with hyperref) so I really
> would like to understand what causes the problem.

 I am curious, too.

Comment 9 paolo muratore-ginanneschi 2009-05-07 16:26:07 UTC
Created attachment 190634 [details]
Log file for test.tex

Please find in attachment the log file for "test.tex" :

 \listfiles
 \documentclass{article}
 \usepackage{import}
 \usepackage{hyperref}
 \begin{document}
 \begin{eqnarray}
 x = a  
 \end{eqnarray}
 \end{document}

The log file was generated while emacs and auctex where running with the setting recommended in comment  #4. 

If I understood properly your question, in local overlay I have:

[I] dev-lisp/gcl-2.6.7 
     Installed versions:  2.6.7[?](16:06:41 12/16/08)(X ansi custreloc dlopen emacs gprof readline tk -debug -doc)
ebuild patched according to suggestions in Bugzilla Bug 236391
(this package is not installed on the other gentoo machine which has the same preview problem but on which I am not testing)


For the other packages in overlay I can hardly see a relation with the problem, however they are

[I] sys-apps/lm_sensors
     Installed versions:  2.10.7[?](22:07:57 12/17/08)(-sensord)
patch suggested by Bugzilla Bug 245459

[I] x11-drivers/xf86-input-synaptics
     Installed versions:  1.0.0-r101[?](16:01:23 04/10/09)(hal -debug)
Bugzilla Bug 236983 

[I] net-wireless/bluez-utils
 Installed versions:  3.36-r1[?](22:58:25 04/19/09)(alsa cups usb  -debug -examples -gstreamer -old-daemons -test-programs)
patch from debian to get hid2hci call at startup and the device reset

A part from the above and some latex .sty files (however not invoked in test.tex) it does not come to my mind having any other self-modified
file in my gentoo installations. However, hyperref has always behaved
in a way I found a bit odd in the following sense. 
If I do not use bibtex but put the literature in the same source file 
I can compile and obtain proper behaviour only if in the thebibliography
environment individual \bibitem entries are separated by at least one empty line. I do not know whether this is an harmless bug or is the expected
behaviour, I mention it here just because invoking the hyperref package 
seems to cause the problem. 

No further thanks then. :)
Comment 10 Christian Faulhammer (RETIRED) gentoo-dev 2009-05-07 20:14:20 UTC
I forgot the most obvious thing.  You use DVI output while I always use PDF output format.  And with DVI it fails here, too.

Please switch to PDF (C-c C-t C-p) and try again.  This must have to do with the hyperref configuration in combination with AUCTeX.

There are several chances to fix this bug by updating hyperref (there are some newer definitions on CTAN available) or by updating AUCTeX (a CVS version, I can provide one in the overlay, although not until Monday).
Comment 11 paolo muratore-ginanneschi 2009-05-08 11:02:09 UTC
Yes, if I switch to pdf mode I get (on both gentoo boxes) the proper behaviour:
eqnarray is previewed correctly with hyperref either directly invoked or imported
from other file.

For the moment I can live with the pdf mode, no hurry for the (most welcome anyways) updates. 

Have a nice week-end! 
Comment 12 Christian Faulhammer (RETIRED) gentoo-dev 2009-05-11 22:02:19 UTC
(In reply to comment #11)
> Yes, if I switch to pdf mode I get (on both gentoo boxes) the proper behaviour:
> eqnarray is previewed correctly with hyperref either directly invoked or
> imported
> from other file.
> 
> For the moment I can live with the pdf mode, no hurry for the (most welcome
> anyways) updates. 

 I tested with the current checkout of the AUCTeX CVS repository and the current hyperref from CTAN.  It is not getting better.  I will send a bug report to the AUCTeX maintainers first.
Comment 13 Christian Faulhammer (RETIRED) gentoo-dev 2009-07-20 23:20:45 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > Yes, if I switch to pdf mode I get (on both gentoo boxes) the proper behaviour:
> > eqnarray is previewed correctly with hyperref either directly invoked or
> > imported
> > from other file.
> > 
> > For the moment I can live with the pdf mode, no hurry for the (most welcome
> > anyways) updates. 
> 
>  I tested with the current checkout of the AUCTeX CVS repository and the
> current hyperref from CTAN.  It is not getting better.  I will send a bug
> report to the AUCTeX maintainers first.

 Upstream told me that both are very limited in time so they are not reacting on bug reports.  But situation may change in the course of this year.  As I am not that deep into TeX (and preview has a really complex type of interaction with it) I cannot help here.  I stay in contact in upstream and add feedback on this bug.
Comment 14 Ulrich Müller gentoo-dev 2010-02-24 20:16:19 UTC
Is this still an issue in 11.86?
Comment 15 Ivan L. Isaev 2010-02-25 09:36:59 UTC
(In reply to comment #14)
> Is this still an issue in 11.86?
 
yes
Comment 16 paolo muratore-ginanneschi 2012-03-16 21:22:38 UTC
I am now running:
app-emacs/auctex-11.86-r1
app-editors/emacs-23.4-r1
app-text/ghostscript-gpl-9.04-r4

preview latex has become considerably more unstable:

\documentclass{article}
 \begin{document}
 \begin{eqnarray}
 x = a  
 \end{eqnarray}
 \end{document}

cannnot be previewed with error

gs -dOutputFile\=\(_region_.prv/tmp10433Kwo/pr1-1.png\) -q -dDELAYSAFER -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 -sDEVICE\=png16m -r115.087x115.019
GS>{<</PermitFileReading[(_region_.prv/tmp10433Kwo/preview.ps)]>> setuserparams .locksafe} stopped pop {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/tmp10433Kwo/preview.ps)(r)file]aload exch dup 0 setfileposition 39904()/SubFileDecode filter cvx .runandhide aload pop dup dup 39904 setfileposition 138()/SubFileDecode filter cvx<<>>preview-do
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GPL Ghostscript 9.04: Error: Font Renderer Plugin ( FreeType ) return code = -1
GS<1>

The same occurs with
app-text/ghostscript-gpl versions ~9.04-r5 ~9.04-r6 ~9.05

Oddly, in larger latex files preview works most (not always, the failure occurring in "random" places) of the times if I generate preview for buffer.
It never works if I use generate preview if I try to generate preview at point.

In the case of the test file preview did not work with any of the generating methods.

preview for buffer
Comment 17 paolo muratore-ginanneschi 2012-08-30 11:45:44 UTC
In reference to my last entry. The problem is solved by using 

app-text/ghostscript-gpl 9.05-r1

However, preview-latex keeps on failing if 

\usepackage[pagebackref,breaklinks,linktocpage,pageanchor,nesting]{hyperref}

is invoked (independently of the options) in eqnarray and equation environments.
It works instead for $$  and $$ $$ environments.
Comment 18 Ulrich Müller gentoo-dev 2018-02-21 19:07:05 UTC
Is this still an issue in auctex-11.92?
Comment 19 Jonas Stein gentoo-dev 2019-08-09 22:49:26 UTC
*** Bug 691820 has been marked as a duplicate of this bug. ***
Comment 20 Ulrich Müller gentoo-dev 2019-09-05 10:23:58 UTC
(In reply to Ulrich Müller from comment #18)
> Is this still an issue in auctex-11.92?

No answer. Closing.