From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniele Pizzolli Subject: [PATCH] ox-koma-letter.el: Add support for section Date: Sat, 02 Jan 2016 12:10:34 +0100 Message-ID: <87lh88zzzzz01o@me.localhost.invalid> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFKTU-0005Wm-H2 for emacs-orgmode@gnu.org; Sat, 02 Jan 2016 06:35:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFKTR-0007z6-6K for emacs-orgmode@gnu.org; Sat, 02 Jan 2016 06:35:56 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:48711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFKTR-0007z2-0V for emacs-orgmode@gnu.org; Sat, 02 Jan 2016 06:35:53 -0500 Received: from mfilter20-d.gandi.net (mfilter20-d.gandi.net [217.70.178.148]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id D9A681720B2 for ; Sat, 2 Jan 2016 12:35:51 +0100 (CET) Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter20-d.gandi.net (mfilter20-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id FVhr2M5_2tEF for ; Sat, 2 Jan 2016 12:35:50 +0100 (CET) Received: from localhost.invalid (host36-211-static.0-79-b.business.telecomitalia.it [79.0.211.36]) (Authenticated sender: me@toel.it) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 500501720A9 for ; Sat, 2 Jan 2016 12:35:49 +0100 (CET) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Disposition: inline Hello, I was really surprised that headlines, that are so common in org-mode are discarded by default in ox-koma-letter. This patch tries to add the support for them. It works for me but requires some work to fit the coding and documentation convention that are still unknown to me. I will be happy to follow your suggestion or if somebody take this code as a minimal implementation to start to work with. Thanks in advance, Daniele --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-ox-koma-letter.el-Add-support-for-section.patch >From 390d93afc95f6151e1bde43ef91b4e31f91ecd01 Mon Sep 17 00:00:00 2001 From: Daniele Pizzolli Date: Sat, 2 Jan 2016 11:48:24 +0100 Subject: [PATCH] ox-koma-letter.el: Add support for section * contrib/lisp/ox-koma-letter.el (org-koma-letter-headline): Add support for section using the text of headline. TINYCHANGE --- contrib/lisp/ox-koma-letter.el | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 3231d34..aea5a9c 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -569,10 +569,34 @@ holding contextual information. Note that if a headline is tagged with a tag from `org-koma-letter-special-tags' it will not be exported, but stored in `org-koma-letter-special-contents' and included at the -appropriate place." +appropriate place. + +If the headline level is greater than one include the headline as +section. This allow to write letter with sections by using +section.lco available at: +. + +Add [sections] to LATEX_CLASS_OPTIONS with: + +#+LATEX_CLASS_OPTIONS: [sections] + +If section.lco is unavaliable the section are exported in the tex +source but not rendered in the final pdf. + +- TODO: add test +- TODO: level n should become n-1, because there is no real + level 1 section +- TODO: check if section are allowed inside other letter keywords +" (let ((special-tag (org-koma-letter--special-tag headline info))) (if (not special-tag) - contents + (progn + (if (= 1 (org-element-property :level headline)) + contents + (progn + ;; TODO find out how to decrease the level by one! + (org-latex-headline headline contents info) + ))) (push (cons special-tag contents) org-koma-letter-special-contents) ""))) -- 2.1.4 --=-=-=--