emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: news1142@Karl-Voit.at
Cc: emacs-orgmode@gnu.org
Subject: Re: HowTo: Letter template method using yasnippet
Date: Sat, 07 Jul 2012 00:35:32 +0200	[thread overview]
Message-ID: <87zk7cplfv.fsf@gmail.com> (raw)
In-Reply-To: <2012-07-06T20-54-34@devnull.Karl-Voit.at> (Karl Voit's message of "Fri, 6 Jul 2012 21:08:24 +0200")

[-- Attachment #1: Type: text/plain, Size: 2715 bytes --]

Hello,

Based on your work, I've put up the attached back-end:
org-koma-letter.el.

Quoting its documentation:

--8<---------------cut here---------------start------------->8---
This library implements a KOMA Scrlttr2 back-end, derived from the
LaTeX one.

Depending on the desired output format, three commands are provided for
export: `org-koma-letter-export-as-latex' (temporary buffer),
`org-koma-letter-export-to-latex' ("tex" file) and
`org-koma-letter-export-to-pdf' ("pdf" file).

On top of buffer keywords supported by `e-latex' back-end (see
`org-e-latex-options-alist'), this back-end introduces the following
keywords: "CLOSING" (see `org-koma-letter-closing'), "FROM_ADDRESS" (see
`org-koma-letter-from-address'), "LCO" (see
`org-koma-letter-class-option-file'), "OPENING" (see
`org-koma-letter-opening'), "PHONE_NUMBER" (see
`org-koma-letter-phone-number'), "SIGNATURE" (see
`org-koma-letter-signature') and "TO_ADDRESS".

You will need to add an appropriate association in `org-e-latex-classes'
in order to use the KOMA Scrlttr2 class.  For example, you can use the
following code:

  (add-to-list 'org-e-latex-classes
               '("my-letter"
                 "\\documentclass\[%
  DIV=14,
  fontsize=12pt,
  parskip=half,
  subject=titled,
  backaddress=false,
  fromalign=left,
  fromemail=true,
  fromphone=true\]\{scrlttr2\}
  \[DEFAULT-PACKAGES]
  \[PACKAGES]
  \[EXTRA]"
                 ("\\section\{%s\}" . "\\section*\{%s\}")
                 ("\\subsection\{%s\}" . "\\subsection*\{%s\}")
                 ("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))

Then, in your Org document, be sure to require the proper class with :

   #+LATEX_CLASS: my-letter

In this back-end, headlines are ignored during export.
--8<---------------cut here---------------end--------------->8---


You can test it on the following Org document:

--8<---------------cut here---------------start------------->8---
#+TITLE: About Org and letters
#+AUTHOR: Nicolas Goaziou

#+TO_ADDRESS: Someone \\
#+TO_ADDRESS: in some town

#+SIGNATURE: ngz

#+LATEX_CLASS: my-letter

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enimad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
--8<---------------cut here---------------end--------------->8---

It's far from being complete. See it as a proof of concept. Feel free to
upgrade it.


Regards,

-- 
Nicolas Goaziou

[-- Attachment #2: org-koma-letter.el --]
[-- Type: application/emacs-lisp, Size: 11855 bytes --]

  reply	other threads:[~2012-07-06 22:38 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-05 12:49 Org/LaTeX set-up for business letters? Thorsten Jolitz
2012-07-05 13:12 ` suvayu ali
2012-07-05 19:00   ` Thorsten Jolitz
2012-07-05 22:00     ` suvayu ali
2012-07-05 22:47       ` Thorsten Jolitz
2012-07-06  8:47         ` Michael Strey
2012-07-06 16:35           ` Thorsten Jolitz
2012-07-06 18:11             ` suvayu ali
2012-07-06 19:11               ` Thorsten Jolitz
2012-07-06 19:23                 ` Bastien
2012-07-06 19:44                   ` Nicolas Goaziou
2012-07-07  2:42             ` Mehul Sanghvi
2012-07-07 11:48               ` Thorsten Jolitz
2012-07-07  1:55         ` Vikas Rawal
2012-07-07 11:58           ` Thorsten Jolitz
2012-07-08 10:34             ` Sebastien Vauban
2012-07-06 19:08 ` HowTo: Letter template method using yasnippet (was: Org/LaTeX set-up for business letters?) Karl Voit
2012-07-06 22:35   ` Nicolas Goaziou [this message]
2012-07-07  0:34     ` HowTo: Letter template method using yasnippet Thorsten Jolitz
2012-07-07  9:35     ` Karl Voit
2012-07-08  9:08     ` AW
2012-07-08 13:34       ` Nicolas Goaziou
2012-07-08 14:57         ` AW
2012-07-27 16:24     ` Extending org-koma-letter.el (was: HowTo: Letter template method using yasnippet) Rasmus
2012-07-29 18:31       ` Extending org-koma-letter.el Nicolas Goaziou
2012-07-31 10:14         ` Luis Anaya
2012-08-03  8:19           ` Nicolas Goaziou
2012-08-03 14:23             ` Luis Anaya
2012-08-03 16:24               ` Bastien
2012-08-04  0:40                 ` Luis Anaya
2012-11-06 15:31                 ` Alan Schmitt
2012-11-13 22:56                   ` Nicolas Goaziou
2012-11-14 16:48                     ` Alan Schmitt
2012-11-20  3:14                       ` Luis Anaya
2012-11-22 16:07                     ` Alan Schmitt
2012-11-22 16:32                       ` Rasmus
2012-11-22 16:40                       ` Nicolas Goaziou
2012-11-23  8:34                         ` Alan Schmitt
2012-11-23 11:51                           ` Nicolas Goaziou
2012-11-26  8:01                             ` Alan Schmitt
2012-11-26 12:48                               ` Bastien

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=87zk7cplfv.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=news1142@Karl-Voit.at \
    /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).