emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Multicolumn
@ 2012-08-29  0:10 Neuwirth Erich
  2012-08-29  0:28 ` Multicolumn Christopher J. White
  0 siblings, 1 reply; 7+ messages in thread
From: Neuwirth Erich @ 2012-08-29  0:10 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org emacs-orgmode@gnu.org

After some googling it seems that multicolumn support is not yet implemented in org tables.
I would need multicolumn headers quite urgently,
but I have not yet found a way to make this possible.

I think that tables with headers like this:

|               |    mean       |         s.e.        |
| gender | varA | varB |  varA | varB |

are quite common, so I really want to put this feature on the wish list.
I am not able to implement this myself.

Erich

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

* Re: Multicolumn
  2012-08-29  0:10 Multicolumn Neuwirth Erich
@ 2012-08-29  0:28 ` Christopher J. White
  2012-08-29  1:05   ` Multicolumn Neuwirth Erich
  0 siblings, 1 reply; 7+ messages in thread
From: Christopher J. White @ 2012-08-29  0:28 UTC (permalink / raw)
  To: emacs-orgmode

Hi Erich,

I have a hack for multicolumn support that may help... It's not great, 
but serves my purpose.

I implemented a TWiki mode that uses orgtbl-minor-mode.  TWiki pages 
support multicolumn cells by adding vertical bars with no separators:

Display:

|  Multicol     |
|  C1   |   C2  |

TWiki format:
| Multicol ||
| C1 | C2 |

Notice the double vertical bars after Multicol.  The number of vertical 
bars on every row must be the same.  You can join as many cells as you 
want that way.  I basically wanted to be able to still use 
orgtbl-minor-mode to edit such tables.  So I hacked my 
twiki-import/export code to convert "||" to "| << |" and vice-versa.

So the orgtbl version of the above looks like this in the buffer:

| Multicol | << |
| C1       | C2 |

The down side is that the text "Multicol" will expand the display size 
of C1, so if it gets long, the table grows:

| This is a long multicol cell | << |
| C1                           | C2 |

So it gets me what I want, which is orgtbl editing, and import/export 
support to twiki format.  Seems a similar technique could be backed in 
to any org export engine.

...cj

On 8/28/12 5:10 PM, Neuwirth Erich wrote:
> After some googling it seems that multicolumn support is not yet 
> implemented in org tables.
> I would need multicolumn headers quite urgently,
> but I have not yet found a way to make this possible.
>
> I think that tables with headers like this:
>
> |               |    mean       |         s.e.        |
> | gender | varA | varB |  varA | varB |
>
> are quite common, so I really want to put this feature on the wish list.
> I am not able to implement this myself.
>
> Erich
>
>
>
>

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

* Re: Multicolumn
  2012-08-29  0:28 ` Multicolumn Christopher J. White
@ 2012-08-29  1:05   ` Neuwirth Erich
  2012-08-29  1:47     ` Multicolumn John Hendy
  2012-08-29  2:39     ` Multicolumn Thomas S. Dye
  0 siblings, 2 replies; 7+ messages in thread
From: Neuwirth Erich @ 2012-08-29  1:05 UTC (permalink / raw)
  To: orgmode; +Cc: emacs-orgmode

My problem is that the tables are produce by R code snippets.
The code snippets produce plain org tables, bracketed by attributes identifying 
the text as ORG code.



#+RESULTS:
#+BEGIN_ORG
| Jahr | Region | m   | w   | pWert | m.se  | w.se  |
|------+--------+-----+-----+-------+-------+-------|
| 2000 | Sonst  | 508 | 507 | 0.85  | 4.91  | 4.93  |
#+END_ORG


I am able to insert additional lines before and after the text produce by the R commands with the following technique (in R):


print(as.table(NULL),quote=FALSE,type="org")
cat("|-------|\n")
print(res,type="org")
cat("|-------|\n")


So I could write a line with my multicol headers.
But for that to work, org mode would have to honor multicol indicators in the text.





On Aug 29, 2012, at 2:28 AM, "Christopher J. White" <orgmode@grierwhite.com> wrote:

> Hi Erich,
> 
> I have a hack for multicolumn support that may help... It's not great, but serves my purpose.
> 
> I implemented a TWiki mode that uses orgtbl-minor-mode.  TWiki pages support multicolumn cells by adding vertical bars with no separators:
> 
> Display:
> 
> |  Multicol     |
> |  C1   |   C2  |
> 
> TWiki format:
> | Multicol ||
> | C1 | C2 |
> 
> Notice the double vertical bars after Multicol.  The number of vertical bars on every row must be the same.  You can join as many cells as you want that way.  I basically wanted to be able to still use orgtbl-minor-mode to edit such tables.  So I hacked my twiki-import/export code to convert "||" to "| << |" and vice-versa.
> 
> So the orgtbl version of the above looks like this in the buffer:
> 
> | Multicol | << |
> | C1       | C2 |
> 
> The down side is that the text "Multicol" will expand the display size of C1, so if it gets long, the table grows:
> 
> | This is a long multicol cell | << |
> | C1                           | C2 |
> 
> So it gets me what I want, which is orgtbl editing, and import/export support to twiki format.  Seems a similar technique could be backed in to any org export engine.
> 
> ...cj
> 
> On 8/28/12 5:10 PM, Neuwirth Erich wrote:
>> After some googling it seems that multicolumn support is not yet implemented in org tables.
>> I would need multicolumn headers quite urgently,
>> but I have not yet found a way to make this possible.
>> 
>> I think that tables with headers like this:
>> 
>> |               |    mean       |         s.e.        |
>> | gender | varA | varB |  varA | varB |
>> 
>> are quite common, so I really want to put this feature on the wish list.
>> I am not able to implement this myself.
>> 
>> Erich
>> 
>> 
>> 
>> 
> 
> 

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

* Re: Multicolumn
  2012-08-29  1:05   ` Multicolumn Neuwirth Erich
