emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [new exporter] ignoring a headline on export to PDF via latex


From: Charles Berry
Subject: Re: [O] [new exporter] ignoring a headline on export to PDF via latex
Date: Tue, 5 Mar 2013 20:58:28 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Suvayu Ali <fatkasuvayu+linux <at> gmail.com> writes:

> 
> On Tue, Mar 05, 2013 at 01:25:03PM -0500, Nick Dokos wrote:
> > Eric S Fraga <e.fraga <at> ucl.ac.uk> wrote:
> > 
> > > Suvayu Ali <fatkasuvayu+linux <at> gmail.com> writes:
> > > 
> > > [...]
> > > 
> > > > Try using your function with a filter.  This filter might work:
> > > > org-export-filter-headline-functions.  Of course it goes without saying
> > > > you will have to update your function.
> > > 
> > > Thanks Suvayu.  It is this update that I need help with!  The
> > > documentation of that variable is close to impenetrable to me (e.g. what
> > > is a /communication channel/?).
> > > 
> > 
> > Reading the commentary in ox.el might help, at least to shed light on
> > some terminology.
> 
> As far as know, it is a property list returned by the parser.  Look in
> lisp/ox.el:1094.  Beyond that my understanding is also a bit hazy.  I
> think I have gone through that bit of the comments at least once, but it
> is a little difficult to follow for me (my lack of understanding of lisp
> is probably to blame :-p).

If you just want the latex to have "\section{}" you can do this


#+BEGIN_SRC emacs-lisp
  (defun org-latex-ignore-heading-filter-headline
    (headline backend info)
    "Strip headline from HEADLINE. Ignore BACKEND and INFO."
    (replace-regexp-in-string
     "^[\\]section\\[.*\\textsc{ignoreheading}}$"
     "\\section{}" headline nil t))
#+END_SRC

#+BEGIN_SRC emacs-lisp
  (require 'ox-latex)
  (org-export-define-derived-backend latex3 latex
    :filters-alist (
                    (:filter-headline . 
org-latex-ignore-heading-filter-headline))) 
#+END_SRC


then (org-export-to-buffer 'latex3 "a-buffer-name")

should do it.


The so-called 'headline' is actually a lot more than I would have thought.

If you use this filter instead:

#+BEGIN_SRC emacs-lisp
  (defun filter-headline-show
    (text back-end info)
    (format "<hdln>%s</hdln>" text))
#+END_SRC

you will see that the headline --- enclosed in 

   <hdln> .... <\hdln>

will typically contain within it an entire "section" (in exporter
`:filter-section' terms - not latex's \section{})

FWIW, I defun'ed filters like the above for all of the filter functions that can
take (text backend info) as arguments. Then using a derived backend like the
above `latex3', I can see where the filterable elements are. It is trivial to
do, but if anyone is interested, I can post or upload somewhere.

Chuck







reply via email to

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