emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Using Property Drawers to Pass Values to a Variable
@ 2012-12-23  9:27 Ian Barton
  2012-12-23 14:11 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Barton @ 2012-12-23  9:27 UTC (permalink / raw)
  To: emacs-orgmode

I am trying to pass a variable value to a latex source code block:

* Letter.
:PROPERTIES:
:first_name: Ian
:last_name: Barton
:END:

#+begin_src latex var: last_name =(org-get-entry nil "last_name")

#+end_src

However, it appears as though it's only supported for lisp. Any 
suggestions as how to do this?

I am trying to construct a business letter template using the KOMA 
scrlttrs class. I have got the letter looking the way I want it in tex. 
I propose to use babel to produce the tex, but need a way to pass 
variables stored in my org file to the various komavar.

I have tried org-koma-letter.el, which isn't quite flexible enough for 
my needs. I know there have been several postings in the list about 
using KOMA. If anyone is interested I found this 
http://stefano.italians.nl/archives/55 site a great help in getting my 
design the way I wanted it.

Ian.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [babel] Using Property Drawers to Pass Values to a Variable
  2012-12-23  9:27 [babel] Using Property Drawers to Pass Values to a Variable Ian Barton
@ 2012-12-23 14:11 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2012-12-23 14:11 UTC (permalink / raw)
  To: Ian Barton; +Cc: ian, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

Ian Barton <lists@wilkesley.net> writes:

> I am trying to pass a variable value to a latex source code block:
>
> * Letter.
> :PROPERTIES:
> :first_name: Ian
> :last_name: Barton
> :END:
>
> #+begin_src latex var: last_name =(org-get-entry nil "last_name")
>
> #+end_src
>
> However, it appears as though it's only supported for lisp. Any 
> suggestions as how to do this?
>
> I am trying to construct a business letter template using the KOMA 
> scrlttrs class. I have got the letter looking the way I want it in tex. 
> I propose to use babel to produce the tex, but need a way to pass 
> variables stored in my org file to the various komavar.
>
> I have tried org-koma-letter.el, which isn't quite flexible enough for 
> my needs. I know there have been several postings in the list about 
> using KOMA. If anyone is interested I found this 
> http://stefano.italians.nl/archives/55 site a great help in getting my 
> design the way I wanted it.
>
> Ian.
>

Looks like you're the victim of two small typos.

The following works for me.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: foo.org --]
[-- Type: text/x-org, Size: 170 bytes --]

* Letter.
:PROPERTIES:
:first_name: Ian
:last_name: Barton
:END:

#+begin_src latex :var last_name=(org-entry-get nil "last_name")
  My last name is last_name.
#+end_src

[-- Attachment #3: Type: text/plain, Size: 46 bytes --]


-- 
Eric Schulte
http://cs.unm.edu/~eschulte

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-23 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-23  9:27 [babel] Using Property Drawers to Pass Values to a Variable Ian Barton
2012-12-23 14:11 ` Eric Schulte

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).