emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Myles English <mylesenglish@gmail.com>
To: mohamed <mohamed.hibti@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bibtex export
Date: Thu, 20 Dec 2012 14:31:22 +0000	[thread overview]
Message-ID: <87a9t8u75x.fsf@gmail.com> (raw)
In-Reply-To: <loom.20121220T110453-24@post.gmane.org>


mohamed writes:

> Myles,
> Thank you for this answer. 
> I tried it with 
> -------------------------------
> (add-to-list 'org-export-preprocess-hook
> 'my-export-delete-headlines-tagged-noheading)
> -------------------------------

Sorry, I should have said: add it to org-export-before-processing-hook,
so you use it like this:

#+begin_src emacs-lisp
(defun my-export-delete-headlines-tagged-noheading (backend)
  (dolist (hl (nreverse (org-element-map (org-element-parse-buffer 'headline)
                                         'headline
                                         'identity)))
    (when (member "noheading" (org-element-property :tags hl))
      (goto-char (org-element-property :begin hl))
      (delete-region (point) (progn (forward-line) (point))))))

(add-to-list 'org-export-before-processing-hook
             'my-export-delete-headlines-tagged-noheading)
#+end_src

Myles

>
>
> But I got some errors when exporting
>
> -----------------------------------------------------------------
> Exporting to LaTeX...  run-hooks: Wrong number of
> arguments: (lambda (backend) (dolist (hl (nreverse (org-element-map
> (org-element-parse-buffer (quote headline)) (quote headline) (quote identity))))
> (when (member "noheading" (org-element-property :tags hl)) (goto-char
> (org-element-property :begin hl)) (delete-region (point) (progn (forward-line)
> (point)))))), 0 (my-export-delete-headlines-tagged-noheading)
> -----------------------------------------------------------------
>
>
> I guess I have to use it in another way. My knowledge of lisp programming is
> very limited.
>
> Regards,
> Mohamed

  reply	other threads:[~2012-12-20 14:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-17 15:41 Bibtex export mohamed
2012-12-18 11:52 ` Bastien
2012-12-18 20:47   ` mohamed
2012-12-19 12:40     ` Myles English
2012-12-20 10:08       ` mohamed
2012-12-20 14:31         ` Myles English [this message]
2012-12-20 15:13           ` Mohamed HIBTI
2012-12-20 16:41             ` Bastien
2012-12-20 16:54             ` Myles English
2012-12-20 17:04               ` Mohamed HIBTI

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=87a9t8u75x.fsf@gmail.com \
    --to=mylesenglish@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mohamed.hibti@gmail.com \
    /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).