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:33:45 +0200 Message-ID: <87h9cj7wxy.fsf@saiph.selenimh> References: <87ziqbhryk.fsf@gmx.us> <240d9e6b-415a-6c36-d84d-55fd3cdee874@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNUu-0005l9-Hp for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:34:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGNUo-00078a-KF for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:33:59 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:57490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNUo-000781-E7 for emacs-orgmode@gnu.org; Fri, 24 Jun 2016 05:33:54 -0400 In-Reply-To: <240d9e6b-415a-6c36-d84d-55fd3cdee874@gmail.com> (Giacomo M.'s message of "Fri, 24 Jun 2016 11:22:28 +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 Giacomo M writes: > 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))) FWIW, I suggest (when (org-export-derived-backend-p backend 'latex) (replace-regexp-in-string "\\\\label{sec:.*?}" "" string))) A greedy regexp may give you surprises. Regards,