emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* writing letters using the latex letters class?
@ 2016-12-08  0:46 Stig Brautaset
  2016-12-08  8:48 ` Sebastian Christ
  0 siblings, 1 reply; 8+ messages in thread
From: Stig Brautaset @ 2016-12-08  0:46 UTC (permalink / raw)
  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

^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <3b807265b1934b80b3aff51a383e8af0@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>]

end of thread, other threads:[~2016-12-09  1:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-08  0:46 writing letters using the latex letters class? Stig Brautaset
2016-12-08  8:48 ` Sebastian Christ
2016-12-08 11:40   ` Stig Brautaset
2016-12-08 15:05     ` Sebastian Christ
2016-12-08 22:21       ` Stig Brautaset
     [not found]   ` <70bd40970c2d4f6eaf23a514dfc6028f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-12-08 13:56     ` Eric S Fraga
2016-12-08 22:28       ` Stig Brautaset
     [not found] <3b807265b1934b80b3aff51a383e8af0@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-12-08  7:14 ` Eric S Fraga

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).