emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Creating hline in table from source block?


From: Rasmus
Subject: Re: [O] Creating hline in table from source block?
Date: Mon, 25 Nov 2013 22:38:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Loris,

"Loris Bennett" <address@hidden> writes:

> How do I get this
>
> #+RESULTS:
> |   a | b | c | d |
> |-----+---+---+---|
> |   1 | 2 | 3 | 4 |
> |   5 | 6 | 7 | 8 |

You might find use of the post header argument here,

    http://orgmode.org/manual/post.html

In this case it's as simple as this

#+NAME: add_hline
#+BEGIN_SRC emacs-lisp :var data='((a b c)) h1=1
  (require 'cl)
  (append (subseq data 0 h1 ) (list 'hline) (subseq data h1))
#+END_SRC
#+BEGIN_SRC sh :post add_hline(data=*this*)
echo "a b c d"
echo "1 2 3 4"
echo "5 6 7 8"
#+END_SRC
 
Probably you can remove the require 'cl.  Also, you can generalize the
code to take arbitrarily hline positions.  

Hope it helps.

–Rasmus

-- 
Vote for proprietary math!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]