Bastien <b...@altern.org> writes: > We need to make `org-html--build-mathjax-config' depends on whether > there is an latex-fragment element in the parse tree. Otherwise, > including the MathJAX config is useless. > > I've been looking at this this morning. > > Is there an org-element function to test whether an element/object > of a certain type is present in the parse tree?
On course, it is `org-element-map' (you can have a look at its docstring, there is one such example). So, assuming you have access to communication channel (a.k.a. info argument): (org-element-map (plist-get info :parse-tree) '(latex-fragment latex-environment) 'identity info t) will be non-nil when either an exportable `latex-fragment' object or a `latex-environment' element is found within the parse tree. Regards, -- Nicolas Goaziou