From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Salome \=\?iso-8859-1\?Q\?S\=F6dergran"?= Subject: export to latex without labels Date: Sat, 19 Jul 2014 16:02:13 +0200 Message-ID: <21450.31333.840496.200548@gargle.gargle.HOWL> Reply-To: =?utf-8?Q?Salome_S=C3=B6dergran?= Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8VDV-0008R2-Gj for emacs-orgmode@gnu.org; Sat, 19 Jul 2014 10:02:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X8VDO-0005JR-G0 for emacs-orgmode@gnu.org; Sat, 19 Jul 2014 10:02:25 -0400 Received: from zhhdzmsp-smta18.bluewin.ch ([195.186.227.133]:58023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8VDO-0005J4-9P for emacs-orgmode@gnu.org; Sat, 19 Jul 2014 10:02:18 -0400 Received: from athen (188.60.116.75) by zhbdzmsp-smta11.bluewin.ch (8.5.142) (authenticated as jogi@bluewin.ch) id 51E5C44E1B2AE88E for emacs-orgmode@gnu.org; Sat, 19 Jul 2014 14:02:14 +0000 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hello experts, I've been fiddling around for a while now with the following problem: When I export something from org to latex I get plenty of \labels that I never refer to. I'd like to get rid of all those labels. I found some code [1] that uses a hook that does not work in orgmode anymore. So I tried to adapt that code to the new orgmode way with org-export-filter-final-functions: (defun ks/org-latex-remove-labels (backend info) "Remove labels generated by org-mode" (when (org-export-derived-backend-p backend 'latex) (let ((case-fold-search nil)) (goto-char 1) (replace-regexp "\\\\label{sec-[0-9][^}]*}" "") ))) (eval-after-load 'ox-latex '(add-to-list 'org-export-filter-final-output-functions 'ks/org-latex-remove-labels)) When I now try to export something from org to latex, I get the following error message: Wrong number of arguments: (lambda (backend) "Remove labels generated by org-mode" (if (org-export-derived-backend-p backend (quote latex)) (progn (let ((case-fold-search nil)) (goto-char 1) (replace-regexp "\\\\label{sec-[0-9][^}]*}" ""))))), 3 I am just an emacs user, not a programmer, and I have no idea what's wrong and what I have to change to make it work. Can anyone give me a hint? TIA, Salome [1] http://stackoverflow.com/questions/18076328/org-mode-export-to-latex-suppress-generation-of-labels