@ 2012-08-29  1:47     ` John Hendy
  2012-08-29  2:39     ` Multicolumn Thomas S. Dye
  1 sibling, 0 replies; 7+ messages in thread
From: John Hendy @ 2012-08-29  1:47 UTC (permalink / raw)
  To: Neuwirth Erich; +Cc: orgmode, emacs-orgmode

On Tue, Aug 28, 2012 at 8:05 PM, Neuwirth Erich
<erich.neuwirth@univie.ac.at> wrote:
> My problem is that the tables are produce by R code snippets.
> The code snippets produce plain org tables, bracketed by attributes identifying
> the text as ORG code.
>
>
>
> #+RESULTS:
> #+BEGIN_ORG
> | Jahr | Region | m   | w   | pWert | m.se  | w.se  |
> |------+--------+-----+-----+-------+-------+-------|
> | 2000 | Sonst  | 508 | 507 | 0.85  | 4.91  | 4.93  |
> #+END_ORG
>
>
> I am able to insert additional lines before and after the text produce by the R commands with the following technique (in R):
>
>
> print(as.table(NULL),quote=FALSE,type="org")
> cat("|-------|\n")
> print(res,type="org")
> cat("|-------|\n")
>

Not ideal, but could your R code just write the LaTeX syntax? cat()
the align statement and then cat() the "&" and "\\" stuff manually?

John

>
> So I could write a line with my multicol headers.
> But for that to work, org mode would have to honor multicol indicators in the text.
>
>
>
>
>
> On Aug 29, 2012, at 2:28 AM, "Christopher J. White" <orgmode@grierwhite.com> wrote:
>
>> Hi Erich,
>>
>> I have a hack for multicolumn support that may help... It's not great, but serves my purpose.
>>
>> I implemented a TWiki mode that uses orgtbl-minor-mode.  TWiki pages support multicolumn cells by adding vertical bars with no separators:
>>
>> Display:
>>
>> |  Multicol     |
>> |  C1   |   C2  |
>>
>> TWiki format:
>> | Multicol ||
>> | C1 | C2 |
>>
>> Notice the double vertical bars after Multicol.  The number of vertical bars on every row must be the same.  You can join as many cells as you want that way.  I basically wanted to be able to still use orgtbl-minor-mode to edit such tables.  So I hacked my twiki-import/export code to convert "||" to "| << |" and vice-versa.
>>
>> So the orgtbl version of the above looks like this in the buffer:
>>
>> | Multicol | << |
>> | C1       | C2 |
>>
>> The down side is that the text "Multicol" will expand the display size of C1, so if it gets long, the table grows:
>>
>> | This is a long multicol cell | << |
>> | C1                           | C2 |
>>
>> So it gets me what I want, which is orgtbl editing, and import/export support to twiki format.  Seems a similar technique could be backed in to any org export engine.
>>
>> ...cj
>>
>> On 8/28/12 5:10 PM, Neuwirth Erich wrote:
>>> After some googling it seems that multicolumn support is not yet implemented in org tables.
>>> I would need multicolumn headers quite urgently,
>>> but I have not yet found a way to make this possible.
>>>
>>> I think that tables with headers like this:
>>>
>>> |               |    mean       |         s.e.        |
>>> | gender | varA | varB |  varA | varB |
>>>
>>> are quite common, so I really want to put this feature on the wish list.
>>> I am not able to implement this myself.
>>>
>>> Erich
>>>
>>>
>>>
>>>
>>
>>
>
>

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

