emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Shiyuan <gshy2014@gmail.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: org-latex filters
Date: Wed, 30 Jul 2014 00:12:31 -0700	[thread overview]
Message-ID: <CAOm4EMukETPeRJxDirPQO2nhUPA2UmLHG=XPxjdBDn9FXaU2Ug@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1612 bytes --]

Hi,
    I try to understand what the filter system is for and why the
transcoders itself doesn't suffice. So I take an example and want to see
how the filters are used in real exporter.  I look at ox-latex.el and try
to make sense of the filters

1. There are only two filters are used:

 :filters-alist '((:filter-options . org-latex-math-block-options-filter)
   (:filter-parse-tree . org-latex-math-block-tree-filter))

The purpose of org-latex-math-block-options-filter seems to be converting
whatever in the property list of :author, :date, :title  to strings of
latex commands(please correct me if I am wrong).  But what is the purpose
of org-latex-math-block-tree-filter? The org-latex--wrap-latex-math-block
is quite sophisticate and I don't get what it's doing.

-----------------------------------------------------
(defun org-latex-math-block-options-filter (info backend)
  (dolist (prop '(:author :date :title) info)
    (plist-put info prop
       (org-latex--wrap-latex-math-block (plist-get info prop) info))))
----------------------------------------------------
(defun org-latex-math-block-tree-filter (tree backend info)
  (org-latex--wrap-latex-math-block tree info))
----------------------------------------------------

2. For the filters of the form :filter-TYPE, there is also a transcoder for
processing the same TYPE. For example, for bold, there are :filter-bold,
but bold is also processed in the transcoder specified in the transcoder
alist when the backend is defined(by org-export-define-backend). When shall
we use a transcode and when shall we use a filter?

Thank you.

Shiyuan

[-- Attachment #2: Type: text/html, Size: 2151 bytes --]

             reply	other threads:[~2014-07-30  7:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  7:12 Shiyuan [this message]
2014-07-30 18:09 ` org-latex filters 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='CAOm4EMukETPeRJxDirPQO2nhUPA2UmLHG=XPxjdBDn9FXaU2Ug@mail.gmail.com' \
    --to=gshy2014@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).