emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] alignment of description list in Org and export old and new


From: Michael Brand
Subject: Re: [O] alignment of description list in Org and export old and new
Date: Tue, 5 Jun 2012 21:48:11 +0200

Hi Jambunathan, hi all

Jambunathan K <address@hidden> wrote:
> Tables allow for finer control and alignment.  Unfortunately, Org
> doesn't support multi-line tables.  To alleviate this, (Old) ODT
> exporter has a feature called as List-Tables [1].  This feature is not
> available with any other backends [2].
>
> I am attaching the Org file that uses list-tables and the corresponding
> output.

Thank you for showing my example as a list-table. The ODT export you
attached looks exactly how I imagined, with "same line" and "aligned".
For me the most important is how the Org buffer looks like and for
many cases I prefer something that has term and description on the
same line also in the Org buffer. Most associations in most of my
lists of associations have term and description short. Since they have
to be on their own line when put into a list-tables they then take
almost double the number of lines in my Org buffers.

For some years now I have been hacking associations this way:

  | cmd -o              | short term + short descr                |
  | cmd --log-level=err | long term + short descr                 |
  | \ -o <dst> <src>    |                                         |
  | cmd --create        | short term + long descr bla bla bla bla |
  |                     | \ bla bla bla bla bla bla bla bla bla   |
  | cmd --log-level=dbg | short term + long descr bla bla bla bla |
  |                     | \ bla bla bla bla bla bla bla bla bla   |

So far I could put up with some other disadvantages: It takes an extra
effort to edit the wrapping texts despite the help of M-RET
(org-table-wrap-region) and the manually added syntactic sugar "\" to
help in reading. And it is not well suited for export. Of course I
could narrow the table to get also the longer terms and descriptions
into a single cell but then I don't like the cells truncated in the
Org buffer and in the plain text Org file these rows become long and
misaligned.

Since the Org description list is perfect for that as long as only two
columns are needed, I prefer to follow this path, also to be better
prepared for optional export to various formats. I would "just" like
to have more alignment for description list in the Org buffer itself.

For this alignment with M-q (fill-paragraph) and C-c C-c on
description list I suggest a formatting cookie, similar to Org table
where "<19>" on any row narrows the column:
- when any item contains only "<>": align all descriptions to the
  widest term of the list
- when any item contains only "<19>": align all descriptions as if the
  widest term would be 19 wide, if necessary start the description on
  the next line to not hide the rest of a longer term
- when none of the items matches "^<[0-9]*>$": rearrange whitespace
  like now, which means without aligning

Example description lists for the three variants:

  - <>
  - cmd -o                             :: short term + short descr
  - cmd --log-level=err -o <dst> <src> :: long term + short descr
  - cmd --create                       :: short term + long descr bla
                                          bla bla bla bla bla bla bla
                                          bla bla bla bla bla
  - cmd --log-level=dbg                :: short term + long descr bla
                                          bla bla bla bla bla bla bla
                                          bla bla bla bla bla

  - <19>
  - cmd -o              :: short term + short descr
  - cmd --log-level=err -o <dst> <src>
                        :: long term + short descr
  - cmd --create        :: short term + long descr bla bla bla bla bla
                           bla bla bla bla bla bla bla bla
  - cmd --log-level=dbg :: short term + long descr bla bla bla bla bla
                           bla bla bla bla bla bla bla bla

  - cmd -o :: short term + short descr
  - cmd --log-level=err -o <dst> <src> :: long term + short descr
  - cmd --create :: short term + long descr bla bla bla bla bla bla
                    bla bla bla bla bla bla bla
  - cmd --log-level=dbg :: short term + long descr bla bla bla bla bla
       bla bla bla bla bla bla bla bla

Similar to Org table, an item with only this formatting cookie would
be removed automatically when exporting.

The right border of the descriptions still is always according to the
buffer local variable fill-column.

Michael



reply via email to

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