auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX-devel] [gs-devel] Asking help for preview-latex


From: Ikumi Keita
Subject: Re: [AUCTeX-devel] [gs-devel] Asking help for preview-latex
Date: Fri, 12 Jul 2019 17:33:14 +0900

>>>>> David Kastrup <address@hidden> writes:
> I don't think that the drawback is necessary: in contrast to a working
> DELAYBIND, it is easy to test for existence of the PDF dictionary at
> runtime and use it if available.

> The test would be something like

> /GS_PDF_ProcSet where { pop [put old code here] } if

Do you mean that the patch listed below should work?  But it fails for
me, at least for gs 9.27 with patches which Chris indicated.  The "do
not enter" sign appears in the Emacs buffer and the math formulae are
not replaced with images for the following document "tst-prv.tex" when
the Emacs theme is "deeper-blue".  I quote the two errors at the last of
this message.

The errors persist even if I change the line
"/GS_PDF_ProcSet GS_PDF_ProcSet dup maxlength dict copy dup begin\
to
"GS_PDF_ProcSet dup maxlength dict copy dup begin\
or
"dup maxlength dict copy dup begin\
.

Regards,
Ikumi Keita

----- tst-prv.tex --------------------------------------------------
\documentclass{article}

\begin{document}
\begin{equation}
  1+1=2
\end{equation}

\(x^{2}+y^{2}=z^{2}\)

\end{document}
---------------------------------------------------------------------

----- patch for master branch of git repo ---------------------------
diff --git a/preview.el.in b/preview.el.in
index 30bf45bf..49f1d133 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -750,10 +750,12 @@ to Ghostscript floats."
   (let ((fg (aref colors 1)))
     (if fg
        (concat
+        "/GS_PDF_ProcSet where { pop [ "
         "/GS_PDF_ProcSet GS_PDF_ProcSet dup maxlength dict copy dup begin\
 /graphicsbeginpage{//graphicsbeginpage exec "
         (mapconcat #'preview-gs-color-value fg " ")
-        " 3 copy rg RG}bind store end readonly store "))))
+        " 3 copy rg RG}bind store end readonly store "
+        "] } if "))))
 
 (defun preview-gs-color-string (colors)
   "Return a string setting up colors"

----------------------------------------------------------------------

----- errors ---------------------------------------------------------
/usr/local/texlive/2019/bin/amd64-freebsd/rungs 
-dOutputFile\=\(tst-prv.prv/tmpfUQPAL/pr1-2.png\) -q -dDELAYSAFER -dNOPAUSE 
-DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 
-sDEVICE\=png16m -r108.606x108.587
GS>{<</PermitFileReading[(tst-prv.pdf)(tst-prv.prv/tmpfUQPAL/preview.dsc)]>> 
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 0.0937514 0.101564 0.14844 setrgbcolor clippath fill 0.8 0.8 0.8 
setrgbcolor}{pop}ifelse}bind/PageSize[1 
1]>>setpagedevice/preview-do{/.preview-ST[count 4 roll save]def dup length 0 
eq{pop}{setpagedevice}{ifelse exec}stopped{handleerror quit}if .preview-ST 
aload pop restore}bind def /GS_PDF_ProcSet where { pop [ /GS_PDF_ProcSet 
GS_PDF_ProcSet dup maxlength dict copy dup 
begin/graphicsbeginpage{//graphicsbeginpage exec 0.8 0.8 0.8 3 copy rg RG}bind 
store end readonly store ] } if  (tst-prv.prv/tmpfUQPAL/preview.dsc)(r)file 
/.preview-ST 1 index def dup 0 setfileposition 460()/SubFileDecode filter cvx 
exec .preview-ST dup dup 460 setfileposition 53()/SubFileDecode filter 
cvx<<>>preview-do
Error: /typecheck in --setfileposition--
Operand stack:
   false   false   false   460
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:739/1123(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Current file position is 28
GS<4>

/usr/local/texlive/2019/bin/amd64-freebsd/rungs 
-dOutputFile\=\(tst-prv.prv/tmpfUQPAL/pr1-1.png\) -q -dDELAYSAFER -dNOPAUSE 
-DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 
-sDEVICE\=png16m -r108.606x108.587
GS>{<</PermitFileReading[(tst-prv.pdf)(tst-prv.prv/tmpfUQPAL/preview.dsc)]>> 
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 0.0937514 0.101564 0.14844 setrgbcolor clippath fill 0.8 0.8 0.8 
setrgbcolor}{pop}ifelse}bind/PageSize[1 
1]>>setpagedevice/preview-do{/.preview-ST[count 4 roll save]def dup length 0 
eq{pop}{setpagedevice}{ifelse exec}stopped{handleerror quit}if .preview-ST 
aload pop restore}bind def /GS_PDF_ProcSet where { pop [ /GS_PDF_ProcSet 
GS_PDF_ProcSet dup maxlength dict copy dup 
begin/graphicsbeginpage{//graphicsbeginpage exec 0.8 0.8 0.8 3 copy rg RG}bind 
store end readonly store ] } if  (tst-prv.prv/tmpfUQPAL/preview.dsc)(r)file 
/.preview-ST 1 index def dup 0 setfileposition 460()/SubFileDecode filter cvx 
exec .preview-ST dup dup 513 setfileposition 52()/SubFileDecode filter 
cvx<<>>preview-do
Error: /undefined in graphicsbeginpage
Operand stack:
   false
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
Dictionary stack:
   --dict:739/1123(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
GS<1>
----------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]