emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Table questions
@ 2006-12-14 16:19 Michael
  2006-12-15 16:08 ` Eddward DeVilla
  2006-12-18  9:29 ` Carsten Dominik
  0 siblings, 2 replies; 9+ messages in thread
From: Michael @ 2006-12-14 16:19 UTC (permalink / raw)
  To: emacs-orgmode


I recently started using org-mode and love its table feature.  Here are some
questions that I have:

1. In table calculation, how to refer to a cell in a different column and
   different row?  Specifically, I want column 8 row 5 to be the ratio of
   column 7 row 5 and column 7 row 4.

2. I think the table minor mode would be a fantastic tool in editing tables
   in a LaTeX file. I wonder whether it is possible to let orgtbl recognize
   \begin{tabular}\end{tabular} and use & as column delimiter rather than |
   (also respect end of line \\)?

Thanks,

Michael

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

* Re: Table questions
  2006-12-14 16:19 Table questions Michael
@ 2006-12-15 16:08 ` Eddward DeVilla
  2006-12-15 18:15   ` Michael
  2006-12-18  9:39   ` Carsten Dominik
  2006-12-18  9:29 ` Carsten Dominik
  1 sibling, 2 replies; 9+ messages in thread
From: Eddward DeVilla @ 2006-12-15 16:08 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Michael

I'll follow this up with a few more wishes.  Could the table minor
mode maybe be extended to allow the user to define delimiters?  Say
draw a picture?

struct hugeStaticTable initData = {
  // Draw a picture
  // ORG-ROW-DEF { /* key*/ $1 , /* name */ $2 , /* location */ {  /*
x */ $3 , /* y */ $4 } , /* comment*/ $5 },
  { /* key */ 0, /* name */ "Bob", /* location */ { /* x */ 10.0, /* y
*/ 3.2 }, /* comment */ "You know.  Bob!  Bob.  Good times... Good
times..." }
  { /* key */ 1, /* name */ "Joe", /* location */ { /* x */ 5.5, /* y
*/ 4.4 },  /* comment */ "One fine batter." }
  ...
};

I code with a lot of static tables that are populated by hand.
Keeping them formatted is critical to keeping the code maintainable.
I'd think that this example might be too much for the table-minor
mode, but if there were a way to at least define a row beginning, end
and field separator, it might help.

struct S d = {
  // ORG-ROW-DEF '{'  ',' '}'
  { f1 , f2 , f3 , f4 }
  ....

};

On 12/14/06, Michael <wuolong@gmail.com> wrote:
>
> I recently started using org-mode and love its table feature.  Here are some
> questions that I have:
>
> 1. In table calculation, how to refer to a cell in a different column and
>    different row?  Specifically, I want column 8 row 5 to be the ratio of
>    column 7 row 5 and column 7 row 4.
>
> 2. I think the table minor mode would be a fantastic tool in editing tables
>    in a LaTeX file. I wonder whether it is possible to let orgtbl recognize
>    \begin{tabular}\end{tabular} and use & as column delimiter rather than |
>    (also respect end of line \\)?
>
> Thanks,
>
> Michael
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

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

* Re: Table questions
  2006-12-15 16:08 ` Eddward DeVilla
@ 2006-12-15 18:15   ` Michael
  2006-12-18  9:39   ` Carsten Dominik
  1 sibling, 0 replies; 9+ messages in thread
From: Michael @ 2006-12-15 18:15 UTC (permalink / raw)
  To: emacs-orgmode

On 15 Dec 2006, Eddward DeVilla wrote:

> I'll follow this up with a few more wishes.  Could the table minor
> mode maybe be extended to allow the user to define delimiters?  

Yes, it would be nice to edit .csv files directly in org-table model.

Michael

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

* Re: Table questions
  2006-12-14 16:19 Table questions Michael
  2006-12-15 16:08 ` Eddward DeVilla
@ 2006-12-18  9:29 ` Carsten Dominik
  2006-12-19 16:54   ` Michael
  1 sibling, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2006-12-18  9:29 UTC (permalink / raw)
  To: Michael; +Cc: emacs-orgmode


On Dec 14, 2006, at 17:19, Michael wrote:

>
> I recently started using org-mode and love its table feature.  Here 
> are some
> questions that I have:
>
> 1. In table calculation, how to refer to a cell in a different column 
> and
>    different row?  Specifically, I want column 8 row 5 to be the ratio 
> of
>    column 7 row 5 and column 7 row 4.

You cannot, at least currently.  I am not sure how well this would
work, because the table editor makes it very easy to swap rows, columns,
to add and delete columns, and such references would become invalid
unless one would carefully track these changes.  There is a limit
of what is still reasonable with the concept of org-mode tables.
If you want to create really complicated tables, maybe you are better 
off
with a link to another file in which you use SES, or even Excel.

Having said this, I do want to do a bit more in this direction, but
this is nowhere near completion.

