2

I am creating latex documents on Linux (Debian 9) writing them in markdown and converting them with pandoc.

I use the following pandoc terminal command:

watch -n 5 pandoc -N --toc --toc-depth=3 -f markdown checklist.md -t 
latex -o checklist.pdf

which compiles the markdown code into a pdf (latex) every 5 seconds, which enables live preview.

The issue is that the pdf in the pdf reader (i have tried several, i.e. evince, atril, okular, mupdf) flashes every time the pdf is recompiled (in this case every 5 seconds), which is somewhat annoying.

I had a similar setup for latex live preview in vim, and it was not flashing like this.

(one possible difference between the vim setup, and my current workflow, is that in vim, the latex code would auto-save after any changes, which i am not doing now (and would rather not do).

PS: i have found this script, that seems interesting, but am not sure how to get it to work:

https://gist.github.com/mmcclimon/7311538

badaboum
  • 31
  • 6
  • pretty sure this is dependent on the PDF viewer... what vim preview were you using? – mb21 Dec 15 '17 at 17:52
  • i was using vim-latex-live-preview: https://github.com/xuhdev/vim-latex-live-preview – badaboum Dec 15 '17 at 18:24
  • As a workaround, you could use [entr](http://entrproject.org/), inotify, or similar things to recompile only whenever the file changes. – tarleb Dec 17 '17 at 22:10
  • Could you give an example of how this would be used together with pandoc? – badaboum Dec 18 '17 at 23:20
  • See also [How to refresh automatically on a PDF viewer? - Stack Overflow](https://stackoverflow.com/questions/7401292/how-to-refresh-automatically-on-a-pdf-viewer) for different viewers. ■ I think mupdf doesn't flash (or it's much less noticeable) [pdf - How to make mupdf automatically refresh a document - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/425907/how-to-make-mupdf-automatically-refresh-a-document) – user202729 Mar 25 '23 at 14:12

0 Answers0