emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: Martin Halder <martin.halder@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: table as parameter for latex block
Date: Sun, 18 Mar 2012 08:29:03 -1000	[thread overview]
Message-ID: <m17gyhdaq8.fsf@tsdye.com> (raw)
In-Reply-To: <3F1A1157-9068-4F41-AD35-A6D926DF69F5@gmail.com> (Martin Halder's message of "Sun, 18 Mar 2012 09:40:05 +0100")

Martin Halder <martin.halder@gmail.com> writes:

> Hi all,
>
> was trying to use a table as input for a latex block. Is there a way to directly reference parts of the table inside the block or do I have to specify each parameter as separate parameter ?
>
> Thanks for help,
> Martin
Aloha Martin,

Can I ask why you want to use a table as input for a latex block?  An
alternative is to send the table to a source block in some other
language and then evaluate with :results latex.  The advantage is that
the other language can have loops and complex data types that make it
relatively easy to deal with tables.  It might be possible to do these
kinds of things with TeX, but it is likely to be difficult.

hth,
Tom

>
> This is working:
>
> #+tblname: data
> | Name    | John Doe     |
> | Address | Doestreet 42 |
> | Country | Doecountry   |
>
> #+name: invoice(name=data[0,1], address=data[1,1], country=data[2,1])
> #+begin_src latex
> name
> address
> country
> #+end_src
>
> #+RESULTS: invoice
> #+BEGIN_LaTeX
> John Doe
> Doestreet 42
> Doecountry
> #+END_LaTeX
>
> what I would like to do:
>
> #+name: invoice(data=data)
> #+begin_src latex
> data[0,1]
> data[1,1]
> data[2,1]
> #+end_src
>
> or even better:
>
> #+name: invoice(data=data)
> #+begin_src latex
> data['Name']
> data['Adress']
> data['Country']
> #+end_src
>
>
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

  reply	other threads:[~2012-03-18 18:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-18  8:40 table as parameter for latex block Martin Halder
2012-03-18 18:29 ` Thomas S. Dye [this message]
2012-03-18 19:10   ` Martin Halder
2012-03-18 19:29     ` Thomas S. Dye
2012-03-18 19:55       ` Martin Halder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m17gyhdaq8.fsf@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=martin.halder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).