From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stig Brautaset Subject: writing letters using the latex letters class? Date: Thu, 08 Dec 2016 00:46:23 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEmr8-0005vC-CQ for emacs-orgmode@gnu.org; Wed, 07 Dec 2016 19:46:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cEmr4-0006V5-Ev for emacs-orgmode@gnu.org; Wed, 07 Dec 2016 19:46:38 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:35323) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cEmr4-0006Up-8T for emacs-orgmode@gnu.org; Wed, 07 Dec 2016 19:46:34 -0500 Received: from mfilter34-d.gandi.net (mfilter34-d.gandi.net [217.70.178.165]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id B78A8A80BE for ; Thu, 8 Dec 2016 01:46:31 +0100 (CET) Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter34-d.gandi.net (mfilter34-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id z4mSh3EP95va for ; Thu, 8 Dec 2016 01:46:30 +0100 (CET) Received: from localhost (host81-131-118-65.range81-131.btcentralplus.com [81.131.118.65]) (Authenticated sender: mailbox@brautaset.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 72290A80C1 for ; Thu, 8 Dec 2016 01:46:29 +0100 (CET) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode I've tried to get a simple letter to export to PDF using the latex letters class, but I can't get it to work in any satisfactory way. I want to get something like the following generated: ,---- | \documentclass{letter} | \signature{Sender McSenderface} | | \address{My address \\ My town \\ My country} | | \begin{document} | \begin{letter}{Recipient name \\ Recipient address \\ Recipient country} | | \opening{Dear Sir or Madam:} | | Aliquam erat volutpat. Nunc eleifend leo vitae magna. In id erat non orci | commodo lobortis. Proin neque massa, cursus ut, gravida ut, lobortis eget, | lacus. Sed diam. | | \closing{Yours Sincerely,} | | \end{letter} | \end{document} `---- I was hoping I could generate that from (something like) the following org document: ,---- | #+latex_class: letter | #+signature: Sender McSenderface | #+address: My address \\ My town \\ My country | #+recipient: Recipient name \\ Recipient address \\ Recipient country | #+opening: Dear Sir or Madam | #+closing: Yours Sincerely, | | Aliquam erat volutpat. Nunc eleifend leo vitae magna. In id erat non orci | commodo lobortis. Proin neque massa, cursus ut, gravida ut, lobortis eget, | lacus. Sed diam. `---- Is this a pipe dream? I tried mucking about with org-latex-classes, and got as far as this: ,---- | (add-to-list 'org-latex-classes | '("letter" | "\\documentclass{letter} | \\usepackage{hyperref} | [NO-DEFAULT-PACKAGES] | [NO-PACKAGES]" | ("\\section{%s}" . "\\section*{%s}") | ("\\subsection{%s}" . "\\subsection*{%s}") | ("\\subsubsection{%s}" . "\\subsubsection*{%s}") | ("\\paragraph{%s}" . "\\paragraph*{%s}") | ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) `---- That at least got me past the "Unknow LaTeX class 'letter'" error, but it doesn't produce a nice letter. I only get my lorem ipsum text. I can't figure out how to get the \begin{letter}{...} stuff inside the \begin{document} part automatically, nor how to inject text from #+recipient: into the second block of the \begin{letter}{...} macro. Any help appreciated. Stig