emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Annotating org exporters


From: Sebastian Fischmeister
Subject: Re: [O] Annotating org exporters
Date: Wed, 11 May 2016 01:31:09 -0400

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 via email to

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