emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* tables, positioning of `#+Plot:' lines
@ 2020-06-05 19:49 Mario Frasca
  2020-06-05 20:08 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Mario Frasca @ 2020-06-05 19:49 UTC (permalink / raw)
  To: emacs-orgmode

I was wondering about the position of the `#+plot:' lines.  we have a 
table, and if we want to have formulas, we put these in a `#+TBLFM:' 
line following the table.  the documentation of org-plot states that 
`#+PLOT:' lines are looked for: following, or preceding the table, but 
then only the "preceding" strategy is implemented.  I tried just out of 
curiosity, what happens if I put my `#+PLOT:' lines following the table 
but before the `#+TBLFM:' line.  in this case also the `#+TBLFM:' line 
is not found.

I see a couple of problems with this approach and in the current 
implementation:

- only one single `#+TBLFM:' line is recognized, it must follow the 
table, there cannot be any other meta information in between the table 
and the `#+TBLFM:' line.

- other programs can't add meta information to the table, or must choose 
to stay after the `#+TBLFM:' line or before the `#+PLOT:' lines.

- you have meta information at the two ends of the table, instead of all 
on the same side.

I would like to implement the 'plot meta lines after the table', and 
some way to comment meta lines.

any thoughts?

my main doubt is that if we acknowledge meta lines at both ends, we end 
up with an unmanageable mess, where similar information can be very 
distant in the document.  I think it was a mistake to let PLOT 
directives be placed elsewhere than formulas, but I don't know if it's 
still worth changing this.

best regards, MF



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

* Re: tables, positioning of `#+Plot:' lines
  2020-06-05 19:49 tables, positioning of `#+Plot:' lines Mario Frasca
@ 2020-06-05 20:08 ` Nicolas Goaziou
  2020-06-05 20:16   ` Mario Frasca
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2020-06-05 20:08 UTC (permalink / raw)
  To: Mario Frasca; +Cc: emacs-orgmode

Hello,

Mario Frasca <mario@anche.no> writes:

> I was wondering about the position of the `#+plot:' lines.  we have
> a table, and if we want to have formulas, we put these in a `#+TBLFM:'
> line following the table.  the documentation of org-plot states that
> `#+PLOT:' lines are looked for: following, or preceding the table

Then the documentation needs to be fixed.

> but then only the "preceding" strategy is implemented.  I tried just
> out of curiosity, what happens if I put my `#+PLOT:' lines following
> the table but before the `#+TBLFM:' line.  in this case also the
> `#+TBLFM:' line is not found.
>
> I see a couple of problems with this approach and in the current
> implementation:
>
> - only one single `#+TBLFM:' line is recognized,

IIRC, this was a feature request, even though we could allow multiple
TBLFM lines. Why some users requested to have only one active TBLFM line
at a time, I don't know.

> it must follow the table, there cannot be any other meta information
> in between the table and the `#+TBLFM:' line.

What kind of meta information?

You don't need to create monster-tables. You may simply write a table,
and use it as input in a dedicated gnuplot source block.

> my main doubt is that if we acknowledge meta lines at both ends, we
> end up with an unmanageable mess, where similar information can be
> very distant in the document.  I think it was a mistake to let PLOT
> directives be placed elsewhere than formulas, but I don't know if it's
> still worth changing this.

Since TBLFM lines are the odd ones, the mistake was to allow them after
the table, while every other affiliated keyword in the Org universe goes
before the object it applies to.

IOW, I don't think also allowing PLOT affiliated keyword at the end of
the table is a good idea, and I'm sure that allowing it on both ends is
a bad one.

Regards,

-- 
Nicolas Goaziou


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

* Re: tables, positioning of `#+Plot:' lines
  2020-06-05 20:08 ` Nicolas Goaziou
@ 2020-06-05 20:16   ` Mario Frasca
  2020-06-05 21:16     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Mario Frasca @ 2020-06-05 20:16 UTC (permalink / raw)
  To: emacs-orgmode

On 05/06/2020 15:08, Nicolas Goaziou wrote:
> Since TBLFM lines are the odd ones, the mistake was to allow them after
> the table, while every other affiliated keyword in the Org universe goes
> before the object it applies to.

ah, I did not know that.  that's good.  and we don't want to correct 
that, I guess.

point is: as far as I can see, org-plot currently only recognizes its 
`#+' lines if they are immediately before the table.  being new to this 
world, I a not aware of other `#+<name>:' lines other than TBLFM and PLOT.

which is the name you give to these lines?  def lines? table-meta-data 
lines?  there isn't any global function for matching them, is there?

On 05/06/2020 15:08, Nicolas Goaziou wrote:
> What kind of meta information?

I mean other lines matching `^#\+[A-Z]+:' … as said, I don't know how to 
call them, and I guessed "meta information".

best regards, MF



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

* Re: tables, positioning of `#+Plot:' lines
  2020-06-05 20:16   ` Mario Frasca
@ 2020-06-05 21:16     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2020-06-05 21:16 UTC (permalink / raw)
  To: Mario Frasca; +Cc: emacs-orgmode

> point is: as far as I can see, org-plot currently only recognizes its
> `#+' lines if they are immediately before the table.  being new to
> this world, I a not aware of other `#+<name>:' lines other than TBLFM
> and PLOT.

#+name: #+header: #+caption: #+results: #+attr_latex: #+attr_html: …

They all live right before the element, not necessarily a table, they
refer to.

> which is the name you give to these lines?  def lines? table-meta-data
> lines?

Affiliated keywords.

> there isn't any global function for matching them, is there?

The parser captures their value.

Before overloading affiliated keywords, such as PLOT, or HEADER, you may
want to consider using a dedicated Gnuplot source block for advanced
drawings is the way to go.


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

end of thread, other threads:[~2020-06-05 21:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 19:49 tables, positioning of `#+Plot:' lines Mario Frasca
2020-06-05 20:08 ` Nicolas Goaziou
2020-06-05 20:16   ` Mario Frasca
2020-06-05 21:16     ` Nicolas Goaziou

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