For replacing org-html-format-latex with auctex preview (or more correctly texfrag) it would be nice to run auctex preview synchronously.

The code of auctex preview contains several alternatives where TeX-process-asynchronous is taken care of. Nevertheless, if one sets TeX-process-asynchronous to nil TeX-inline-preview-internal fails. The most obvious reason is that TeX-run-command returns the process status instead of a process id and auctex tries to set the coding system for that "process". If one skips the coding system issues by adding a check for TeX-process-asynchronous one gets the next error in preview-TeX-inline-sentinel and that goes on and on.

Is this a bug of auctex preview or has the support of synchronous auctex preview been dropped or even never fully been implemented?

Version info:

  • emacs: 25.3.1
  • auctex: 11.92.0
  • (defcustom TeX-process-asynchronous (not (eq system-type 'ms-dos)) - hmm, could you give some description of your workflow? – Andreas Röhler Mar 16 '18 at 12:10
  • @AndreasRöhler I exploit a slightly modified bounding box calculation from auctex preview via texfrag for org-mode html export. In that way the inline formulas are placed perfectly in the exported html. (Note, that I got something like synchronous auctex preview working with polling and by checking whether the formulas in the LaTeX buffer are finished (either with a preview or a failure). – Tobias Mar 16 '18 at 12:23
  • Sounds good already. Beside: don't understand what "synchronous" should mean in the context. In other cases saw a queued, delayed execution - which seems not at stake. Rather an automated trigger of the preview - right? – Andreas Röhler Mar 16 '18 at 15:28
  • The meaning of "synchronous" in my context: Embedding the preview code for org html export requires synchronous execution, i.e., the preview images must be ready when my function texfrag-region-synchronous returns. I cannot work with sentinels there since I am replacing stuff in the middle of org-html-format-latex via an :override advice. (It is actually an :around but effectively an :override, but that are technical details...). – Tobias Mar 16 '18 at 15:34
  • 1
    @AndreasRöhler The texfrag stuff is quite okay. texfrag-region-synchronous will be a legitim member of that library. I will release it together with some bugfixes at github.com/TobiasZawada/texfrag in near future. The html exporter stuff orgTZA-html is written for my own purpose only. I do quite evil stuff therein to get what I need without respect for any coding rules. Don't know yet whether I will really make it public. – Tobias Mar 16 '18 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.