emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sebastian Fischmeister <sfischme@uwaterloo.ca>
To: Richard Lawrence <richard.lawrence@berkeley.edu>, emacs-orgmode@gnu.org
Subject: Re: Annotating org exporters
Date: Wed, 11 May 2016 01:31:09 -0400	[thread overview]
Message-ID: <874ma5qivl.fsf@uwaterloo.ca> (raw)
In-Reply-To: <87lh3indnl.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me>

Hi Richard,

> There's an example of how to do something like this in the "Advanced
> Configuration" section of the Export section in the manual.  Maybe you
> could adapt it like this?
>
>      (defun my-latex-filter-rightarrow (text backend info)
>        (when (org-export-derived-backend-p backend 'latex)
>              (replace-regexp-in-string "=>" "$\rightarrow$" text)))
>
>      (add-to-list 'org-export-filter-plain-text-functions
>                   'my-latex-filter-rightarrow)

That works very well. Thank you very much. The only adjustment is to set
LITERAL to non-nil for replace-regexp-in-string and use double backslash.

     (defun my-latex-filter-rightarrow (text backend info)
       (when (org-export-derived-backend-p backend 'latex)
             (replace-regexp-in-string "=>" "$\\rightarrow$" text nil t)))


I'm still undecided between a regex replace and org-entities. Is there
a straightforward way to define own directives for orgmode to then
support something like the following?

#+LaTeX_EXPORT: "=>":"$\rightarrow$"

or more generic

#+EXPORT_EXPAND: latex:"=>":"$\rightarrow$"

Then I could just make these expansions part of the standard header in
my org files.

  Sebastian

  reply	other threads:[~2016-05-11  5:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 13:56 Annotating org exporters Sebastian Fischmeister
2016-05-10 15:04 ` Rainer M Krug
2016-05-10 15:19 ` Richard Lawrence
2016-05-11  5:31   ` Sebastian Fischmeister [this message]
2016-05-11 15:01     ` Richard Lawrence
2016-05-10 15:55 ` Rasmus
2016-05-10 18:10   ` Rainer M Krug
2016-05-10 22:29     ` Rasmus
2016-05-11  5:31   ` Sebastian Fischmeister
2016-05-11  9:49     ` Rasmus

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=874ma5qivl.fsf@uwaterloo.ca \
    --to=sfischme@uwaterloo.ca \
    --cc=emacs-orgmode@gnu.org \
    --cc=richard.lawrence@berkeley.edu \
    /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).