abougouffa / minemacs

MinEmacs: an Emacs configuration framework for daily use
https://abougouffa.github.io/minemacs/
MIT License
140 stars 17 forks source link

[BUG] Export org to latex and opening them doesn't work #149

Closed hmanhng closed 4 months ago

hmanhng commented 7 months ago

Describe the bug I know this probably shouldn't be asked here but ~app-launcher did not find many of my applications on the NixOs system.~ . Only zathura was not found

What annoys me is when I want to export org to latex and open it. They don't work on my system, Compile to latex is quite slow and doesn't open the .pdf file after compile.

Checkup list

To Reproduce Steps to reproduce the behavior:

  1. Open simple org file
  2. export to latex and open with C-c C-e l o
  3. It takes about 15-20 seconds to export a file with only 10 lines
  4. No applications opened with the pdf file

I just changed this in config.el

(with-eval-after-load 'ox-latex
  (setq org-latex-compiler "lualatex"))
  ;; (setq org-file-apps
  ;;       '(("\\.pdf::\\([0-9]+\\)\\'" . "zathura -P %1 %s"))))
;; (setq org-preview-latex-default-process 'dvisvgm)

Additional context Can you try exporting the org to latex and opening it in your machine? Does the problem lie with NixOs

abougouffa commented 7 months ago

Exporting Org to PDFs via LaTeX backend has always been slow for me!

The export and open is not working in my config also, I will investigate this later.

Thanks for the feedback @hmanhng !

hmanhng commented 7 months ago

C-c C-e l o slowness is probably due to running org-latex-export-to-pdf with async. I tried running this command in Mx which gave it significantly faster speed.

Also I tried

(with-eval-after-load 'org
  (push '("\\.pdf\\'" . "zathura %s") org-file-apps))

eval: (org-open-file "somefile.pdf") works.

abougouffa commented 7 months ago

C-c C-e l o slowness is probably due to running org-latex-export-to-pdf with async. I tried running this command in Mx which gave it significantly faster speed.

Yep, it is a known tradeoff, exporting asynchronously is slower but not blocking, while exporting synchronously is faster but blocks Emacs during the export process.