emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pre-PATCH] Overhaul of the LaTeX preview system


From: Ihor Radchenko
Subject: Re: [Pre-PATCH] Overhaul of the LaTeX preview system
Date: Wed, 15 Mar 2023 09:34:36 +0000

Timothy <orgmode@tec.tecosaur.net> writes:

>> 3. It took 20+ seconds (!!!) to generate previews in a single section in
>>    my large notes.org. Profile attached - org-latex-preview parses the
>>    whole 20Mb buffer to generate the preamble. Why?
>
> Because of the use of buffer info in generating the preamble, which calls
> `org-export--annotate-info'. I’m currently considering introducing a variable 
> to
> allow for the use of buffer-specific info to be toggled.

What if `org-export--annotate-info' could be made async?

>> 5. Why triangles? Something resembling “waiting” would be more
>>    meaningful.
>
> It has to be a small icon, so that basically means simple geometric shapes 
> only.
> There’s also the “grey text” indicator, and “no indicator” option.

What about

(define-fringe-bitmap
    'sand-clock
    [#b11111111
     #b10000001
     #b01000010
     #b01000010
     #b01101110
     #b00111100
     #b00011000
     #b00100100
     #b01000010
     #b01011010
     #b11111111
     #b11111111])

Attachment: sand-clock.png
Description: PNG image


>> 6. What will happen if I add/remove #+LATEX_HEADER in the buffer? in
>>    subtree properties? Are in-buffer latex settings supposed to affect
>>    anything? I tried to add #+LATEX_HEADER on top of the file, but the
>>    preview do not appear to be re-generated.
>
> Currently you need to set `org-latex-preview--preamble-content' to nil, which
> currently can be done by doing `C-c C-c' on the header / otherwise running
> `org-restart'.

It would be better to provide a command.
C-c C-c is too dramatic - it will reset much more than just preview
cache. (Like org-element-cache).

Or better add a new prefix arg to org-latex-preview that will force
re-generation.

Further, as discussed in the DM, we may need to consider that equation
preview may depend on latex export settings:

1. preview might be generic, utilizing "average" common latex preamble
2. preview might try to conform to latex export settings according to
   full document export
3. preview might use a different latex preamble when the current subtree
   will not actually be exported - like in commented subtrees. In
   particular, it matters for equation numbering
4. preview might try to generate preamble according to subtree export
   settings - some Org workflows involve multiple documents in one Org
   file, exported separately via subtree export.
   
-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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

[Prev in Thread] Current Thread [Next in Thread]