* Re: Multicolumn
  2012-08-29  1:05   ` Multicolumn Neuwirth Erich
  2012-08-29  1:47     ` Multicolumn John Hendy
@ 2012-08-29  2:39     ` Thomas S. Dye
  2012-08-29  7:44       ` Multicolumn Neuwirth Erich
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas S. Dye @ 2012-08-29  2:39 UTC (permalink / raw)
  To: Neuwirth Erich; +Cc: orgmode, emacs-orgmode

Neuwirth Erich <erich.neuwirth@univie.ac.at> writes:

> My problem is that the tables are produce by R code snippets.
> The code snippets produce plain org tables, bracketed by attributes identifying 
> the text as ORG code.
>
>
>
> #+RESULTS:
> #+BEGIN_ORG
> | Jahr | Region | m   | w   | pWert | m.se  | w.se  |
> |------+--------+-----+-----+-------+-------+-------|
> | 2000 | Sonst  | 508 | 507 | 0.85  | 4.91  | 4.93  |
> #+END_ORG
>
>
> I am able to insert additional lines before and after the text produce
> by the R commands with the following technique (in R):
>
>
> print(as.table(NULL),quote=FALSE,type="org")
> cat("|-------|\n")
> print(res,type="org")
> cat("|-------|\n")
>
>
> So I could write a line with my multicol headers.
> But for that to work, org mode would have to honor multicol indicators
> in the text.

Alternatively, compose latex or html tables in R and then have the source
code block :results output latex or :results output html

That should wrap the output in #+BEGIN_LATEX ... #+END_LATEX, which org
will export directly to LaTeX, or #+BEGIN_HTML ... #+END_HTML, which org
will export directly to HTML.

hth,
Tom
 
