From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: Composing letters using org-mode and scrlttr2 Date: Wed, 28 Jul 2010 08:23:41 -0600 Message-ID: <87wrsf4otd.fsf@gmail.com> References: <4C4CA9F8.7010006@gmail.com> <4C4DD84C.4060605@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=45024 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oe8PM-0006p7-Mr for emacs-orgmode@gnu.org; Wed, 28 Jul 2010 11:19:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oe8PI-0006Zy-QO for emacs-orgmode@gnu.org; Wed, 28 Jul 2010 11:19:00 -0400 Received: from mail-gx0-f169.google.com ([209.85.161.169]:48739) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oe8PI-0006ZL-M4 for emacs-orgmode@gnu.org; Wed, 28 Jul 2010 11:18:56 -0400 Received: by mail-gx0-f169.google.com with SMTP id 4so2309988gxk.0 for ; Wed, 28 Jul 2010 08:18:56 -0700 (PDT) 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: Jambunathan K Cc: emacs-orgmode@gnu.org Hi Jambunathan, This looks very useful, and the output of scrlttr2 looks great. I think two things can be done to make this more accessible to the wider Org-mode community. First it seems (as you mentioned) like the bulk of your changes can be implemented without any change to the Org-mode core, but rather by using existing hooks (e.g. removing newlines in `org-export-latex-final-hook' and defining a scrlttr2 class in `org-export-latex-classes'). Second, a set of step-by-step instructions documenting how to generate a letter from an Org-mode file using your patch would make this much more approachable and would make a good addition to Worg. I look forward to trying this out. Thanks -- Eric Jambunathan K writes: > 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} > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode