From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giacomo M Subject: Re: org-export-latex-final-hook not working Date: Fri, 24 Jun 2016 11:22:28 +0200 Message-ID: <240d9e6b-415a-6c36-d84d-55fd3cdee874@gmail.com> References: <87ziqbhryk.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNJp-0003y2-SX for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:22:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGNJm-0004MT-NB for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:22:33 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:38516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNJm-0004MH-GM for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:22:30 -0400 Received: by mail-wm0-x235.google.com with SMTP id r201so17000294wme.1 for ; Fri, 24 Jun 2016 02:22:30 -0700 (PDT) Received: from [127.0.0.1] ([212.189.161.135]) by smtp.gmail.com with ESMTPSA id 12sm2169831wmj.19.2016.06.24.02.22.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 02:22:29 -0700 (PDT) In-Reply-To: <87ziqbhryk.fsf@gmx.us> 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" To: emacs-orgmode@gnu.org Il 24/06/2016 11:11, Rasmus ha scritto: > Giacomo M writes: > > > >> Dear all, >> >> I am using emacs with this configuration file: >> >> #+BEGIN_SRC emacs-lisp >> (setq load-path (append (file-expand-wildcards "~/.emacs.d/elpa/*") load-path)) >> (require 'org) >> (require 'org-ref) >> (require 'ox-extra) >> (ox-extras-activate '(ignore-headlines)) >> (defun remove-orgmode-latex-labels () >> "Remove labels generated by org-mode" >> (interactive) >> (let ((case-fold-search nil)) >> (goto-char 1) >> (replace-regexp "\\\\label{sec.*}" "") >> ) >> ) >> (add-hook 'org-export-latex-final-hook 'remove-orgmode-latex-labels) >> #+END_SRC > There's no such hook. > > See org-export-filter-body-functions and > org-export-filter-final-output-functions. > Thanks. I found an example for html by Rasmus on the mailing list. Just adapting it to my case works. #+BEGIN_SRC emacs-lisp (defun jackjackk/org-latex-remove-section-labels (string backend info) "Remove section labels generated by org-mode" (when (and (org-export-derived-backend-p backend 'latex) (string-match "\\\\label{sec:.*}" string)) (replace-regexp-in-string "\\\\label{sec:.*}" "" string))) (add-to-list 'org-export-filter-final-output-functions 'jackjackk/org-latex-remove-section-labels) #+END_SRC Best, Giacomo