From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: Composing letters using org-mode and scrlttr2 Date: Tue, 27 Jul 2010 00:17:40 +0530 Message-ID: <4C4DD84C.4060605@gmail.com> References: <4C4CA9F8.7010006@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=43341 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdSiR-00054f-F5 for emacs-orgmode@gnu.org; Mon, 26 Jul 2010 14:47:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OdSiQ-0000ze-2A for emacs-orgmode@gnu.org; Mon, 26 Jul 2010 14:47:55 -0400 Received: from mail-pv0-f169.google.com ([74.125.83.169]:42430) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdSiP-0000zQ-Pu for emacs-orgmode@gnu.org; Mon, 26 Jul 2010 14:47:54 -0400 Received: by pvc30 with SMTP id 30so355647pvc.0 for ; Mon, 26 Jul 2010 11:47:52 -0700 (PDT) In-Reply-To: <4C4CA9F8.7010006@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org With reference to my earlier post, (http://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg01060.html) I would like to add the following clarification. > #+LaTeX_CLASS_OPTIONS: [a4paper,parskip=full,backaddress=off,foldmarks=off,jambu] All the styling and context-specific information comes from 'jambu' in the LaTeX_CLASS_OPTIONS line. In this case, jambu is 'an lco file' that in turn loads DIN.lco. (The later file comes with the standard distribution) The patch as such doesn't bother with the styling elements but merely transforms content from org to scrlttr2 form. To illustrate, * subject Composing letters using org-mode and scrlttr2 section in org gets transformed in the final letter into the following TeX form. \setkomavar{subject} { \label{sec-2} Sub:- Composing letters using org-mode and scrlttr2 } This is done as part of org-scrlttr2-sectioning defun in my earlier patch. Jambunathan K. ---> Input Org file <--- #+TITLE: #+AUTHOR: #+EMAIL: #+LANGUAGE: #+TEXT: #+LaTeX_CLASS_OPTIONS: [a4paper,fromalign=right,pagenumber=headmiddle,parskip=full,fromphone=true,fromfax=false,fromrule=false,fromemail=true,subject=afteropening,backaddress=off,foldmarks=off,jambu] #+OPTIONS: toc:nil #+LaTeX_CLASS: scrlttr2 * letter Org Mode User Group \\ World Wide Web * subject Sub:- Composing letters using org-mode and scrlttr2 * opening Dear Org Mode Users * body Lately, I have been composing formal letters using KOMA script's sscrlttr2. I found it convenient to have them composed from within org-mode. I am enclosing the initial set of changes needed to compose some simple letters as this one. The only change that is too 'intrusive' seems to be an extra newline which gets added immediately after the emission of labels. These extra newlines trigger syntax errors in the closing{} and encl{} directives. I think rest of the changes could be squeeed in through existing hooks. #+BEGIN_EXAMPLE - (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) - label-list "\n") "\n")) + (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) + label-list "\n"))) #+END_EXAMPLE If there is some general interest, I could work on making a formal patch available. * closing Yours Truly * encl Patch from my work-area. ---> Output Tex file <--- % Created 2010-07-26 Mon 23:19 \documentclass[a4paper,fromalign=right,pagenumber=headmiddle,parskip=full,fromphone=true,fromfax=false,fromrule=false,fromemail=true,subject=afteropening,backaddress=off,foldmarks=off,jambu]{scrlttr2} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{fixltx2e} \usepackage{graphicx} \usepackage{longtable} \usepackage{float} \usepackage{wrapfig} \usepackage{soul} \usepackage{t1enc} \usepackage{textcomp} \usepackage{amssymb} \usepackage{hyperref} \tolerance=1000 \usepackage{pdfpages} \providecommand{\alert}[1]{\textbf{#1}} \title{} \author{} \date{26 July 2010} \begin{document} \begin{letter} { \label{sec-1} Org Mode User Group \\ World Wide Web } \setkomavar{subject} { \label{sec-2} Sub:- Composing letters using org-mode and scrlttr2 } \opening { \label{sec-3} Dear Org Mode Users } \label{sec-4} Lately, I have been composing formal letters using KOMA script's sscrlttr2. I found it convenient to have them composed from within org-mode. I am enclosing the initial set of changes needed to compose some simple letters as this one. The only change that is too `intrusive' seems to be an extra newline which gets added immediately after the emission of labels. These extra newlines trigger syntax errors in the closing\{\} and encl\{\} directives. I think rest of the changes could be squeeed in through existing hooks. \begin{verbatim} - (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) - label-list "\n") "\n")) + (insert (mapconcat (lambda (l) (format "\\label{%s}" l)) + label-list "\n"))) \end{verbatim} If there is some general interest, I could work on making a formal patch available. \closing { \label{sec-5} Yours Truly } \encl { \label{sec-6} Patch from my work-area. } \end{letter} \end{document}