Hi Al,
>>>>> Al Haji-Ali <[email protected]> writes:
> Mmm.. That's gonna be annoying to debug because it seems to be working
> perfectly on my system and I couldn't break it (even starting from `emacs
> -Q`).
> Are you able to provide a recipe for this error at all?
Sure.
1. Backup ~/.emacs.d/init.el and place this init file instead:
---- ~/.emacs.d ------------------------------------------------------
;; Use AUCTeX from git repo.
(when (equal user-login-name user-real-login-name)
(load "~/repo/auctex/auctex/auctex-autoloads.el" nil t t)
(with-eval-after-load 'info
(add-to-list 'Info-additional-directory-list
"~/repo/auctex/auctex/doc/")))
;; preview-point
(add-to-list 'load-path "~/repo/auctex/preview-point")
(require 'preview-point)
;; Minimum configuration to enable point-preview
(setq preview-image-type 'point-dvisvgm)
;; Configuration of preview for optimal behavior -- Optional
(setq
preview-leave-open-previews-visible t
preview-auto-cache-preamble t
preview-locating-previews-message nil)
;; Always use DVI to generate cleaner previews. Requires special handling of
`hyperref`
(setq preview-LaTeX-command-replacements '(preview-LaTeX-disable-pdfoutput))
;; Customize behavior of point-preview
(setq preview-point-show-in 'buframe ;; or 'after-string for an inline preview
intead.
preview-point-progress-indicators 'faces)
;; Enable automatic preview update on change.
(add-hook 'LaTeX-mode-hook
(lambda () (add-hook 'after-change-functions
#'preview-point-buf-change nil t)))
----------------------------------------------------------------------
2. emacs PATH/TO/circ.tex
3. Type C-c C-p C-d
4. Then the region process buffer pops up showing:
----------------------------------------------------------------------
Running `Preview-LaTeX' on `circ' with ``pdflatex -ini -interaction=nonstopmod
[...]
TeX Output exited as expected with code 1 at Thu Sep 4 19:38:44
Running `Preview-DviSVGM' with ``dvisvgm --no-fonts circ.dvi --page=-
--output="circ.prv/tmpCkPGir/prev%3p.svg" --scale=0.98 ''
pre-processing DVI file (format version 2)
processing page 1
[...]
processing page 35
PostScript error: undefined in junk
Operand stack:
-32891 -32891 32891 32891 455111 127431 2102611
Preview-DviSVGM exited abnormally with code 254 at Thu Sep 4 19:38:45
Running `DviPS' with ``dvips -Pwww circ.dvi -o circ.prv/tmpALO5Gp/preview.ps''
This is dvips(k) 2025.1 (TeX Live 2025) Copyright 2025 Radical Eye Software
(www.radicaleye.com)
' TeX output 2025.09.04:1938' -> circ.prv/tmpALO5Gp/preview.ps
[...]
DviPS finished at Thu Sep 4 19:38:45
Running `Preview-Ghostscript' with ``/usr/local/bin/rungs
-sOutputFile\=circ.prv/tmpALO5Gp/pr1-\%d.png -q -dDELAYSAFER -dNOPAUSE
-DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4
-sDEVICE\=png16m -r94.08x93.9978''
Preview-Ghostscript finished at Thu Sep 4 19:38:45
Ghostscript: Wrong type argument: stringp,
("/home/keita/repo/auctex/auctex/circ.prv/tmpALO5Gp/preview.ps" . 7)
----------------------------------------------------------------------
In addition, echo area shows
----------------------------------------------------------------------
error in process sentinel: Wrong type argument: stringp,
("/home/keita/repo/auctex/auctex/circ.prv/tmpALO5Gp/preview.ps" . 7)
----------------------------------------------------------------------
, which is also logged in *Messages* buffer.
>> What is strange to me is that the error symbol ("under construction"
>> sign) sometimes appears and sometimes doesn't. I haven't found the
>> condition which determines that outcomes, so I can't provide reliable
>> recipe to reproduce the issue. :-(
>>
> It should appear briefly the first time before being replaced by the icon.
> On subsequent refreshes (assuming `preview-point-progress-indicators` is set
> to `'faces`), it won't appear but the face of svg images will dim slightly
> (not png ones of course).
Ah, sorry. Yes, that's the case for most of the ordinary math
expressions, whereas I'm referring to the chunk causing intentional
error, namely:
Wird nun $\ifPreview\special{ps: junk}\fi f \geq 0.5$, wie sich durch
> Yes, I meant killing the buffer. I am not sure why it leaves files on
> my system (without preview-point -- which fixes these issues). Here's
> a minimal recipe I have, starting from `emacs -Q`, maybe others can
> test it as well to pin down the discrepancy.
> (progn
> (add-to-list 'load-path "~/path/to/auctex")
> (load "~/path/to/auctex/auctex-autoloads.el" nil t t)
> (setq preview-image-type 'dvipng
> preview-LaTeX-command-replacements '(preview-LaTeX-disable-pdfoutput))
> (find-file "test.tex"))
> The file test.tex has
> \documentclass{article}
> \usepackage[showlabels,sections,floats,textmath,displaymath]{preview}
> \begin{document}
> $ABQAq$
> $\ifpreview\special{ps: junk}\fi F$
> $Q$
> \end{document}
> Press C-c C-p C-p, then kill the buffer (or quit emacs). On my system, the
> folder `_region_.prv` has a temporary directory with the file `preview.ps`.
This recipe works as you described, thanks. (Previous recipe has
$A
instead of
$ABQAq$
in the sample tex file, probably that's the reason.)
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW