From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: org mode latex export excude title Date: Fri, 30 Dec 2016 09:26:01 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cN0wS-0006pf-Bi for emacs-orgmode@gnu.org; Fri, 30 Dec 2016 12:26:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cN0wP-0005kF-8U for emacs-orgmode@gnu.org; Fri, 30 Dec 2016 12:26:08 -0500 Received: from iport-bcv1-out.ucsd.edu ([132.239.0.119]:32178) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1cN0wO-0005jV-S2 for emacs-orgmode@gnu.org; Fri, 30 Dec 2016 12:26:05 -0500 In-Reply-To: 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: Fanpeng Kong Cc: emacs-orgmode@gnu.org On Fri, 30 Dec 2016, Fanpeng Kong wrote: > I am trying to use org mode to write a paper. The latex template of the > journal restricts the location of `\title{}` command to be after the > `\begin{document}`. While by leaving `#+TITLE:` empty and specify > `#+OPTIONS: title:nil` in my org file, I can remove the `\maketitle` command in the > latex export. However, and empty title `\title{}` is still exported > prior to the `\begin{document}`. And it causes problem for the template > I am using. > > Following is an minimal example of the org mode latex export. Is there > any way to excude the empty `\title{}` command? [example deleted] > Any suggestion will be appreciated. And of course, Happy New Year! Use a filter to comment it out: #+OPTIONS: title:nil toc:nil #+BIND: org-export-filter-final-output-functions (comment-out-title-line) #+BEGIN_SRC emacs-lisp :exports results :results none (defun comment-out-title-line (doc &optional bk info) (replace-regexp-in-string "\\\\title" "%% \\title" doc nil t )) (setq-local org-export-allow-bind-keywords t) #+END_SRC * section 1 ... HTH, Chuck