From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] References to variable block names Date: Wed, 12 Jan 2011 09:32:23 -0700 Message-ID: <87y66qrsko.fsf@gmail.com> References: <87oc7mmjtk.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=44627 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pd3ce-00076Z-Cu for emacs-orgmode@gnu.org; Wed, 12 Jan 2011 11:32:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pd3cd-0000s1-2E for emacs-orgmode@gnu.org; Wed, 12 Jan 2011 11:32:32 -0500 Received: from mail-pw0-f41.google.com ([209.85.160.41]:60663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pd3cc-0000ro-QM for emacs-orgmode@gnu.org; Wed, 12 Jan 2011 11:32:31 -0500 Received: by pwj8 with SMTP id 8so160488pwj.0 for ; Wed, 12 Jan 2011 08:32:29 -0800 (PST) In-Reply-To: <87oc7mmjtk.fsf@mundaneum.com> (Francesco Pizzolante's message of "Wed, 12 Jan 2011 12:40:23 +0100") 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: Francesco Pizzolante Cc: mailing-list-org-mode Hi Francesco, In your example the cv source block only seems to have a single variable specified with a :var header argument (namely v-jobtitle), e.g. #+srcname: cv #+begin_src latex :noweb yes :var v-jobtitle="Software Engineer" ... #+end_src however your example noweb reference uses 4 variables. You will need to update the cv source block so that each variable is given a header argument. #+srcname: cv #+headers: :var v-firstname="Alex" :var v-familyname="Pizzo" #+headers: :var v-jobtitle="Project Manager" :var employee="alex" #+begin_src latex :noweb yes :var v-jobtitle="Software Engineer" ... #+end_src then ensure that you can call the cv function using a call line, e.g. #+call: cv(v-firstname="Alex",v-familyname="Pizzo",v-jobtitle="Project Manager",employee="alex") Once that is working then the noweb reference should work as well. Best -- Eric Francesco Pizzolante writes: > Hi, > > I'm trying to maintain my employees CVs in a single Org file using Babel (see > example hereunder). > > For this, I created several level-1 headings, one for each employee. > > Then, I have my main CV block (cv source block, see last "Composed CV" > heading) containing the layout of the CVs. This block is "called" for each > employee, in order to tangle a LaTeX file with the correct information. > > Though, currently, I'm not able to use variables *in noweb references* (see my > employee variable in <>. > > Could someone tell me how to have a generic solution, in this way or another? > > Any other ideas regarding this are welcome! > > Thanks a lot, > Francesco > > > * Alex > > #+srcname: cv-alex > #+begin_src latex :noweb yes :tangle alex.tex > <> > #+end_src > > ** Profile > > #+srcname: profile-alex > #+begin_src latex > Software engineering expert. > #+end_src > > ** Experience > > #+srcname: experience-alex > #+begin_src latex > \cventry{2007--2010}{Project Manager}{MyProject}{MyCompany}{}{} > \cventry{2005--2007}{Project Manager}{MyProject2}{MyCompany2}{}{} > #+end_src > > * Albert > > #+srcname: cv-albert > #+begin_src latex :noweb yes :tangle albert.tex > <> > #+end_src > > ** Profile > > #+srcname: profile-albert > #+begin_src latex > Software engineering expert. > #+end_src > > ** Experience > > #+srcname: experience-albert > #+begin_src latex > \cventry{2009--2010}{Developer}{MyProject}{MyCompany}{}{} > \cventry{2008--2009}{Developer}{MyProject2}{MyCompany2}{}{} > #+end_src > > * Composed CV :noexport: > > #+srcname: cv > #+begin_src latex :noweb yes :var v-jobtitle="Software Engineer" > \documentclass{mycvclass} > \usepackage[utf8x]{inputenc} > > \firstname{v-firstname} > \familyname{v-familyname} > \jobtitle{v-jobtitle} > > \begin{document} > > \section{Profile} > <> > > \section{Experience} > <> > > \end{document} > #+end_src > > _______________________________________________ > 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