emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Charles Berry <ccberry@ucsd.edu>
To: emacs-orgmode@gnu.org
Subject: Re: Controlling example block export?
Date: Tue, 1 Apr 2014 16:33:45 +0000 (UTC)	[thread overview]
Message-ID: <loom.20140401T175749-886@post.gmane.org> (raw)
In-Reply-To: CAK=ukcYqOcSDCudX3Yez7tgsv8fBgRVtHkoRGpGr8MZB96bDYA@mail.gmail.com

Heikki Lehvaslaiho <heikki.lehvaslaiho <at> gmail.com> writes:

> 
> 
> 
> I am using example blocks as inline notes where I paste snippets of 
> (pre-formatted) text. I'd like to  be able to control the exporting of 
> those block individually (per document would also be useful). I do not 
> seem to be able to find documentation about anything along those lines. 
> 
> 
> Here is a mock-up:
> 
> 
> #+BEGIN_EXAMPLE :exports none
> private notes...
> #+END_EXAMPLE
> 
> 

Advise or redefine the org-<backend>-example-block function to use
:switches to decide whether to skip an example block.

Something like this:

#+BEGIN_SRC emacs-lisp

  (defvar org-example-block-skip ":skip"
    "example block :switch to skip.")

  (defun org-latex-example-block (example-block contents info)
      "Transcode an EXAMPLE-BLOCK element from Org to LaTeX.
    CONTENTS is nil.  INFO is a plist holding contextual
    information."
      (when (and (org-string-nw-p 
                  (org-element-property :value example-block))
                 (not (string= 
                       org-example-block-skip 
                       (org-element-property :switches example-block))))
        (org-latex--wrap-label
         example-block
         (format "\\begin{verbatim}\n%s\\end{verbatim}"
                 (org-export-format-code-default 
                  example-block info)))))

#+END_SRC

> A bigger question is that while code blocks are well defined and well 
> documented, all other blocks are not. Is there somewhere a design 
> document the would give a logic of having different blocks and how they 
> are controlled? Maybe there is an other type of a block that does what I 
> want?
> 
> 
> The inline documentation in ox*.el files is too low level to be helpful.
> 

See also org-element.el and 
http://orgmode.org/worg/dev/org-export-reference.html

Looking at what (org-element-at-point) returns often helps.

Special blocks are another possibility, but will require some customization.

HTH,

Chuck

      parent reply	other threads:[~2014-04-01 16:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01  9:20 Controlling example block export? Heikki Lehvaslaiho
2014-04-01 10:10 ` Thorsten Jolitz
2014-04-01 12:40   ` Heikki Lehvaslaiho
2014-04-01 14:52     ` Thorsten Jolitz
2014-04-01 15:16       ` Thorsten Jolitz
2014-04-01 15:38     ` Nicolas Goaziou
2014-04-01 15:34 ` Nicolas Goaziou
2014-04-01 16:33 ` Charles Berry [this message]

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=loom.20140401T175749-886@post.gmane.org \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    /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).