From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giacomo M Subject: Re: How to export to latex from command line? Date: Thu, 23 Jun 2016 19:42:15 +0200 Message-ID: References: <87a8ibna01.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG8dy-000299-U4 for emacs-orgmode@gnu.org; Thu, 23 Jun 2016 13:42:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bG8du-0002b4-NL for emacs-orgmode@gnu.org; Thu, 23 Jun 2016 13:42:22 -0400 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:36354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG8du-0002ay-GB for emacs-orgmode@gnu.org; Thu, 23 Jun 2016 13:42:18 -0400 Received: by mail-wm0-x22c.google.com with SMTP id f126so136123105wma.1 for ; Thu, 23 Jun 2016 10:42:18 -0700 (PDT) Received: from [127.0.0.1] ([212.189.161.135]) by smtp.gmail.com with ESMTPSA id o10sm1114223wjz.37.2016.06.23.10.42.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jun 2016 10:42:15 -0700 (PDT) In-Reply-To: <87a8ibna01.fsf@gmx.us> 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" To: emacs-orgmode@gnu.org Il 23/06/2016 18:30, Rasmus ha scritto: > hymie! writes: > >> In our last episode, the evil Dr. Lacto had captured our hero, >> Giacomo M , 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