emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] allow for multiline headers


From: Nicolas Goaziou
Subject: Re: [PATCH] allow for multiline headers
Date: Mon, 29 Jun 2020 20:36:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Mario Frasca <mario@anche.no> writes:

> again, my idea is that we're describing something new, and I'm
> wondering what lisp construct could be used to describe a table like
> this one:
>
> | h1 | h2 | h3 |
> |----+----+----|
> | 11 | 12 | 13 |
> | 21 | 22 | 23 |
> | 31 | 32 | 33 |
> |----+----+----|
> | a1 | a2 | a3 |
> | b1 | b2 | b3 |
> |----+----+----|
> |  5 |  8 |  9 |
>
> and my guess in the above case would be '(:header ("h1" "h2"
> "h3") :body ((11 12 13)(21 22 23)(31 32 33)) :body ((a1 a2 a3)(b1 b2
> b3)) :body ((5 8 9)))

These are called "row groups" in ox.el, but I don't think we should
parse them like the above. It is easy enough to get this kind of result
just walking through the table.

> with a option for collapsing all :body parts into one, like in
> '(:header ("h1" "h2" "h3") :body ((11 12 13)(21 22 23)(31 32 33)(a1 a2
> a3)(b1 b2 b3)(5 8 9)))
>
> with a option for separating the last row (if the one-but-last is
> a 'hline) as a summary, like in '(:header ("h1" "h2" "h3") :body ((11
> 12 13)(21 22 23)(31 32 33)) :body ((a1 a2 a3)(b1 b2 b3)) :summary (5
> 8 9))
>
> or using both options, like in '(:header ("h1" "h2" "h3") :body ((11
> 12 13)(21 22 23)(31 32 33)(a1 a2 a3)(b1 b2 b3)) :summary (5 8 9))
>
> your suggestion as a cons cell would only cover the first case, as in
> '(("h1" "h2" "h3") . ((11 12 13)(21 22 23)(31 32 33)(a1 a2 a3)(b1 b2
> b3)(5 8 9)))

You're missing `hline' symbols in the body. I didn't suggest to remove
them, except for the separator between the header and the body, and
trailing separators.

> in my very brief experience with org-tables, mostly from the point of
> view of org-plot, I think this (separating the bottom "summary" line)
> would be useful (I had to remove the "country summary" bottom line
> from a demographics histogram table).  for sure, if I follow your hint
> to use gnuplot code and refer to the table, then org-plot can stay as
> it is now.  in fact it would not need any maintenance, would it?

You can indeed extract a specific part of the table as an input of
a gnuplot code block. IMO, Org Plot should be very basic, and complexity
should go into Babel code blocks, which are more capable.

Regards,



reply via email to

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