I have been following the various threads about using the scrlttr2 class. However, none of them quite worked for me.

I have come up with the following hack using Babel. There are three files attached which illustrates the general principles.

* koma variables which don't change are defined in an LCO file.
* koma variables (toaddress, etc) which change between letters are defined using org PROPERTIES.
* a letter template in defined in a latex src block.
* The letter body is written in an org_mode src block.
* The final letter is produced by tangling the body, the lco file and the letter template.

In normal use you would simply modify the PROPERTIES and body text to suit each letter. The whole thing can probably be made into a yasnippet.

Suggestions for improvement welcome, as the existing stuff is just a quick hack.

Happy Christmas everyone and best wishes for the New Year.

Ian.
\ProvidesFile{dalek.lco}[%
 2002/07/09 v0.9a LaTeX2e unsupported letter-class-option]


\usepackage{fontspec}
\usepackage[english] {babel}
\usepackage{marvosym}

\KOMAoptions{backaddress=off}

% Make the toaddress flush left with the body text.
% Default is to position it further left.
% Obtained from nowindow.lco by Markus Kohm.
\@setplength{firstheadwidth}{\textwidth}
\@setplength{toaddrhpos}{\oddsidemargin}
\@addtoplength{toaddrhpos}{1in}


% ==============================================
% PERSONAL DATA
% ==============================================
\newkomavar{mobile}
\setkomavar{fromname}{The Black Dalek}
\setkomavar{fromaddress}{Traffic Enforcement HQ Skyro City Skyro}
\setkomavar{fromphone}{1-800-dalek}
\setkomavar{mobile}{Top Secret}
\setkomavar{fromemail}{extermin...@dalek.com}

\setkomavar{signature}{The Black Dalek}
\setkomavar{subject}{Illegal Parking}

% ==============================================
% FORMATTING STUFF
% ==============================================

% === font settings
\defaultfontfeatures{Mapping=tex-text}
\setmainfont {STIXGeneral}
\setsansfont {Impact}

% date
\usepackage[english]{isodate}
\usepackage{datetime}
\renewcommand{\dateseparator}{-}
\newcommand{\todayiso}{\the\year \dateseparator \twodigit\month \dateseparator 
\twodigit\day}

% Set the date to flush left.
\setkomavar{date}{\todayiso}
\setkomavar{date}{\flushleft\vspace{-\baselineskip}\today\par}


%set the font size and leading
\renewcommand{\normalsize}{\fontsize{12.5}{17}\selectfont}

% === header settings
\firsthead{
 \centering
    {\addfontfeature{LetterSpace=20.0}\fontsize{36}{36}\selectfont\scshape 
Traffic Enforcement\\[5mm]
  \fontsize{18}{18}\selectfont\scshape\usekomavar{fromaddress}}\\
  \fontsize{12}{12}{\Large \Email}\usekomavar{fromemail} {\Large 
\Telefon}\usekomavar{fromphone} {\Large \Mobilefone}\usekomavar{mobile}

}

% === footer settings
\firstfoot{
 \centering
  \usekomavar{fromaddress} \\
  \usekomavar{fromemail} \usekomavar{fromphone}
}

\endinput

Attachment: dalek_letter.org
Description: Lotus Organizer

\documentclass[dalek, subject=afteropening, subject=left]{scrlttr2}

\begin{document}

\begin{letter}{%

}
\setkomavar{toname}{Dr Who}
\setkomavar{toaddress}{The Tardis\\ Gailfrey-on-Sea\\ Galifrey}
\setkomavar{subject}{Illegal Parking.}
\opening{Dear Doctor Who,}


It has come to our notice that your Tardis was illegally parked on
the streets of the capital city of Skyro. Accordingly I am instructed
to issue with a fine of 10,000 Galactic Credits. If you pay within 7
days there is a discount of 2,000 Galactic credits.

Failure to pay may result in your Tardis being towed away and
crushed. Also, you will be exterminated!



\closing{Regards}


\end{letter}
\end{document}

Reply via email to