tecosaur / org-latex-preview-todos

A tracker for the Org LaTeX Preview effort on https://git.tecosaur.net/tec/org-mode
4 stars 0 forks source link

Usage of :matchers in org-latex-preview-appearance-options #33

Open karthink opened 3 months ago

karthink commented 3 months ago

IIUC, we are not using the matchers option in org-latex-preview-appearance-options. We match LaTeX fragments using a combination of org-element and org-latex-preview--tentative-math-re. :matchers needs to be either deprecated or we should add support for it.

yantar92 commented 3 months ago

karthink @.***> writes:

IIUC, we are not using the matchers option in org-latex-preview-appearance-options. We match LaTeX fragments using a combination of org-element and org-latex-preview--tentative-math-re. :matchers needs to be either deprecated or we should add support for it.

See https://list.orgmode.org/orgmode/CACA2kSOfmuZAEm5VMd7Bqw23UMy0HCyX+Ed10mde=-6Ys_djug@mail.gmail.com/

People do use matchers, so we should definitely preserve this feature.

-- 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

karthink commented 3 months ago

People do use matchers, so we should definitely preserve this feature.

I will add support for matchers then. This support will be basic, in the sense that org-latex-preview will find fragments with these matchers in the relevant document scope and preview them.

tecosaur commented 3 months ago

People do use matchers, so we should definitely preserve this feature.

I do wonder what :matchers is actually useful for? A quick glance seems to indicate it was mainly used to work around previous limitations in the system? (such as the example you link Ihor)

yantar92 commented 3 months ago

tecosaur @.***> writes:

People do use matchers, so we should definitely preserve this feature.

I do wonder what :matchers is actually useful for? A quick glance seems to indicate it was mainly used to work around previous limitations in the system? (such as the example you link Ihor)

AFAIR, another problem was with [ rendered as separate paragraphs, which they may or may not be depending on the exporter.

Another viable option might be when people just want to preview inline LaTeX, but not latex environments for example.

-- 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

tecosaur commented 6 days ago

I do wonder if a list of "things to preview" might be a viable alternative to matchers? Something like '(latex-inline latex-display latex-environment) is what I'm thinking. Shoehorning in custom RegExp really does seem a bit hacky :sweat_smile: