From mboxrd@z Thu Jan 1 00:00:00 1970 From: Indraneel Majumdar Subject: Re: Re: Omit top level heading in latex export? Date: Sun, 03 Oct 2010 23:48:05 +0530 Message-ID: <4CA8C8DD.2040608@indraneel.info> References: <4CA885BA.8050906@indraneel.info> <4CA8A1DD.1010301@indraneel.info> <87pqvrp6c4.fsf@fastmail.fm> <4CA8BE0D.1000103@indraneel.info> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=45021 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P2T83-0005go-ST for emacs-orgmode@gnu.org; Sun, 03 Oct 2010 14:17:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P2T82-0006Wm-Bx for emacs-orgmode@gnu.org; Sun, 03 Oct 2010 14:17:43 -0400 Received: from mailout07.yourhostingaccount.com ([65.254.253.62]:33797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P2T82-0006Wc-8c for emacs-orgmode@gnu.org; Sun, 03 Oct 2010 14:17:42 -0400 Received: from mailscan08.yourhostingaccount.com ([10.1.15.8] helo=mailscan08.yourhostingaccount.com) by mailout07.yourhostingaccount.com with esmtp (Exim) id 1P2T81-0000a1-Ml for emacs-orgmode@gnu.org; Sun, 03 Oct 2010 14:17:41 -0400 Received: from impout03.yourhostingaccount.com ([10.1.55.3] helo=impout03.yourhostingaccount.com) by mailscan08.yourhostingaccount.com with esmtp (Exim) id 1P2T81-0004hh-IT for emacs-orgmode@gnu.org; Sun, 03 Oct 2010 14:17:41 -0400 Received: from [59.93.192.229] (helo=[192.168.2.2]) by authsmtp03.yourhostingaccount.com with esmtpa (Exim) id 1P2T80-0007au-NT for emacs-orgmode@gnu.org; Sun, 03 Oct 2010 14:17:41 -0400 In-Reply-To: <4CA8BE0D.1000103@indraneel.info> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: orgmode I fixed my lisp. Just to archive the solution, here's my new defun: (defun regex-replace (regex string) (point-to-register 'rrr) (goto-char (point-min)) (while (re-search-forward regex nil t) (replace-match string)) (jump-to-register 'rrr)) On 2010-10-03 23:01, Indraneel Majumdar wrote: > Thanks Matt and Suvayu, > > I messed up with my lisp and that was causing the error. So now I have > another problem, how to fix the lisp code... > > I'm using a org export hook to make all targets invisible by a regex > replace. This is probably messing up the selection, so what do I do to > not lose the selected text till the exporter takes over (or probably > not tamper with the selection or something)? I don't know any lisp. > > (defun regex-replace (regex string) > (goto-char (point-min)) > (while (re-search-forward regex nil t) > (replace-match string))) > > (defun invisibletag() > "Make all targets invisible" > (regex-replace "\\(<<.+?>>\\) " "\\1(INVISIBLE) ") > ) > (add-hook 'org-export-first-hook 'invisibletag) > > > Indraneel > > On 2010-10-03 22:21, Matt Lundin wrote: >> Indraneel Majumdar writes: >> >>> On 2010-10-03 20:57, suvayu ali wrote: >>>> On 3 October 2010 06:31, Indraneel >>>> Majumdar wrote: >>>>> Hi, >>>>> >>>>> I'm running into a problem with latex export. I have several >>>>> essays under a >>>>> top level heading "Essays". How can I export say only one essay >>>>> without the >>>>> top level heading "Essays" also showing up in the output as a >>>>> "Section"? I >>>>> want the heading of my essay to be displayed as a latex section. >>>>> Is this >>>>> possible in any simple way? The manual describes some option to >>>>> define my >>>>> own class in the .emacs file, but I couldn't understand that very >>>>> well. >>>>> eg. >>>>> >>>>> * Essays >>>>> ** Essay One >>>>> ** Essay Two >>>>> >>>>> I want to export only "Essay Two" (eg with a :export: tag) and >>>>> don't want >>>>> "Essays" to show up. >>>>> >>>> What about just exporting the subtree you want? I believe the way to >>>> do that is to go to the subtree and while exporting limit the export >>>> with `1'. Hope this helps. >>>> >>> Yes, that exports the subtree (Essay Two) and also exports "Essays" >>> (but not "Essay One"). I do not want "Essays" to show up at all. >> I cannot replicate this. Take the following subtree: >> >> --8<---------------cut here---------------start------------->8--- >> * Essays >> ** Essay One >> Some text. >> ** Essay Two >> Some special text. >> --8<---------------cut here---------------end--------------->8--- >> >> With the latest org from git, if I press "C-c C-e 1 h" while the cursor >> is on (or under) the Essay Two headline, the html output looks like >> this: >> >> --8<---------------cut here---------------start------------->8--- >> Essay Two >> >> Some special text. >> >> Author: Matt Lundin >> >> Date: 2010-10-03 12:47:58 EDT >> >> HTML generated by org-mode 7.01trans in emacs 24 >> --8<---------------cut here---------------end--------------->8--- >> >> Best, >> Matt >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode >