Nicolas Goaziou <m...@nicolasgoaziou.fr> writes: > Hello, > > Eric Schulte <schulte.e...@gmail.com> writes: > >> In the function `org-export-resolve-fuzzy-link' at line 4078 of ox.el >> the `org-element-all-elements' variable is used to map over all elements >> in the parse tree when looking for a possible link target. However some >> trees hold valid backend-specific types which are not members of the >> `org-element-all-elements' variable (e.g., `latex-fragment'). This >> results in named targets not being resolved during export. > > I do not understand what you are trying to achieve. Line 4078 tries to > find elements with a #+NAME affiliated keyword in the parse tree. LaTeX > fragments cannot have such keywords. > > Maybe an example would help. >
Sure. I have added a function to org-export-filter-parse-tree-functions which replaces a custom keyword with either a latex-fragment or an HTML link wrapped in a paragraph depending on the export backend. The latex fragment basically has the following content, "\\begin{figure} \\centering \\input{%s} \\caption[%s]{\\label{%s}%s} \\end{figure}\n\n" and I assign it a :name property to match the label in the above. I then have links elsewhere in the file which reference this label. Is there a better way to achieve output like the above? If not I think an argument can be made that either (1) after filters have run assumptions about which types can support which properties are moot, or (2) there should be a way to have a filter insert a named chunk of backend-specific code. Thanks, Eric > > > Regards, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D (see https://u.fsf.org/yw)