From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: org-export-preprocess-hook and the new exporter Date: Mon, 28 May 2012 12:44:03 -1000 Message-ID: References: <87aa1dz2b5.fsf@berkeley.edu> <12014.1337130931@aristotle> <87likry1lz.fsf_-_@ucl.ac.uk> <87k4093iog.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZ8fi-000725-AE for emacs-orgmode@gnu.org; Mon, 28 May 2012 18:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SZ8ff-0001k2-T3 for emacs-orgmode@gnu.org; Mon, 28 May 2012 18:44:17 -0400 Received: from oproxy7-pub.bluehost.com ([67.222.55.9]:33386) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SZ8ff-0001j1-J6 for emacs-orgmode@gnu.org; Mon, 28 May 2012 18:44:15 -0400 In-Reply-To: <87k4093iog.fsf@gmail.com> (Nicolas Goaziou's message of "Fri, 18 May 2012 12:08:47 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: Richard Lawrence , emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Eric S Fraga 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 Aloha Nicolas, Has org-e-latex-translate-table gone away? I get: Symbol's value as variable is void: org-e-latex-translate-table I tried grepping the source code for it, but came up empty there, too. All the best, Tom > > 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, -- Thomas S. Dye http://www.tsdye.com