From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: seeking good practices for writing about org using org Date: Wed, 3 Aug 2016 19:15:52 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bV8CX-00057N-Qr for emacs-orgmode@gnu.org; Wed, 03 Aug 2016 22:16:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bV8CS-0008Kw-7C for emacs-orgmode@gnu.org; Wed, 03 Aug 2016 22:16:01 -0400 Received: from iport-acv2-out.ucsd.edu ([132.239.0.174]:31463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bV8CR-0008Kc-UU for emacs-orgmode@gnu.org; Wed, 03 Aug 2016 22:15:56 -0400 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" To: "Cook, Malcolm" Cc: "'emacs-orgmode@gnu.org'" On Wed, 3 Aug 2016, Cook, Malcolm wrote: > Hi, > > I am seeking good practices for writing about org using , erhm, well, > org itself. (doh!) > > I'd use these practices, for example, when writing examples of using > org, or lessons in using org, or bug reports about org. > > I reached of ob-org thinking this is what it was for, and wrote the > following > > --------------------------------------- (beginning of example) > Here is simple org book structure with chapters and a table of > contents at the end: > > #+BEGIN_SRC org :exports both :results value > > * chapter one > > Fa la la > > * chapter two > > La di di > > * table of contents > > #+TOC: > > #+END_SRC > --------------------------------------- (end of example) > > My dashed expectations were that when executed and exported, this would > produce a block of the org source, appropriately quoted, followed be the > RESULTS, being, well, the rendered org. > > Are your expectations the same as mine? > No. Run `M-x org-lint RET' and you will see that this is malformed. The org code needs to be escaped. > What do YOU do in such cases? Edit the src block in an edit buffer. You'll need to kill the contents of that src block first, then C-c ' to open the src edit buffer, then yank, then C-c ' again. The resulting buffer will be properly escaped. See (info "(org) Literal examples"), especially footnote 4. -- Then specify `:results replace' to override `:results silent' which `org-babel-default-header-args:org' sets. -- Then the export should be what you expect. HTH, Chuck