emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-export-latex-final-hook not working


From: Giacomo M
Subject: Re: [O] org-export-latex-final-hook not working
Date: Fri, 24 Jun 2016 11:22:28 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

Il 24/06/2016 11:11, Rasmus ha scritto:
Giacomo M <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]