>
>
>
>
>
> On Aug 29, 2012, at 2:28 AM, "Christopher J. White"
> <orgmode@grierwhite.com> wrote:
>
>> Hi Erich,
>> 
>> I have a hack for multicolumn support that may help... It's not
>> great, but serves my purpose.
>> 
>> I implemented a TWiki mode that uses orgtbl-minor-mode.  TWiki pages
>> support multicolumn cells by adding vertical bars with no
>> separators:
>> 
>> Display:
>> 
>> |  Multicol     |
>> |  C1   |   C2  |
>> 
>> TWiki format:
>> | Multicol ||
>> | C1 | C2 |
>> 
>> Notice the double vertical bars after Multicol.  The number of
>> vertical bars on every row must be the same.  You can join as many
>> cells as you want that way.  I basically wanted to be able to still
>> use orgtbl-minor-mode to edit such tables.  So I hacked my
>> twiki-import/export code to convert "||" to "| << |" and vice-versa.
>> 
>> So the orgtbl version of the above looks like this in the buffer:
>> 
>> | Multicol | << |
>> | C1       | C2 |
>> 
>> The down side is that the text "Multicol" will expand the display
>> size of C1, so if it gets long, the table grows:
>> 
>> | This is a long multicol cell | << |
>> | C1                           | C2 |
>> 
>> So it gets me what I want, which is orgtbl editing, and
>> import/export support to twiki format.  Seems a similar technique
>> could be backed in to any org export engine.
>> 
>> ...cj
>> 
>> On 8/28/12 5:10 PM, Neuwirth Erich wrote:
>>> After some googling it seems that multicolumn support is not yet
>>> implemented in org tables.
>>> I would need multicolumn headers quite urgently,
>>> but I have not yet found a way to make this possible.
>>> 
>>> I think that tables with headers like this:
>>> 
>>> |               |    mean       |         s.e.        |
>>> | gender | varA | varB |  varA | varB |
>>> 
>>> are quite common, so I really want to put this feature on the wish list.
>>> I am not able to implement this myself.
>>> 
>>> Erich
>>> 
>>> 
>>> 
>>> 
>> 
>> 
>
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: Multicolumn
  2012-08-29  2:39     ` Multicolumn Thomas S. Dye
@ 2012-08-29  7:44       ` Neuwirth Erich
  2012-08-29 14:27         ` Multicolumn John Hendy
  0 siblings, 1 reply; 7+ messages in thread
From: Neuwirth Erich @ 2012-08-29  7:44 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: orgmode, emacs-orgmode

That is probably what I will have to do.
But since I want both html and LaTeX output, I have to two write separate output routines
in R which I had hoped to be able to avoid.


On Aug 29, 2012, at 4:39 AM, tsd@tsdye.com (Thomas S. Dye) wrote:

> Neuwirth Erich <erich.neuwirth@univie.ac.at> writes:
> 
>> My problem is that the tables are produce by R code snippets.
>> The code snippets produce plain org tables, bracketed by attributes identifying 
>> the text as ORG code.
>> 
>> 
>> 
>> #+RESULTS:
>> #+BEGIN_ORG
>> | Jahr | Region | m   | w   | pWert | m.se  | w.se  |
>> |------+--------+-----+-----+-------+-------+-------|
>> | 2000 | Sonst  | 508 | 507 | 0.85  | 4.91  | 4.93  |
>> #+END_ORG
>> 
>> 
>> I am able to insert additional lines before and after the text produce
>> by the R commands with the following technique (in R):
>> 
>> 
>> print(as.table(NULL),quote=FALSE,type="org")
>> cat("|-------|\n")
>> print(res,type="org")
>> cat("|-------|\n")
>> 
>> 
>> So I could write a line with my multicol headers.
>> But for that to work, org mode would have to honor multicol indicators
>> in the text.
> 
> Alternatively, compose latex or html tables in R and then have the source
> code block :results output latex or :results output html
> 
> That should wrap the output in #+BEGIN_LATEX ... #+END_LATEX, which org
> will export directly to LaTeX, or #+BEGIN_HTML ... #+END_HTML, which org
> will export directly to HTML.
> 
> hth,
> Tom
> 
>> 
>> 
>> 
>> 
>> 
>> On Aug 29, 2012, at 2:28 AM, "Christopher J. White"
>> <orgmode@grierwhite.com> wrote:
>> 
>>> Hi Erich,
>>> 
>>> I have a hack for multicolumn support that may help... It's not
>>> great, but serves my purpose.
>>> 
>>> I implemented a TWiki mode that uses orgtbl-minor-mode.  TWiki pages
>>> support multicolumn cells by adding vertical bars with no
>>> separators:
>>> 
>>> Display:
>>> 
>>> |  Multicol     |
>>> |  C1   |   C2  |
>>> 
>>> TWiki format:
>>> | Multicol ||
>>> | C1 | C2 |
>>> 
>>> Notice the double vertical bars after Multicol.  The number of
>>> vertical bars on every row must be the same.  You can join as many
>>> cells as you want that way.  I basically wanted to be able to still
>>> use orgtbl-minor-mode to edit such tables.  So I hacked my
>>> twiki-import/export code to convert "||" to "| << |" and vice-versa.
>>> 
>>> So the orgtbl version of the above looks like this in the buffer:
>>> 
>>> | Multicol | << |
>>> | C1       | C2 |
>>> 
>>> The down side is that the text "Multicol" will expand the display
>>> size of C1, so if it gets long, the table grows:
>>> 
>>> | This is a long multicol cell | << |
>>> | C1                           | C2 |
>>> 
>>> So it gets me what I want, which is orgtbl editing, and
>>> import/export support to twiki format.  Seems a similar technique
>>> could be backed in to any org export engine.
>>> 
>>> ...cj
>>> 
>>> On 8/28/12 5:10 PM, Neuwirth Erich wrote:
>>>> After some googling it seems that multicolumn support is not yet
>>>> implemented in org tables.
>>>> I would need multicolumn headers quite urgently,
>>>> but I have not yet found a way to make this possible.
>>>> 
>>>> I think that tables with headers like this:
>>>> 
>>>> |               |    mean       |         s.e.        |
>>>> | gender | varA | varB |  varA | varB |
>>>> 
>>>> are quite common, so I really want to put this feature on the wish list.
>>>> I am not able to implement this myself.
>>>> 
>>>> Erich
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
>> 
> 
> -- 
> Thomas S. Dye
> http://www.tsdye.com

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

* Re: Multicolumn
  2012-08-29  7:44       ` Multicolumn Neuwirth Erich
