From mboxrd@z Thu Jan 1 00:00:00 1970 From: asenal Subject: how to quote "#+end_src" string in a Babel block? Date: Wed, 24 Jul 2013 13:39:13 +0800 Message-ID: <65A347E6-F361-4410-93B6-CEA910195E7E@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1rni-0007uZ-9N for emacs-orgmode@gnu.org; Wed, 24 Jul 2013 01:39:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1rnd-0008Ry-MZ for emacs-orgmode@gnu.org; Wed, 24 Jul 2013 01:39:50 -0400 Received: from mail-pd0-x230.google.com ([2607:f8b0:400e:c02::230]:46252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1rnd-0008RG-FN for emacs-orgmode@gnu.org; Wed, 24 Jul 2013 01:39:45 -0400 Received: by mail-pd0-f176.google.com with SMTP id t12so8859611pdi.7 for ; Tue, 23 Jul 2013 22:39:43 -0700 (PDT) Received: from [172.16.16.127] ([58.60.109.77]) by mx.google.com with ESMTPSA id nv6sm45663685pbc.6.2013.07.23.22.39.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Jul 2013 22:39:42 -0700 (PDT) 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: emacs-orgmode@gnu.org Hi Guys I'm trying to do literature programming with org mode. My problem is How can I safely quote "#+XXX" inside a Babel-block? I found org-mode mismatch the outter "#+begin_src" with the first = "#+end_src" inside the block hence gives me a wrong parse. Here's an example: #+headers: :var varlist=3Dtop_iv #+begin_src python :return iv_template(varlist) def iv_template(varlist,db,table): for var in varlist: babel_template=3D''' #+name: var #+begin_src sqlite :db mydb SELECT colName,cnt,suc,fal,iv FROM mytable WHERE colName =3D=3D= %s'; #+end_src # org mode stop here! ''' % (var,var) print babel_template #+end_src I know it looks twisted,but what I really care is wheather org-mode = holds the capability to do so.