emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: ". ." <mapcdi@me.com>
To: John Hendy <jw.hendy@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: fold paragraphs, export only contents of a node, hiding the 'node heading text'
Date: Mon, 02 Sep 2013 18:00:11 +0200	[thread overview]
Message-ID: <F995EAB1-5D9D-4025-A726-D30C2D109F99@me.com> (raw)
In-Reply-To: <CA+M2ft8Lk6jcg+=RDuXRq=1-ZFfY+52jt6WRJaeRQDWSvN3HtQ@mail.gmail.com>

Thanks for your reply.

Sorry, I don't know where you should put that code to create the custom function!
I put it inside .emacs, restarted Emacs, but after latex export the headlines 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 <jw.hendy@gmail.com> escribió:

> On Sun, Sep 1, 2013 at 4:17 PM, . . <mapcdi@me.com> 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

  reply	other threads:[~2013-09-02 16:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-01 21:17 fold paragraphs, export only contents of a node, hiding the 'node heading text' . .
2013-09-01 23:51 ` John Hendy
2013-09-02 16:00   ` . . [this message]
     [not found]     ` <CA+M2ft8GPHzEierLmMpJQxtRv=iLQ=dfXXFaqguZmOXi4ykk6A@mail.gmail.com>
     [not found]       ` <C7F63B6F-D5C7-49D5-A7EE-4F0082882901@me.com>
2013-09-03  1:32         ` John Hendy
     [not found]           ` <4702F1A4-113B-4171-B949-2B9EE14EEAA9@me.com>
2013-09-03 14:48             ` mapcdi
2013-09-03 19:17               ` John Hendy
2013-09-04  0:20                 ` mapcdi
2013-09-03 19:10             ` John Hendy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F995EAB1-5D9D-4025-A726-D30C2D109F99@me.com \
    --to=mapcdi@me.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jw.hendy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).