Karthik Chikmagalur <[email protected]> writes:

>>> 1. preview.sty can fail with exit-code 1 even when the run is
>>> successful.  This is by design for preview.sty, details are in its
>>> manual.  For this reason we have:
>>>
>>>         (plist-put (cddr tex-compile-async) :success img-extract-async)
>>>         (plist-put (cddr tex-compile-async) :failure img-extract-async)
>>>
>>> implying we always run the image extractor, even if the tex compilation
>>> "fails".  So when the image converter fails, we don't know if it was
>>> because the tex compilation failed and no dvi was produced.
>>
>>> 2. dvipng has a --follow option that we use, where it is started right
>>> away, before any dvi files have been produced.  This is for speed.
>>> dvipng can read a partially produced dvi file and start producing images
>>> for completed pages.  This is why the dvipng route is much faster than
>>> dvisvgm -- dvipng previews can feel instant if you have a small LaTeX
>>> preamble.
>>>
>>> But in this context it means image-extract-async runs whether or not the
>>> LaTeX process fails. 
>>
>> These caveats would be nice to put somewhere in the commentary.
>> Because it is bending :failure/:success design quite a bit.
>
> I mentioned this in the commentary.  Note that this is shown in the
> process tree diagram we draw in the same block comment, but without
> explaining why:
>
> ;; dvisvgm case:
> ;; └─ Compile tex file ⟶ stdout to `org-latex-preview--latex-preview-filter'
> ;;    └─ (success or failure)          <------- HERE --------

That one I saw. What was not clear is why it is needed.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to