emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: Jambunathan K <kjambunathan@gmail.com>, Org Mode <emacs-orgmode@gnu.org>
Subject: Re: alignment of description list in Org and export old and new
Date: Tue, 5 Jun 2012 21:48:11 +0200	[thread overview]
Message-ID: <CALn3zojmSsa5t+10P+MA5B1ocwPfZOsqB5Cx+CUgui+vUuJNvw@mail.gmail.com> (raw)
In-Reply-To: <817gvneojj.fsf@gmail.com>

Hi Jambunathan, hi all

Jambunathan K <kjambunathan@gmail.com> 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	other threads:[~2012-06-05 19:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-02  9:18 alignment of description list in Org and export old and new Michael Brand
2012-06-04  3:36 ` Jambunathan K
2012-06-05 19:48   ` Michael Brand [this message]
2012-06-09 12:26     ` Nicolas Goaziou
2012-06-10 16:39 ` Michael Brand
2012-06-12 12:37   ` Nicolas Goaziou
2012-07-31 15:33 ` Michael Brand
2012-08-01 14:09   ` Michael Brand
2012-08-01 14:17     ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALn3zojmSsa5t+10P+MA5B1ocwPfZOsqB5Cx+CUgui+vUuJNvw@mail.gmail.com \
    --to=michael.ch.brand@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kjambunathan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).