From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Girard Subject: Re: org-babel-tangle tangles too much ! Date: Tue, 1 Dec 2009 18:55:20 +0100 Message-ID: <51b0095d0912010955i5d93b3e2lbf17369048556970@mail.gmail.com> References: <51b0095d0912010654y32b109b1hb3795e86cf6e0416@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFWwg-0004jF-LB for emacs-orgmode@gnu.org; Tue, 01 Dec 2009 12:55:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFWwc-0004gB-Q6 for emacs-orgmode@gnu.org; Tue, 01 Dec 2009 12:55:26 -0500 Received: from [199.232.76.173] (port=41105 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFWwc-0004g1-GD for emacs-orgmode@gnu.org; Tue, 01 Dec 2009 12:55:22 -0500 Received: from mail-fx0-f213.google.com ([209.85.220.213]:41620) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFWwb-0005Ii-Qa for emacs-orgmode@gnu.org; Tue, 01 Dec 2009 12:55:22 -0500 Received: by fxm5 with SMTP id 5so4892717fxm.8 for ; Tue, 01 Dec 2009 09:55:21 -0800 (PST) In-Reply-To: <51b0095d0912010654y32b109b1hb3795e86cf6e0416@mail.gmail.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 On Tue, 01 Dec 2009 05:43:38 -1000, Thomas S. Dye wrote : > > Your code snippet doesn't tangle at all here. Perhaps you have a > setting somewhere that has an effect on tangling? > I'm intending my file (username.org) to be processed by Eric's emacs-starter-kit during init (via org-babel-load-file I guess). As none of the other starter-kit.org seemed to bother with ":tangle yes" I didn't either. On Tue, 01 Dec 2009 11:26:28 -0500, Dan Davison wrote : > > Note that all header arguments (including :tangle) get appended to > the #+begin_src line and *not* to the #+srcname line, although it is > an easy mistake to make. Sure, I've been mistaken while posting my message but havent when performing my tests. You're right that it's quite error prone. On Tue, 01 Dec 2009 08:53:37 -0700, Eric Schulte wrote : > #+srcname: b > #+begin_src emacs-lisp :noweb no I'm afraid I don't understand the meaning of the "noweb" option here, or elsewhere in threads about org-babel. On [1] it can be read that "the org-babel-tangle function (...) makes use of Noweb reference syntax for tangling of code files" ; what it means to me is that org-babel-tangle borrowed noweb's syntax but is completely independant from it, am I wrong ? [1] http://orgmode.org/worg/org-contrib/babel/org-babel.php#literate-programming > If you can make a good case for why the behavior you describe should be > supported then we could try to add it behind something like a > (...) > header argument, but at first blush the option seems to present too much > opportunity for confusion. Maybe I'm missing something. I for sure must also be missing something ; hopefully the following example will get things clarified to both of us: Using your emacs-starter-kit, here's an excerpt of how I would like my username.org to look like: #---- begin username.org * Publishing ** Default headers and document class As for the default headers, the associated variable is =org-export-latex-classes=. I choose to change its contents rather than appending to it # #+begin_src emacs-lisp (setq org-export-latex-classes '( <> <> )) #+end_src *** Configuration for the =memoir= class #+srcname: org-export-memoir #+begin_src emacs-lisp ("memoir" "<>" <>) #+end_src #+srcname: latex_header_memoir #+begin_src emacs-lisp \\documentclass[article,a4paper]{memoir} <> <> <> #+end_src =memoir='s article option do not behave correctly with sections. Let's correct this: # #+srcname: memoir_correct_article #+begin_src emacs-lisp \\let\\subsubsection\\subsection \\let\\subsection\\section \\let\\section\\chapter #+end_src # #+srcname: memoir_bug_chapapp #+begin_src emacs-lisp \\makeatletter \\renewcommand{\\@chapapp}{} \\makeatother #+end_src *** Configuration for the =scrartcl= class I've been using =memoir= for quite a long time ; but =scrartcl= is now my default class # #+begin_src emacs-lisp (setq org-export-latex-default-class "article") #+end_src # #+srcname: org-export-scrartcl #+begin_src emacs-lisp ("article" "\\documentclass{scrartcl} <> " <> ) #+end_src *** Common configuration #+srcname: latex_header_common #+begin_src emacs-lisp \\usepackage{tikz} \\RequirePackage{graphicx} \\DeclareGraphicsExtensions{.pdf,.png,.jpg,.ps,.eps} \\RequirePackage[T1]{fontenc} <> <> <> #+end_src (... and so on) #---- end username.org I expect both - C-c C-e p to export username.org to username.pdf (this works already), and - org-babel-tangle to generate a proper username.el (broken yet because code chunks get written twice). Is my example clear enough ? Cheers, Nicolas