> I have the following Org document where I would like to add some extra
> hlines to the output.  I'm using babel.  I tried the ascii package but
> couldn't find anything giving me extra hlines.  I'd also prefer to
> stick to just babel. 

I'm still looking for a good way to insert horizontal lines into
generated tables.  I have been trying to use Emacs Lisp to use
org-table-insert-hline using (i) babel and (ii) noweb.  For (i) I need
to add an hline object as the second-to-last object, but I havne't
been successful so far.

I'd appreciate any hints.

#+NAME:budget-dta
#+begin_src R  :colnames yes :noweb-ref TBL :exports none
  tt <- textConnection("
  account     p
  rent        110
  food        50")
  ee <- read.table(tt, header = TRUE)
  close(tt)
  cc <- 4 ## a complicated number generated with R

  ee$p <- ee$p * cc

  ee <- rbind(ee, data.frame(p=sum(ee$p),account=c("total")))
  ee
#+end_src

#+NAME:test
#+RESULTS: budget-dta
| account |   p |
|---------+-----|
| rent    | 440 |
| food    | 200 |
| total   | 640 |

#+BEGIN_SRC emacs-lisp :var X=test
(add-to-list 'X 'hline t)
#+END_SRC


-- 
Vote for proprietary math!


Reply via email to