emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Richard Lawrence <richard.lawrence@berkeley.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-export-preprocess-hook and the new exporter (was Re: Using Org for a dissertation)
Date: Fri, 18 May 2012 12:08:47 +0200	[thread overview]
Message-ID: <87k4093iog.fsf@gmail.com> (raw)
In-Reply-To: <87likry1lz.fsf_-_@ucl.ac.uk> (Eric S. Fraga's message of "Thu, 17 May 2012 12:07:12 +0930")

Hello,

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> This is probably more for Nicolas... and apologies for hijacking the
> thread slightly!
>
> I was intrigued by the comment above regarding the ignoreheading
> tag.  Sounded just like what I needed.  However, it doesn't do anything
> with org /out-of-the-box/.  A little searching led to Suvayu's posting
> in stackoverflow [1] and that does the job nicely, but only for the
> standard (read: old) export engine.
>
> The question is: is there an equivalent hook for the new exporter?

For heavy structure modifications (like headlines removal), there is
`org-export-before-parsing-hook' and the dynamically bound variable
`org-export-current-backend'.

Another way to solve the problem could be to implement your own headline
parser:

#+BEGIN_SRC emacs-lisp
(defun my-e-latex-headline (headline contents info)
  (if (member "ignoreheading" (org-element-property :tags headline)) contents
    (org-e-latex-headline headline contents info)))
#+END_SRC

Then you can either install it in the current `e-latex' back-end:

#+BEGIN_SRC emacs-lisp
(add-to-list 'org-e-latex-translate-table '(headline . my-e-latex-headline))
#+END_SRC

Or you can define your own back-end for this purpose:

#+BEGIN_SRC emacs-lisp
(org-export-define-derived-backend dissertation e-latex
  :translate-alist ((template . my-e-latex-headline)))

(defun org-dissertation-export-to-pdf
  (&optional subtreep visible-only body-only ext-plist pub-dir)
  (interactive)
  (org-e-latex-compile
   (let ((outfile (org-export-output-file-name ".tex" subtreep pub-dir)))
     (org-export-to-file
      'dissertation outfile subtreep visible-only body-only ext-plist))))
#+END_SRC

You need a recent Org version to do this, though.


Regards,

-- 
Nicolas Goaziou

  parent reply	other threads:[~2012-05-18 10:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-12 18:23 Using Org for a dissertation Richard Lawrence
2012-05-12 16:49 ` Eric Schulte
2012-05-15  5:02   ` Richard Lawrence
2012-06-14 12:39   ` Rasmus
2012-06-14 16:13     ` Eric S Fraga
2012-05-12 19:27 ` Thomas S. Dye
2012-05-15  5:16   ` Richard Lawrence
2012-05-15 17:08     ` Nicolas Goaziou
2012-05-16  0:38       ` Richard Lawrence
2012-05-21  3:56       ` New exporter [was: Re: Using Org for a dissertation] François Pinard
2012-05-21 17:54         ` Nicolas Goaziou
2012-05-21 19:10           ` François Pinard
2012-05-23  0:35             ` François Pinard
2012-05-12 20:29 ` Using Org for a dissertation Peter Münster
2012-05-15 12:26 ` suvayu ali
2012-05-16  1:15   ` Richard Lawrence
2012-05-17  2:37     ` org-export-preprocess-hook and the new exporter (was Re: Using Org for a dissertation) Eric S Fraga
2012-05-18  6:49       ` Bastien
2012-05-18 10:08       ` Nicolas Goaziou [this message]
2012-05-20  6:12         ` Eric Fraga
2012-05-20  8:03           ` Nicolas Goaziou
2012-05-28 22:44         ` org-export-preprocess-hook and the new exporter Thomas S. Dye
2012-05-29  1:37           ` Eric S Fraga
2012-05-29  3:20             ` Thomas S. Dye
2012-05-21 13:21 ` Using Org for a dissertation Matt Lundin

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=87k4093iog.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --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).