yangsheng6810 / org-latex-impatient

Instant Previews LaTeX snippets in Org-mode
GNU General Public License v3.0
148 stars 10 forks source link

Error in parsing SVG image : no more preview #21

Closed deb75 closed 11 months ago

deb75 commented 11 months ago

emacs 29 / mingw64 / windows 11

It was working nicely since I reinstalled some components. The process is active and working but nothing more shows up except a small white square. In the *Messages* buffer, each time I try to preview, I get the following error report :

Error parsing SVG image: XML parse error: Error domain 1 code 4 on line 1 column 1 of data: Start tag expected, '<' not found [13 times]

It seems there are some errors in the produced svg. What can I do ?

Regards

deb75 commented 11 months ago

Solved. This was a deprecation warning with nodejs.

I changed :

(setq org-latex-impatient--process
        (make-process
         :name "org-latex-impatient"
         :buffer org-latex-impatient--output-buffer
         :command (append (list org-latex-impatient-tex2svg-bin
                                tex-string)
                          (when org-latex-impatient--is-inline
                            '("--inline")))

into

 (setq org-latex-impatient--process
        (make-process
         :name "org-latex-impatient"
         :buffer org-latex-impatient--output-buffer
         :command (append org-latex-impatient-tex2svg-bin
                          (list tex-string)
                          (when org-latex-impatient--is-inline
                            '("--inline")))

That is to say I changed org-latex-impatient-tex2svg-bin from a string to a list :

(defconst local/org-latex-impatient-tex2svg-bin (list "/path/to/node.exe" "--no-warnings" "/path/to/tex2svg"))

This means also that a previous check on this variable has to be adapted.

Could it be possible to update the repository with this change ?

Regards

yangsheng6810 commented 11 months ago

Thanks for all your efforts! I will take a look this weekend. After a quick glance, I will probably add a customizable variable, e.g. org-latex-impatient-tex2svg-arguments.

deb75 commented 10 months ago

I appreciate.

Another reason to change is that on windows11 text2svg is not always recognized as an executable, unlike on linux. So, I initially had to change org-latex-impatient-tex2svg-bin from a string to a list with first element being the real executable (node.exe).

Regards