> 2. I think the table minor mode would be a fantastic tool in editing 
> tables
>    in a LaTeX file. I wonder whether it is possible to let orgtbl 
> recognize
>    \begin{tabular}\end{tabular} and use & as column delimiter rather 
> than |
>    (also respect end of line \\)?

Yes, I think it would and I have been thinking to make this possible.
However, once I allow this, people will want to use \multicolumn, and
this seems for me to be beyond the scope.

Have you tried

    M-x align-current RET

in a LaTeX table?  It does wonders.

- Carsten

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

* Re: Table questions
  2006-12-15 16:08 ` Eddward DeVilla
  2006-12-15 18:15   ` Michael
@ 2006-12-18  9:39   ` Carsten Dominik
  1 sibling, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2006-12-18  9:39 UTC (permalink / raw)
  To: Eddward DeVilla; +Cc: Michael, emacs-orgmode

I have no plans to make something as complicated as this work with
the orgtbl mode.  I agree it would be nice to have, but I would not know
where to start.

- Carsten


On Dec 15, 2006, at 17:08, Eddward DeVilla wrote:

> I'll follow this up with a few more wishes.  Could the table minor
> mode maybe be extended to allow the user to define delimiters?  Say
> draw a picture?
>
> struct hugeStaticTable initData = {
>  // Draw a picture
>  // ORG-ROW-DEF { /* key*/ $1 , /* name */ $2 , /* location */ {  /*
> x */ $3 , /* y */ $4 } , /* comment*/ $5 },
>  { /* key */ 0, /* name */ "Bob", /* location */ { /* x */ 10.0, /* y
> */ 3.2 }, /* comment */ "You know.  Bob!  Bob.  Good times... Good
> times..." }
>  { /* key */ 1, /* name */ "Joe", /* location */ { /* x */ 5.5, /* y
> */ 4.4 },  /* comment */ "One fine batter." }
>  ...
> };
>
> I code with a lot of static tables that are populated by hand.
> Keeping them formatted is critical to keeping the code maintainable.
> I'd think that this example might be too much for the table-minor
> mode, but if there were a way to at least define a row beginning, end
> and field separator, it might help.
>
> struct S d = {
>  // ORG-ROW-DEF '{'  ',' '}'
>  { f1 , f2 , f3 , f4 }
>  ....
>
> };
>
> On 12/14/06, Michael <wuolong@gmail.com> wrote:
>>
>> I recently started using org-mode and love its table feature.  Here 
>> are some
>> questions that I have:
>>
>> 1. In table calculation, how to refer to a cell in a different column 
>> and
>>    different row?  Specifically, I want column 8 row 5 to be the 
>> ratio of
>>    column 7 row 5 and column 7 row 4.
>>
>> 2. I think the table minor mode would be a fantastic tool in editing 
>> tables
>>    in a LaTeX file. I wonder whether it is possible to let orgtbl 
>> recognize
>>    \begin{tabular}\end{tabular} and use & as column delimiter rather 
>> than |
>>    (also respect end of line \\)?
>>
>> Thanks,
>>
>> Michael
>>
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

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

* Re: Table questions
  2006-12-18  9:29 ` Carsten Dominik
@ 2006-12-19 16:54   ` Michael
  2006-12-19 22:28     ` Eddward DeVilla
  2006-12-19 23:20     ` Carsten Dominik
  0 siblings, 2 replies; 9+ messages in thread
From: Michael @ 2006-12-19 16:54 UTC (permalink / raw)
  To: emacs-orgmode

On 18 Dec 2006, Carsten Dominik wrote:

> On Dec 14, 2006, at 17:19, Michael wrote:

> > 1. In table calculation, how to refer to a cell in a different column and
> >    different row?  Specifically, I want column 8 row 5 to be the ratio of
> >    column 7 row 5 and column 7 row 4.

> You cannot, at least currently.  I am not sure how well this would
> work, because the table editor makes it very easy to swap rows, columns,
> to add and delete columns, and such references would become invalid
> unless one would carefully track these changes. 

I agree that you probably don't want to exactly replace the full power of
Excel.  But this simple feature makes it possible to keep track of simple
data.  I won't mind having to redo the formula after row swapping etc.,
which I think won't happen so often for a given table anyway.

> Having said this, I do want to do a bit more in this direction, but
> this is nowhere near completion.

> > 2. I think the table minor mode would be a fantastic tool in editing tables
> >    in a LaTeX file. I wonder whether it is possible to let orgtbl recognize
> >    \begin{tabular}\end{tabular} and use & as column delimiter rather than |
> >    (also respect end of line \\)?

> Yes, I think it would and I have been thinking to make this possible.
> However, once I allow this, people will want to use \multicolumn, and
> this seems for me to be beyond the scope.

I think you can ignore the rows with multicolumn in it, which would satisfy
most people I imagine.

> Have you tried

>    M-x align-current RET

> in a LaTeX table?  It does wonders.

I'll try that.  

Thanks very much for all the hard work,

Michael

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

* Re: Re: Table questions
  2006-12-19 16:54   ` Michael
