title: Auto-reload pdf viewer while editing latex files
body: <p>I use the <a href="http://repo.or.cz/w/llpp.git" rel="noreferrer">llpp</a> pdf viewer when editing my LaTeX files. To have it automatically refreshing the pdf file when I compile, I use a wrapper to launch it (cf. <a href="https://github.com/pSub/configs/blob/master/.bin/pdfviewer" rel="noreferrer">this</a>).</p>
  
  <p>The part handling the waiting and refreshing is this one :</p>
  
  <pre><code>inotifywait -m -e close_write $1 | while read; do
      kill -HUP $pid_llpp
  done &amp;
  </code></pre>
  
  <p>My problem is the following : whenever an error occurs in the compilation of the tex file, no pdf output is procuded and llpp is closing. I tried something like that :</p>
  
  <pre><code>inotifywait -m -e close_write $1 | while read; do
      if [ -a $1 ]
      then
          kill -HUP $pid_llpp
      fi
  done &amp;
  </code></pre>
  
  <p>It works partially : when an error occurs during the compilation, llpp doesn't close but does not refresh anymore...</p>
  
  <p>Could anyone help me to solve this problem ?</p>