emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org, Jambunathan K <kjambunathan@gmail.com>
Subject: Re: Re: Composing letters using org-mode and scrlttr2
Date: Sat, 21 Aug 2010 06:52:21 +0200	[thread overview]
Message-ID: <B6A9593F-E373-44DE-B951-800E2A6677A0@gmail.com> (raw)
In-Reply-To: <87wrsf4otd.fsf@gmail.com>

Hi,

Is someone working on producing a clean version of the changes  
required to integrate this?

- Carsten

On Jul 28, 2010, at 4:23 PM, Eric Schulte wrote:

> 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 <kjambunathan@gmail.com> 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
>
> _______________________________________________
> 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

- Carsten

  reply	other threads:[~2010-08-21  4:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-25 21:17 Composing letters using org-mode and scrlttr2 Jambunathan K
2010-07-26 15:21 ` Srinivas
2010-07-26 15:54 ` Bernt Hansen
2010-07-26 16:03   ` John Hendy
2010-07-26 18:47 ` Jambunathan K
2010-07-28 14:23   ` Eric Schulte
2010-08-21  4:52     ` Carsten Dominik [this message]
2010-08-21  8:56       ` Jambunathan K

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=B6A9593F-E373-44DE-B951-800E2A6677A0@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kjambunathan@gmail.com \
    --cc=schulte.eric@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).