@ 2012-08-29 14:27         ` John Hendy
  0 siblings, 0 replies; 7+ messages in thread
From: John Hendy @ 2012-08-29 14:27 UTC (permalink / raw)
  To: Neuwirth Erich; +Cc: orgmode, emacs-orgmode, Thomas S. Dye

On Wed, Aug 29, 2012 at 2:44 AM, Neuwirth Erich
<erich.neuwirth@univie.ac.at> wrote:
> That is probably what I will have to do.
> But since I want both html and LaTeX output, I have to two write separate output routines
> in R which I had hoped to be able to avoid.

How often do you anticipate having to change this? I've exported org
tables before to get most of the dirty work done and then just gone in
to the .tex (or .html) files manually to tweak. Is that an option?
I'll usually do this when I'm fairly positive that I'm done with any
tweaking/editing of the .org document.

Just a thought.
John

>
>
> On Aug 29, 2012, at 4:39 AM, tsd@tsdye.com (Thomas S. Dye) wrote:
>
>> Neuwirth Erich <erich.neuwirth@univie.ac.at> writes:
>>
>>> My problem is that the tables are produce by R code snippets.
>>> The code snippets produce plain org tables, bracketed by attributes identifying
>>> the text as ORG code.
>>>
>>>
>>>
>>> #+RESULTS:
>>> #+BEGIN_ORG
>>> | Jahr | Region | m   | w   | pWert | m.se  | w.se  |
>>> |------+--------+-----+-----+-------+-------+-------|
>>> | 2000 | Sonst  | 508 | 507 | 0.85  | 4.91  | 4.93  |
>>> #+END_ORG
>>>
>>>
>>> I am able to insert additional lines before and after the text produce
>>> by the R commands with the following technique (in R):
>>>
>>>
>>> print(as.table(NULL),quote=FALSE,type="org")
>>> cat("|-------|\n")
>>> print(res,type="org")
>>> cat("|-------|\n")
>>>
>>>
>>> So I could write a line with my multicol headers.
>>> But for that to work, org mode would have to honor multicol indicators
>>> in the text.
>>
>> Alternatively, compose latex or html tables in R and then have the source
>> code block :results output latex or :results output html
>>
>> That should wrap the output in #+BEGIN_LATEX ... #+END_LATEX, which org
>> will export directly to LaTeX, or #+BEGIN_HTML ... #+END_HTML, which org
>> will export directly to HTML.
>>
>> hth,
>> Tom
>>
>>>
>>>
>>>
>>>
>>>
>>> On Aug 29, 2012, at 2:28 AM, "Christopher J. White"
>>> <orgmode@grierwhite.com> wrote:
>>>
>>>> Hi Erich,
>>>>
>>>> I have a hack for multicolumn support that may help... It's not
>>>> great, but serves my purpose.
>>>>
>>>> I implemented a TWiki mode that uses orgtbl-minor-mode.  TWiki pages
>>>> support multicolumn cells by adding vertical bars with no
>>>> separators:
>>>>
>>>> Display:
>>>>
>>>> |  Multicol     |
>>>> |  C1   |   C2  |
>>>>
>>>> TWiki format:
>>>> | Multicol ||
>>>> | C1 | C2 |
>>>>
>>>> Notice the double vertical bars after Multicol.  The number of
>>>> vertical bars on every row must be the same.  You can join as many
>>>> cells as you want that way.  I basically wanted to be able to still
>>>> use orgtbl-minor-mode to edit such tables.  So I hacked my
>>>> twiki-import/export code to convert "||" to "| << |" and vice-versa.
>>>>
>>>> So the orgtbl version of the above looks like this in the buffer:
>>>>
>>>> | Multicol | << |
>>>> | C1       | C2 |
>>>>
>>>> The down side is that the text "Multicol" will expand the display
>>>> size of C1, so if it gets long, the table grows:
>>>>
>>>> | This is a long multicol cell | << |
>>>> | C1                           | C2 |
>>>>
>>>> So it gets me what I want, which is orgtbl editing, and
>>>> import/export support to twiki format.  Seems a similar technique
>>>> could be backed in to any org export engine.
>>>>
>>>> ...cj
>>>>
>>>> On 8/28/12 5:10 PM, Neuwirth Erich wrote:
>>>>> After some googling it seems that multicolumn support is not yet
>>>>> implemented in org tables.
>>>>> I would need multicolumn headers quite urgently,
>>>>> but I have not yet found a way to make this possible.
>>>>>
>>>>> I think that tables with headers like this:
>>>>>
>>>>> |               |    mean       |         s.e.        |
>>>>> | gender | varA | varB |  varA | varB |
>>>>>
>>>>> are quite common, so I really want to put this feature on the wish list.
>>>>> I am not able to implement this myself.
>>>>>
>>>>> Erich
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>> --
>> Thomas S. Dye
>> http://www.tsdye.com
>
>

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

end of thread, other threads:[~2012-08-29 14:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-29  0:10 Multicolumn Neuwirth Erich
2012-08-29  0:28 ` Multicolumn Christopher J. White
2012-08-29  1:05   ` Multicolumn Neuwirth Erich
2012-08-29  1:47     ` Multicolumn John Hendy
2012-08-29  2:39     ` Multicolumn Thomas S. Dye
2012-08-29  7:44       ` Multicolumn Neuwirth Erich
2012-08-29 14:27         ` Multicolumn John Hendy

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