I use emacs in frame-only mode and org to typeset latex equations and technical writing.
Since it is hard to see and understand the latex equations in their raw format, I use a package called org-fragtog
which just calls the function org-latex-preview
to convert the latex code to an image, and insert it in the current buffer.
The problem is, every time a new equation is inserted for the first time, org-latex-preview
calls dvipng
which opens a new window with the message:
"This is dvipng 1.16 Copyright 2002-2015, 2019 Jan-Ake Larsson [1] ".
Is there a way to suppress this window to open in the first place, or to make it open only when there is an error?
When you are creating lots of equations in a row this gets in the way and stops the flow.
Update
While not knowing a lot of elisp, I could craft the function below. The only problem is it is not being called after org-latex-preview
is executed. Anyone know why?
(defun kill-latex-preview-window ()
(interactive
(let ((buffer "*Org Preview LaTeX Output*"))
(if (get-buffer buffer)
(progn
(delete-frame (select-frame-by-name buffer))
(kill-buffer buffer)
)
)
)
)
)
(add-hook 'post-command-hook 'kill-latex-preview-window )
post-command-hook
withdelete-window
but I am getting the error:Attempt to delete minibuffer or sole ordinary window
. Do you have some suggestion?emacs -q
? If you cannot, then something in your init file is doing this. Alternatively, you might try to installimagemagick
and do(setq org-preview-latex-default-process 'imagemagick)
and see if that behaves any better.-q
todvips
to silence it, customizingorg-preview-latex-process-alist
. It's just a wild guess, I don't know if silencing it will have the desired effect.org-latex-preview
execution.