From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: fold paragraphs, export only contents of a node, hiding the 'node heading text' Date: Sun, 1 Sep 2013 18:51:27 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGHQY-00018M-3q for emacs-orgmode@gnu.org; Sun, 01 Sep 2013 19:51:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGHQW-0004VC-Sr for emacs-orgmode@gnu.org; Sun, 01 Sep 2013 19:51:29 -0400 Received: from mail-ob0-x22c.google.com ([2607:f8b0:4003:c01::22c]:33015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGHQW-0004V6-Nt for emacs-orgmode@gnu.org; Sun, 01 Sep 2013 19:51:28 -0400 Received: by mail-ob0-f172.google.com with SMTP id er7so3848861obc.17 for ; Sun, 01 Sep 2013 16:51:27 -0700 (PDT) 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: ". ." Cc: "emacs-orgmode@gnu.org" On Sun, Sep 1, 2013 at 4:17 PM, . . wrote: > Hello: > > Is there a way to export to Latex the text under a heading but not-exporting/printing to the .tex file the heading/TODO (node line) itself? > > The idea is to be able to fold paragraphs (via node creation for the paragraphs under it). > But if I set the node to noexport (to hide the unnecessary heading/TODO text which was only there to allow folding the text under it) then the paragraph can't be exported either! > > This would be great to permit folding with great granularity and use the heading to describe the paragraph without showing it (like a comment only it folds!). > 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 In other words, you'd define a custom function like this: (defun mapcdi-org-latex-headline-function (todo todo-type priority text tags) "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 ":"))))) I think you'd just omit that "text" bit, and probably remove the other stuff to. 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: (defun mapcdi-org-latex-headline-function (todo todo-type priority text tags) "The docstring of my function." (concat (and todo (format "{}" todo)) (and priority (format "{} " )) (and tags (format "\\hfill{}\\textit{}" (mapconcat 'identity tags ":"))))) 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): (defun mapcdi-org-latex-headline-function (todo todo-type priority text tags) "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 ":"))))) 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). Anyway, hopefully this gets you on the right path! #+begin_src test-file #+bind: org-latex-format-headline-function mapcdi-org-latex-headline-function #+options: num:nil * todo headline 1 :test: blah blah blah. * headline 2 blah blah blah * headline 3 A couple of separate paragraphs to see how far apart two paragraphs would be normally. We'll add enough to line break just to make it interesting. A couple of separate paragraphs to see how far apart two paragraphs would be normally. We'll add enough to line break just to make it interesting. #+end_src Best regards, John > > Thanks, > Best regards, > Mark