[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] export to latex without labels
From: |
Salome \=\?iso-8859-1\?Q\?S\=F6dergran |
Subject: |
[O] export to latex without labels |
Date: |
Sat, 19 Jul 2014 16:02:13 +0200 |
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
- [O] export to latex without labels,
Salome \=\?iso-8859-1\?Q\?S\=F6dergran <=