emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] how to handle backend-specific types as fuzzy link targets durin


From: Eric Schulte
Subject: Re: [O] how to handle backend-specific types as fuzzy link targets during export
Date: Tue, 24 Jun 2014 08:46:34 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

> Hello,
>
> Eric Schulte <address@hidden> 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)



reply via email to

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