From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Branigan Subject: Re: Using noweb with org-mode source Date: Wed, 5 Jan 2011 20:38:04 -0330 Message-ID: References: <4D24D1F7.1050307@christianmoe.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1317753780==" Return-path: Received: from [140.186.70.92] (port=32838 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PadOk-0002oz-1m for emacs-orgmode@gnu.org; Wed, 05 Jan 2011 19:08:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PadOi-0007aR-2j for emacs-orgmode@gnu.org; Wed, 05 Jan 2011 19:08:09 -0500 Received: from mail-ey0-f169.google.com ([209.85.215.169]:48641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PadOh-0007aH-L7 for emacs-orgmode@gnu.org; Wed, 05 Jan 2011 19:08:07 -0500 Received: by eyh6 with SMTP id 6so3879089eyh.0 for ; Wed, 05 Jan 2011 16:08:06 -0800 (PST) In-Reply-To: <4D24D1F7.1050307@christianmoe.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============1317753780== Content-Type: multipart/alternative; boundary=0015174beea4b309f80499224bf9 --0015174beea4b309f80499224bf9 Content-Type: text/plain; charset=ISO-8859-1 Thanks, Suvaya and Christian, Unfortunately, neither of these two suggestions really does what I had hoped. Using INCLUDE files will certainly allow me to reuse my text and export to different documents, but at the cost of cluttering up my directories with a bunch of files which have no other purpose. And the syntax proposed by Christian produces verbatim copies of the org-mode source, instead of allowing me to export the same text at different points in the document. I can achieve what I want already to some extent by using org-tables and the like to generate latex code in a src block. But this obviously doesn't offer a general export solution to other formats, and it's a clunky way of working. It may be that the noweb syntax can't accomodate the kind of src-export-reuse that I'm looking for. - Phil Branigan On Wed, Jan 5, 2011 at 4:47 PM, Christian Moe wrote: > Hi, > > This should get you part of the way: Use `org' as the language name, not > `org-mode'. Enclose the noweb reference in another src block with noweb > explicitly turned on. Reworked example follows. > > I can't seem to get rid of the code block around it, though, however I play > with the header arguments. > > Yours, > Christian > > > > * One section, exported to a particular document > > #+srcname: primates > #+begin_src org > ,- chimps :: strong, smart and savage > > ,- bonobos :: less savage, sexy, smart > ,- orangutans :: kinda asocial, with big arms > ,- gorillas :: really strong, but shy > #+end_src > > Lots of text here. > > * Another section, exported to a different document > > Let's review what we know about the primate group. > > #+begin_src org :noweb yes > <> > #+end_src > > > On 1/5/11 6:59 PM, Phil Branigan wrote: > >> In making up lecture and teaching materials, I would find it useful to >> be able to use noweb references to replicate blocks of org-mode text >> directly, rather than source code from latex or another language. But >> org-mode isn't one of the babel-supported languages. Can anyone >> suggest a tricky way to achieve this result? >> >> What I have in mind is something like the following: >> >> * One section, exported to a particular document >> >> #+srcname: primates >> #+begin_src org-mode >> - chimps :: strong, smart and savage >> - bonobos :: less savage, sexy, smart >> - orangutans :: kinda asocial, with big arms >> - gorillas :: really strong, but shy >> #+end_src >> >> Lots of text here. >> >> * Another section, exported to a different document >> >> Let's review what we know about the primate group. >> >> <> >> >> >> -- >> Phil Branigan >> >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >> > > -- Phil Branigan -------------------- Associate Professor Department of Linguistics Memorial University of Newfoundland St. John's, NL, A1B 3X9 Tel. (709) 737-8134 Fax (709) 737-4000 --0015174beea4b309f80499224bf9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks, Suvaya and Christian, =A0Unfortunately, neither of these two sugges= tions really does what I had hoped. =A0Using INCLUDE files will certainly a= llow me to reuse my text and export to different documents, but at the cost= of cluttering up my directories with a bunch of files which have no other = purpose. =A0And the syntax proposed by Christian produces verbatim copies o= f the org-mode source, instead of allowing me to export the same text at di= fferent points in the document. =A0

I can achieve what I want already to some extent by using or= g-tables and the like to generate latex code in a src block. =A0But this ob= viously doesn't offer a general export solution to other formats, and i= t's a clunky way of working. =A0It may be that the noweb syntax can'= ;t accomodate the kind of src-export-reuse that I'm looking for. =A0

- Phil Branigan

On We= d, Jan 5, 2011 at 4:47 PM, Christian Moe <mail@christianmoe.com> wrote:
Hi,

This should get you part of the way: Use `org' as the language name, no= t `org-mode'. Enclose the noweb reference in another src block with now= eb explicitly turned on. Reworked example follows.

I can't seem to get rid of the code block around it, though, however I = play with the header arguments.

Yours,
Christian



* One section, exported to a particular document

#+srcname: primates
#+begin_src org
=A0,- chimps :: strong, smart and savage

=A0,- bonobos :: less savage, sexy, smart
=A0,- orangutans :: kinda asocial, with big arms
=A0,- gorillas :: really strong, but shy
#+end_src

Lots of text here.

* Another section, exported to a different document

Let's review what we know about the primate group.

#+begin_src org :noweb yes
<<primates>>
#+end_src


On 1/5/11 6:59 PM, Phil Branigan wrote:
In making up lecture and teaching materials, I would find it useful to
be able to use noweb references to replicate blocks of org-mode text
directly, rather than source code from latex or another language. =A0But org-mode isn't one of the babel-supported languages. =A0Can anyone
suggest a tricky way to achieve this result?

What I have in mind is something like the following:

* One section, exported to a particular document

#+srcname: primates
#+begin_src org-mode
=A0 - chimps :: strong, smart and savage
=A0 - bonobos :: less savage, sexy, smart
=A0 - orangutans :: kinda asocial, with big arms
=A0 - gorillas :: really strong, but shy
#+end_src

Lots of text here.

* Another section, exported to a different document

Let's review what we know about the primate group.

<<primates>>


--
Phil Branigan



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gn= u.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode




--
Phil Branigan
------= --------------
Associate Professor
Department of Linguistics
Memor= ial University of Newfoundland
St. John's, NL,=A0 A1B 3X9
Tel. (7= 09) 737-8134
Fax (709) 737-4000
--0015174beea4b309f80499224bf9-- --===============1317753780== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1317753780==--