@ 2006-12-19 22:28     ` Eddward DeVilla
  2006-12-19 23:25       ` Carsten Dominik
  2006-12-19 23:20     ` Carsten Dominik
  1 sibling, 1 reply; 9+ messages in thread
From: Eddward DeVilla @ 2006-12-19 22:28 UTC (permalink / raw)
  To: Michael; +Cc: emacs-orgmode

On 12/19/06, Michael <wuolong@gmail.com> wrote:
> On 18 Dec 2006, Carsten Dominik wrote:
>
> > On Dec 14, 2006, at 17:19, Michael wrote:
> > You cannot, at least currently.  I am not sure how well this would
> > work, because the table editor makes it very easy to swap rows, columns,
> > to add and delete columns, and such references would become invalid
> > unless one would carefully track these changes.
>
> I agree that you probably don't want to exactly replace the full power of
> Excel.  But this simple feature makes it possible to keep track of simple
> data.  I won't mind having to redo the formula after row swapping etc.,
> which I think won't happen so often for a given table anyway.

I know I use column swapping a lot.  I haven't got formulas down yet,
but if I where to use them in a table where I'm liable to column swap,
I'd probably use named columns.  (That's supported, right?)  Row
swapping would be trickier, but I don't do that much unless I'm
sorting based on a field, and if I'm sorting, I don't think I'd do
much more than ask for "$named_column one row up".

The ability to ask for a named column in a row relative to the current
one might be reasonably safe without having to change formulas.
Swapping rows could still bite the user if he didn't plan things out
right.

Edd

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

* Re: Re: Table questions
  2006-12-19 16:54   ` Michael
  2006-12-19 22:28     ` Eddward DeVilla
@ 2006-12-19 23:20     ` Carsten Dominik
  1 sibling, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2006-12-19 23:20 UTC (permalink / raw)
  To: Michael; +Cc: emacs-orgmode


On Dec 19, 2006, at 17:54, Michael wrote:
> I agree that you probably don't want to exactly replace the full power 
> of
> Excel.  But this simple feature makes it possible to keep track of 
> simple
> data.  I won't mind having to redo the formula after row swapping etc.,
> which I think won't happen so often for a given table anyway.

The question is exactly where to draw this border.  Decisive
for me is if I can find a clear an logical way to define things.
I guess something more about this will materialize eventually, but it 
will take a bit.
>
>> Yes, I think it would and I have been thinking to make this possible.
>> However, once I allow this, people will want to use \multicolumn, and
>> this seems for me to be beyond the scope.
>
> I think you can ignore the rows with multicolumn in it, which would 
> satisfy
> most people I imagine.

by ignore you mean simple not format those lines? That might be an 
option.

However, it is unlikely that I will the table editor in org-mode to
handle such cases.  It is more likely that at some point I'll will
make a separate program based on it, that will be more flexible to 
adapt.


- Carsten

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

* Re: Re: Table questions
  2006-12-19 22:28     ` Eddward DeVilla
@ 2006-12-19 23:25       ` Carsten Dominik
  0 siblings, 0 replies; 9+ messages in thread
From: Carsten Dominik @ 2006-12-19 23:25 UTC (permalink / raw)
  To: Eddward DeVilla; +Cc: Michael, emacs-orgmode


On Dec 19, 2006, at 23:28, Eddward DeVilla wrote:

> I know I use column swapping a lot.  I haven't got formulas down yet,
> but if I where to use them in a table where I'm liable to column swap,
> I'd probably use named columns.  (That's supported, right?)

Actually, column swapping is not the problem, and org-mode
supports it - the formulas stored in a TBLFM line will magically
change the $N references along with the swapped columns.  This
is possible because the calculations in org-mode tables are focused
on row formulas at the central use case.  An yes, named columns do
work as well.

For individual fields that you want to use in formulas, you can
name a field, or use a constant.

>  Row
> swapping would be trickier, but I don't do that much unless I'm
> sorting based on a field, and if I'm sorting, I don't think I'd do
> much more than ask for "$named_column one row up".

This is what I have started working on some time ago, but not
finished because I was not satisfied with the logics.
Maybe I'll get back to it.

>
> The ability to ask for a named column in a row relative to the current
> one might be reasonably safe without having to change formulas.
> Swapping rows could still bite the user if he didn't plan things out
> right.

Definitely.

- Carsten

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

end of thread, other threads:[~2006-12-19 23:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-14 16:19 Table questions Michael
2006-12-15 16:08 ` Eddward DeVilla
2006-12-15 18:15   ` Michael
2006-12-18  9:39   ` Carsten Dominik
2006-12-18  9:29 ` Carsten Dominik
2006-12-19 16:54   ` Michael
2006-12-19 22:28     ` Eddward DeVilla
2006-12-19 23:25       ` Carsten Dominik
2006-12-19 23:20     ` Carsten Dominik

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