emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Rainer M Krug <r.m.krug@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [babel] FEATURE REQUEST: send results into file
Date: Wed, 29 Sep 2010 09:53:28 -0600	[thread overview]
Message-ID: <87aan0h7gn.fsf@gmail.com> (raw)
In-Reply-To: <AANLkTi=zas0KnqwH7sZrNPTT_OGhbuHeTpP+RrYTaL2t@mail.gmail.com> (Rainer M. Krug's message of "Wed, 29 Sep 2010 10:58:26 +0200")

Hi Rainer,

I'm not sure that code blocks are the solution for this particular
problem.  The following simple function should do what you want.

--8<---------------cut here---------------start------------->8---
(defun schulte/current-table-to-tex (file)
  "Export the current table as latex to FILE."
  (interactive "F")
  ((lambda (tex-table) (with-temp-file file (insert tex-table)))
   (org-export-region-as-latex (org-table-begin) (org-table-end) t 'string)))
--8<---------------cut here---------------end--------------->8---

Best -- Eric

Rainer M Krug <r.m.krug@gmail.com> writes:

> Hi
>
> Based on a discussion in the thread "Problem with PROPERTIES :OPTIONS: when
> exporting subtree", The idea came ub by Mathew Lundin to be able to "send
> the results or a source code block (either executed code or exported org
> snippets) via babel to a target in an external file.".
>
> The scenario or context in which the idea came up:
>
> I am using org babel for literate programming and I document my parameters
> for simulations in a table in org. Now when writing a paper, for which I use
> a different program (I use LyX), but I still would like to include the
> tables from my original org file in them. Therefore I was looking for a
> possibility to export ONLY the table into a .tex file, so that it can be
> included in the LyX / LaTeX via \input{theTable.tex} . Therefore I would
> need an export of the table in LaTeX format, but no preamble or anything. As
> far as I was told, this possibility does not exist in org.
>
> So Mathew's / my question is if it would be possible to include a
> functionality to "send the results or a source code block (either executed
> code or exported org snippets) via babel to a target in an external file.".
>
>
> Cheers,
>
> Rainer

  parent reply	other threads:[~2010-09-29 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-29  8:58 [babel] FEATURE REQUEST: send results into file Rainer M Krug
2010-09-29  9:21 ` Sébastien Vauban
2010-09-29 10:24   ` Rainer M Krug
2010-09-29 10:59     ` Sébastien Vauban
2010-09-29 11:54       ` Rainer M Krug
2010-09-29 15:53 ` Eric Schulte [this message]
2010-09-29 16:02 ` Thomas S. Dye
2010-09-29 16:22   ` Eric Schulte

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=87aan0h7gn.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=r.m.krug@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).