emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] ox-koma-letter.el: Add support for section
Date: Tue, 05 Jan 2016 19:39:24 +0100	[thread overview]
Message-ID: <878u437twj.fsf@gmx.us> (raw)
In-Reply-To: 878u44zzzz9chq@me.localhost.invalid

Ciao Daniele,

Daniele Pizzolli <dan@toel.it> writes:

>> Whether sections.lco is available is nontrivial.  As I remember the patch,
>> it also imposed level two headings to be sections.
>
> Not really.  With the current patch, all the headings inside the main
> content (that is the first not special tagged heading) are rendered with
> a section level that is one level more than expected because the first
> level is taken away by the main content (because the main content is not
> a section).

That’s fair.

> So there should be some work to adjust the level by adding
> +1.  The behaviour of one level headings is left unchanged because of
> the way ox-koma-letter works, but this can be changed, if there is a
> better approach.

Some notes which are probably obvious to you, but which at least I need to
think about the problem follows.

1. From above, I guess you can take the relative level of the opening
   headline plus one.

2. As I recall, there’s no limitation on the level of the opening in
   org-koma-letter--keyword-or-headline.  It simply takes the first
   headline without a special keyword.  It need not be top level.

It seems you’d have to implement the following:

  - The opening headline is at the relative top level.  /This breaks
    backward-comparability/.  So perhaps only if sections are requested,
    although ox-koma-letter already has WAY too many options and
    configurations.
  - Sections start at (1+ (or "the opening level" "the relative top level")).
  - Bonus: How to configure the mapping of levels to section, subsection
    etc.  E.g. what if I want to use \addsect in stead of sections?  (I
    don’t remember if this is supported by sections.lco; IMO it’s very
    reasonable to just take assumptions according to what is available in
    sections.lco)
  
Some people organizes letters like this with subtree export (re previous
posts to this list).  It must work in that case.

    * letter one
    ** to one :to:
    ** opening one,
       Letter 1 
    * letter two
    ** to two :to:
    ** opening two,
       Letter 1 


>> If you really think this is the right approach, perhaps the "H:" option
>> could be used to set the special heading level...  We’d need this since
>> you can specify the opening with a heading.
>
> I am lost here.  H: should work as expected.  We have the inverse
> problem (go up to the level with sections).

Compare

    #+options: H:2
    * section
    ** frame

and

    #+options: H:1
    * section
    ** frame

in ox-beamer.  Perhaps it’s an overkill for ox-koma-letter.

> Thanks for the info, I admit that LT and kpsewhich are unknown to me, as
> I said I try to stay away from latex and tex as much as possible.  If
> there is some agreement on the patch I will update the doc to add those
> info.

I think it’s best to add a switch (defcustom) either per document or at
least a global variable.  It defaults to nil.  E.g. #+options: sections:t

Thanks,
Rasmus

-- 
And I faced endless streams of vendor-approved Ikea furniture. . .

  reply	other threads:[~2016-01-05 18:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-02 11:10 [PATCH] ox-koma-letter.el: Add support for section Daniele Pizzolli
2016-01-02 20:29 ` Rasmus
2016-01-04 10:27   ` Daniele Pizzolli
2016-01-04 19:41     ` Rasmus
2016-01-05 17:12       ` Daniele Pizzolli
2016-01-05 18:39         ` Rasmus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-01-02 11:10 Daniele Pizzolli

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=878u437twj.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    /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).