From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-export-latex-final-hook not working Date: Fri, 24 Jun 2016 11:11:44 +0200 Message-ID: <87y45v7xyn.fsf@saiph.selenimh> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGN9Y-0005cX-NN for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:11:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGN9U-0001RB-HV for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:11:55 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:55412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGN9U-0001R0-Ab for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:11:52 -0400 In-Reply-To: (Giacomo M.'s message of "Fri, 24 Jun 2016 11:01: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" To: Giacomo M Cc: "emacs-orgmode@gnu.org" Hello, Giacomo M writes: > 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 > > to load the latest orgmode from melpa and install a hook to remove > unwanted section labels on latex export. > > If you open/create any .org file and export it to latex buffer or file, > the hook function is not called. if I visit the buffer and call > remove-orgmode-latex-labels, section labels are removed. > > Where is the mistake? There is no such thing as `org-export-latex-final-hook'. You may want to use `org-export-filter-final-output-functions'. Regards, -- Nicolas Goaziou