emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Export all radio tables off a document
@ 2013-12-05 13:31 Thorsten Grothe
  2013-12-05 17:50 ` Garrido Xavier
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Grothe @ 2013-12-05 13:31 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

this is my first post to this list, so please be patient with me :-)

I have many radio tables in my document with this structure:

\begin{comment}
  #+TBLNAME: sec-10
  #+ORGTBL: SEND sec-10 orgtbl-to-latex :skip 3 :splice t
  |--------------------+---------------+---------------|
  | Anschaffungskosten | Nutzungsdauer | AfA in €/Std. |
  |--------------------+---------------+---------------|
  |             720000 |         36000 |            20 |
  |--------------------+---------------+---------------|
\end{comment}

A C-c C-c exports the table to Latex like this:

\begin{tabular}{lll}

  % BEGIN RECEIVE ORGTBL sec-10
	720000 & 36000 & 20\\
  % END RECEIVE ORGTBL sec-10

\end{tabular}

It would be very nice to automatically export *all* tables of the 
document to their corresponding latex tables in the same document. I 
found a function that does this for calculations in org-tables:

M-x org-table-recalculate-buffer-tables

but I found nothing similar for updating and exporting them automatically.

Is this possible?

Thanks in advance!

Regards
Th. Grothe

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

* Re: Export all radio tables off a document
  2013-12-05 13:31 Export all radio tables off a document Thorsten Grothe
@ 2013-12-05 17:50 ` Garrido Xavier
  2013-12-05 20:14   ` Thorsten Grothe
  0 siblings, 1 reply; 4+ messages in thread
From: Garrido Xavier @ 2013-12-05 17:50 UTC (permalink / raw)
  To: Thorsten Grothe, emacs-orgmode

Hi,

I asked the same question sometimes ago 
http://www.mail-archive.com/emacs-orgmode@gnu.org/msg64189.html and 
Carsten posted this answer which is still working for me


(defun my-org-send-all-tables ()
    (interactive)
    (org-table-map-tables
       (lambda () (orgtbl-send-table 'maybe))))

Cheers,
Xavier

Le 05/12/2013 14:31, Thorsten Grothe a écrit :
> Hi all,
>
> this is my first post to this list, so please be patient with me :-)
>
> I have many radio tables in my document with this structure:
>
> \begin{comment}
>   #+TBLNAME: sec-10
>   #+ORGTBL: SEND sec-10 orgtbl-to-latex :skip 3 :splice t
>   |--------------------+---------------+---------------|
>   | Anschaffungskosten | Nutzungsdauer | AfA in €/Std. |
>   |--------------------+---------------+---------------|
>   |             720000 |         36000 |            20 |
>   |--------------------+---------------+---------------|
> \end{comment}
>
> A C-c C-c exports the table to Latex like this:
>
> \begin{tabular}{lll}
>
>   % BEGIN RECEIVE ORGTBL sec-10
>      720000 & 36000 & 20\\
>   % END RECEIVE ORGTBL sec-10
>
> \end{tabular}
>
> It would be very nice to automatically export *all* tables of the
> document to their corresponding latex tables in the same document. I
> found a function that does this for calculations in org-tables:
>
> M-x org-table-recalculate-buffer-tables
>
> but I found nothing similar for updating and exporting them automatically.
>
> Is this possible?
>
> Thanks in advance!
>
> Regards
> Th. Grothe
>

-- 

   |
   |__     GARRIDO Xavier       Laboratoire de l'Accélérateur Linéaire
    /\     NEMO                 Université Paris-Sud 11
   /--\    garrido@lal.in2p3.fr UMR 8607
   |       garrido@in2p3.fr     Batiment 200
   |__     +33 1.64.46.84.28    91898 Orsay Cedex, France

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

* Re: Export all radio tables off a document
  2013-12-05 17:50 ` Garrido Xavier
@ 2013-12-05 20:14   ` Thorsten Grothe
  2013-12-05 23:59     ` Suvayu Ali
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Grothe @ 2013-12-05 20:14 UTC (permalink / raw)
  To: Garrido Xavier; +Cc: emacs-orgmode

Hi,

* Thu, 05 Dec 2013 18:50:53 +0100, garrido@lal.in2p3.fr:

> Hi,
>
> I asked the same question sometimes ago
> http://www.mail-archive.com/emacs-orgmode@gnu.org/msg64189.html and
> Carsten posted this answer which is still working for me
>
>
> (defun my-org-send-all-tables ()
>     (interactive)
>     (org-table-map-tables
>        (lambda () (orgtbl-send-table 'maybe))))
>

very very nice, it works !!!!! Thank you very much! It's a bit slow but 
that's not a problem!! I'm working with Auctex here and the code is not 
indented after exporting the tables. Would it be possible to expand the 
macro so that it automatically indents the code --> in Auctex this is 
C-c C-q C-e ?

If not, no problem but I think this would be a nice feature :-)

Regards
Thorsten Grothe

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

* Re: Export all radio tables off a document
  2013-12-05 20:14   ` Thorsten Grothe
@ 2013-12-05 23:59     ` Suvayu Ali
  0 siblings, 0 replies; 4+ messages in thread
From: Suvayu Ali @ 2013-12-05 23:59 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, Dec 05, 2013 at 09:14:09PM +0100, Thorsten Grothe wrote:
> Hi,
> 
> * Thu, 05 Dec 2013 18:50:53 +0100, garrido@lal.in2p3.fr:
> 
> >Hi,
> >
> >I asked the same question sometimes ago
> >http://www.mail-archive.com/emacs-orgmode@gnu.org/msg64189.html and
> >Carsten posted this answer which is still working for me
> >
> >
> >(defun my-org-send-all-tables ()
> >    (interactive)
> >    (org-table-map-tables
> >       (lambda () (orgtbl-send-table 'maybe))))
> >
> 
> very very nice, it works !!!!! Thank you very much! It's a bit slow but
> that's not a problem!! I'm working with Auctex here and the code is not
> indented after exporting the tables. Would it be possible to expand the
> macro so that it automatically indents the code --> in Auctex this is C-c
> C-q C-e ?

The lambda bit in the above snippet is a function that operates on all
tables one at a time.  If you can reliably select the exported table,
you can call indent-region (or whatever special function AucTeX might
use) to indent it.

Maybe a nice simple lisp project to get started programming in lisp? ;)

GL,

-- 
Suvayu

Open source is the future. It sets us free.

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

end of thread, other threads:[~2013-12-05 23:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-05 13:31 Export all radio tables off a document Thorsten Grothe
2013-12-05 17:50 ` Garrido Xavier
2013-12-05 20:14   ` Thorsten Grothe
2013-12-05 23:59     ` Suvayu Ali

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).