emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: how to handle backend-specific types as fuzzy link targets during export
Date: Tue, 24 Jun 2014 08:46:34 -0400	[thread overview]
Message-ID: <87d2dyeaqd.fsf@gmail.com> (raw)
In-Reply-To: <87ha3aldw3.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Tue, 24 Jun 2014 13:56:28 +0200")

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Eric Schulte <schulte.eric@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)

  reply	other threads:[~2014-06-24 12:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 10:59 how to handle backend-specific types as fuzzy link targets during export Eric Schulte
2014-06-24 11:56 ` Nicolas Goaziou
2014-06-24 12:46   ` Eric Schulte [this message]
2014-06-24 13:08     ` Nicolas Goaziou
2014-06-24 13:30       ` Eric Schulte
2014-06-24 15:28         ` Nicolas Goaziou
2014-06-30 16:37           ` Eric Schulte
2014-06-30 20:29             ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d2dyeaqd.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).