From mboxrd@z Thu Jan 1 00:00:00 1970 From: ". ." Subject: Re: fold paragraphs, export only contents of a node, hiding the 'node heading text' Date: Mon, 02 Sep 2013 18:00:11 +0200 Message-ID: References: Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGWYx-0004Kp-3a for emacs-orgmode@gnu.org; Mon, 02 Sep 2013 12:01:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGWYT-00057G-GV for emacs-orgmode@gnu.org; Mon, 02 Sep 2013 12:01:11 -0400 Received: from nk11p04mm-asmtp002.mac.com ([17.158.236.237]:50299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGWYT-000575-8X for emacs-orgmode@gnu.org; Mon, 02 Sep 2013 12:00:41 -0400 Received: from [10.36.72.141] (unknown [95.169.240.137]) by nk11p04mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-27.07(7.0.4.27.6) 64bit (built Jun 21 2013)) with ESMTPSA id <0MSI006D99SFBE90@nk11p04mm-asmtp002.mac.com> for emacs-orgmode@gnu.org; Mon, 02 Sep 2013 16:00:20 +0000 (GMT) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Hendy Cc: "emacs-orgmode@gnu.org" Thanks for your reply. Sorry, I don't know where you should put that code to create the custom func= tion! I put it inside .emacs, restarted Emacs, but after latex export the headline= s where visible in the resulting .tex/PDF. I did add the bind etc. to the test-file.org like you did. Regards, Mark El 02/09/2013, a las 01:51, John Hendy escribi=C3=B3: > On Sun, Sep 1, 2013 at 4:17 PM, . . wrote: >> Hello: >>=20 >> Is there a way to export to Latex the text under a heading but not-export= ing/printing to the .tex file the heading/TODO (node line) itself? >>=20 >> The idea is to be able to fold paragraphs (via node creation for the para= graphs under it). >> But if I set the node to noexport (to hide the unnecessary heading/TODO t= ext which was only there to allow folding the text under it) then the paragr= aph can't be exported either! >>=20 >> This would be great to permit folding with great granularity and use the h= eading to describe the paragraph without showing it (like a comment only it f= olds!). >=20 > I never did dig into this as it still was a bit above my head, but it > seems like this could do what you want: > - https://lists.gnu.org/archive/html/emacs-orgmode/2013-03/msg01329.html >=20 > In other words, you'd define a custom function like this: >=20 > (defun mapcdi-org-latex-headline-function (todo todo-type priority text ta= gs) > "The docstring of my function." > (concat > (and todo (format "{\\bfseries\\sffamily %s} " todo)) > (and priority (format "\\framebox{\\#%c} " priority)) > text > (and tags > (format "\\hfill{}\\textsc{%s}" (mapconcat 'identity tags ":"))))) >=20 >=20 > I think you'd just omit that "text" bit, and probably remove the other stu= ff to. >=20 > ETA: I just went ahead and gave it a whirl. It looks like this, or > something close, should let you do whatever you want with headlines > (go ahead and use priorities, tags, todo keywords, and the like and > still just get a blank headline: >=20 > (defun mapcdi-org-latex-headline-function (todo todo-type priority text ta= gs) > "The docstring of my function." > (concat > (and todo (format "{}" todo)) > (and priority (format "{} " )) >=20 > (and tags > (format "\\hfill{}\\textit{}" (mapconcat 'identity tags ":"))))) >=20 > There most likely is a blank line where the headline *would* go. I > played around with trying to \vspace a negative line space like so, > and I think it's doing the right thing, or is at least close (there's > less space between the contents line and the paragraph text): >=20 > (defun mapcdi-org-latex-headline-function (todo todo-type priority text ta= gs) > "The docstring of my function." > (concat > (and todo (format "{}" todo)) > (and priority (format "{} " )) > (and text (format "{\\vspace{-\\baselineskip}}" )) > (and tags > (format "\\hfill{}\\textit{}" (mapconcat 'identity tags ":"))))) >=20 > The only thing I noticed is that within a section, paragraphs by > default have no space and are indented (well, the first isn't, but > following paragraphs are). With this method, paragraphs within > sections are going to have the typical post-section spacing compared > to being treated like truly consecutive paragraphs. If you're okay > with that, then this will work. If not, you'll have to make a custom > latex template somehow so that the whole document is treated like one > long section. I'm not sure if that's possible given org's headline -> > section internals. You might be able to fiddle with something like the > above \vspace{} trick, though? You'd also have to have every paragraph > indented so that they weren't treated like the first paragraph in a > section (un-indented). >=20 > Anyway, hopefully this gets you on the right path! >=20 > #+begin_src test-file >=20 > #+bind: org-latex-format-headline-function mapcdi-org-latex-headline-funct= ion > #+options: num:nil >=20 > * todo headline 1 :test: >=20 > blah blah blah. >=20 > * headline 2 >=20 > blah blah blah >=20 > * headline 3 >=20 > A couple of separate paragraphs to see how far apart two paragraphs would b= e > normally. We'll add enough to line break just to make it interesting. >=20 > A couple of separate paragraphs to see how far apart two paragraphs would b= e > normally. We'll add enough to line break just to make it interesting. >=20 > #+end_src >=20 >=20 >=20 > Best regards, > John >=20 >=20 >=20 >>=20 >> Thanks, >> Best regards, >> Mark