tecosaur / org-latex-preview-todos

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

List of third-party packages to be updated #36

Open karthink opened 1 month ago

karthink commented 1 month ago

There are some backward compatibility issues that we can't handle inside Org, mainly because of how these third-party packages are coded. Maintaining an (updated) list here of Emacs packages that depend on Org that will need to be updated to handle changes introduced by org-latex-preview:

pdf-tools

pdf-annot.el uses org-format-latex-header at eval/compile time. This variable is aliased to the new org-latex-preview-preamble, which is itself not defined until the org-latex-preview feature is loaded. As a result, org-format-latex-header is not defined when pdf-annot.el is loaded, and it throws an error.

Solution: Either we must (require 'org-latex-preview) in org.el, or pdf-annot.el should (require 'org-latex-preview) along with (require 'org).

Better solution: pdf-annot.el should not require org in the first place, this is a very heavy operation. It's only used by one function, to create an image for a LaTeX formula. This can be handled by a utility function I will add to org-latex-preview. And even then org-latex-preview can be a runtime dependency instead of load/compile time. Very few users actually need image previews of LaTeX text used in PDF annotations.

ox-hugo

ox-blackfriday (included with ox-hugo) uses Org to create images of LaTeX fragments for HTML exports. Despite our attempt to maintain backward compatibility, this is currently broken with our patches, and I'm not sure why. My best guess is that

In any case, we provide an API to generate images for export now that is different (and more efficient) from the older system, and we need to inform them to update their code.

yantar92 commented 1 month ago

karthink @.***> writes:

ox-blackfriday (included with ox-hugo) uses Org to create images of LaTeX fragments for HTML exports. Despite our attempt to maintain backward compatibility, this is currently broken with our patches, and I'm not sure why. My best guess is that

  • it makes assumptions about internal Org functions that are no longer true,

If this is the case, we should simply warn them. We have no obligation to maintain backwards compatibility of undocumented features and behaviors. We might only do it when it is easy and does not stay on the way when implementing new features.

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