To enable automatic latex-preview-pane-mode with AUCTex I bound it to a hook:
(add-hook 'LaTeX-mode-hook 'latex-preview-pane-mode)
This works.
When I open a *.tex file, then latex-preview-pane-mode gets enabled.
BUT: now when I export a org-mode file via latex to pdf (C-c C-e l o) two times (or more often), then the latex-preview-pane window (aka DocView or pdf-tools) is also opened a second time. My frame then shows on both windows the generated pdf. The bad thing is, it breaks auto-revert of the pdf-preview (the pdf-view does not get updated to changes anymore).
(removing the above hook, repairs org-mode's latex export. But then latex-preview-pane-mode gets not automatic enabled from within AUCTex)
Question:
How can I have latex-preview-pane-mode enabled automatically and working with both AUCTex and org-mode's latex export?
Note: I have seen 2 similar named questions here, but those have a complete different topic.
Note: I added (add-to-list 'revert-without-query ".+\\.pdf$") for auto-revert of pdf files to my init.el.
LaTeX-mode-hookinstead ofLaTeX-mode? Note thatlatex-preview-pane-enablesetslatex-mode-hookinstead. Furthermore could it be that you meanauto-revert-modeinstead ofauto-reverse? – Tobias Jun 30 '18 at 01:03:hookfrom use-package, which just looks slightly different) – jue Jun 30 '18 at 07:10latex-mode-hook(instead of LaTeX-mode-hook) by callinglatex-preview-pane-enable, or ensuring it isnil, does not change anything on the behavior. – jue Jun 30 '18 at 07:39