Il 24/06/2016 11:11, Rasmus ha scritto:
Giacomo M <jackja...@gmail.com> 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