[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [babel] file header argument includes other variable
From: |
Andreas Leha |
Subject: |
Re: [O] [babel] file header argument includes other variable |
Date: |
Fri, 30 Mar 2012 21:23:51 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) |
Rainer M Krug <address@hidden> writes:
> Hi
>
> I would like to do make the file header argument to be concatenated of a
> constant string and
> another variable, so effectively:
>
> #+header: :var+ ConNum="10"
> #+header: :results graphics
> #+header: :file SA_VALUEOFConNum.pdf
> #+header: :width 8
> #+header: :height 8
> #+header: :pointsize 8
> #+begin_src R
> plot(runif(100))
> #+end_src
>
> #+RESULTS:
> [[file:SA_10.pdf]]
>
> Is this possible?
>
> Thanks,
>
> Rainer
Hi Rainer,
I am not aware of any method that directly does what you want. But depending on
where the value of your variable ConNum is coming from, the
following might be a start for you. It is based on the possibility to
insert elisp in the header arguments:
#+name: myconnum
- 19
#+header: :var ConNum=myconnum
#+header: :results graphics
#+header: :file (concat "SA_" (sbe myconnum) ".pdf")
#+header: :width 8
#+header: :height 8
#+header: :pointsize 8
#+begin_src R
plot(runif(100), main=ConNum)
#+end_src
#+RESULTS:
[[file:SA_(19).pdf]]
Best,
Andreas