From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: how to handle backend-specific types as fuzzy link targets during export Date: Tue, 24 Jun 2014 08:46:34 -0400 Message-ID: <87d2dyeaqd.fsf@gmail.com> References: <87pphyefo6.fsf@gmail.com> <87ha3aldw3.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzQ87-0006d9-Nx for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 08:47:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzQ83-0002Zk-CL for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 08:47:19 -0400 Received: from mail-qc0-x235.google.com ([2607:f8b0:400d:c01::235]:38830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzQ83-0002Zf-7o for emacs-orgmode@gnu.org; Tue, 24 Jun 2014 08:47:15 -0400 Received: by mail-qc0-f181.google.com with SMTP id x13so196187qcv.40 for ; Tue, 24 Jun 2014 05:47:14 -0700 (PDT) In-Reply-To: <87ha3aldw3.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Tue, 24 Jun 2014 13:56:28 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Org Mode Mailing List Nicolas Goaziou writes: > Hello, > > Eric Schulte 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)