Il 23/06/2016 18:30, Rasmus ha scritto:
hymie! <hy...@lactose.homelinux.net> writes:
In our last episode, the evil Dr. Lacto had captured our hero,
Giacomo M <jackja...@gmail.com>, who said:
Dear all,
I would like to export an org file to either tex or pdf from bash.
I have been using this:
${EMACS} $filename -f org-html-export-to-html -f kill-emacs
There are similar functions org-latex-export-to-pdf and
org-latex-export-to-latex.
I use,
emacs --batch --no-init-file --load EXPORT-CONFIG.el --find-file
EXPORT_FILE.org --funcall org-export-to-FORMAT
I don't think org does plain TeX; I'd be thrilled if it does.
I haven't seen a plain TeX backend.
Thanks.
I'm not able to run a final hook (also not in batch).
Where am I wrong?
#+BEGIN_SRC emacs-lisp
(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
Best,
Giacomo