Open cipher1024 opened 6 years ago
Should be possible. You could do something like this:
(add-hook 'org-mode-hook (lambda () (latex-preview-pane-mode 1)))
M-x latex-preview-pane-mode
then modify the variable pdflatex command
. It should be whatever you use to compile your org mode document. Probably the best option here is to use a command line tool or script to behave in the same way that pdflatex does. That is, if the input file is my file.org
ensure the output file is my file.pdf
. Let me know if it works! We can put it on the wiki if you want to write it up.
Thanks for the fast response!
Before even getting to configure the pdflatex command, I've been struggling with a few things. I record them here as much to show sign of life as to walk myself through my own thinking process:
latex-preview-pane-mode
kicks in, compiles the latex file and displays it.I've made the mistake of trying to tackle all three at once. I'm now temporarily dropping 2. and focusing on 1. and 3. So far, I still don't have any good results.
I think I have a decent approach for 1. I built a org-preview-pane-mode
function as follows:
(defun org-export-and-compile ()
(org-latex-export-to-latex)
(latex-preview-pane-update))
(defun org-preview-pane-mode ()
(latex-preview-pane-mode)
(setq-local latex-preview-pane-multifile-mode 'prompt)
(setq-local lpp-TeX-master
(replace-regexp-in-string "\.org$" ".tex"
(buffer-file-name)))
(setq-local pdf-latex-command "latexmk")
(remove-hook 'after-save-hook 'latex-preview-pane-update)
(add-hook 'after-save-hook 'org-export-and-compile t t))
A weird thing that's been happening is that the compilation seems to succeed but instead of displaying a pdf, latex-preview-pane
displays` my org file.
I have to put it down to do some writing and I'll get back to it.
I'm writing a multi-file document in org-mode and exporting to LaTeX. I've already setup a way of doing the compilation but now I'd like to use latex-preview-pane simply to display the resulting pdf. Is there a way to only monitor a selected pdf and display it when it changes?