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

* Re: writing letters using the latex letters class?
       [not found] <3b807265b1934b80b3aff51a383e8af0@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2016-12-08  7:14 ` Eric S Fraga
  0 siblings, 0 replies; 8+ messages in thread
From: Eric S Fraga @ 2016-12-08  7:14 UTC (permalink / raw)
  To: Stig Brautaset; +Cc: emacs-orgmode

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

On Thursday,  8 Dec 2016 at 00:46, Stig Brautaset wrote:
> 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:

I can't help you directly but you may wish to look at the support for
koma letter class in org/contrib: ox-koma-letter.el.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.1-49-ga43eac

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 162 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: writing letters using the latex letters class?
  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
       [not found]   ` <70bd40970c2d4f6eaf23a514dfc6028f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  0 siblings, 2 replies; 8+ messages in thread
From: Sebastian Christ @ 2016-12-08  8:48 UTC (permalink / raw)
  To: emacs-orgmode

On 2016-12-08 0:46, Stig Brautaset <stig@brautaset.org> wrote:
 > 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.

I can't actually help in using the letter class, but have you checked
"Creating letters with KOMA-Script scrlttr2 and Org-mode" [1]? I've been
using it excursively for all  my /formal/ letter writing and it works
great. Maybe you can give that a try? Plus it produces really nice
letters :) 

Best,

Sebastian


[1] http://orgmode.org/worg/exporters/koma-letter-export.html

-- 
Sebastian (Rudolfo) Christ
http://rudolfochrist.github.io
GPG Fingerprint: 306D 8FD3 DFB6 4E44 5061
                 CE71 6407 D6F8 2AC5 55DD

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: writing letters using the latex letters class?
  2016-12-08  8:48 ` Sebastian Christ
@ 2016-12-08 11:40   ` Stig Brautaset
  2016-12-08 15:05     ` Sebastian Christ
       [not found]   ` <70bd40970c2d4f6eaf23a514dfc6028f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  1 sibling, 1 reply; 8+ messages in thread
From: Stig Brautaset @ 2016-12-08 11:40 UTC (permalink / raw)
  To: Sebastian Christ; +Cc: emacs-orgmode


Sebastian Christ writes:

> On 2016-12-08 0:46, Stig Brautaset <stig@brautaset.org> wrote:
>  > 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.
>
> I can't actually help in using the letter class, but have you 
> checked
> "Creating letters with KOMA-Script scrlttr2 and Org-mode" [1]? 
> I've been
> using it excursively for all  my /formal/ letter writing and it 
> works
> great. Maybe you can give that a try? Plus it produces really 
> nice
> letters :)


It looks promising but I can't get it to work as I expect; is it 
perhaps
not fully compatible with Org 9? After following the instructions 
on
that page to the best of my abilities, and using their example 
document,
my output contains lots of stuff that I expect to be hidden. (E.g. 
all
the to/from special headings etc).

Stig

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: writing letters using the latex letters class?
       [not found]   ` <70bd40970c2d4f6eaf23a514dfc6028f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2016-12-08 13:56     ` Eric S Fraga
  2016-12-08 22:28       ` Stig Brautaset
  0 siblings, 1 reply; 8+ messages in thread
From: Eric S Fraga @ 2016-12-08 13:56 UTC (permalink / raw)
  To: Stig Brautaset; +Cc: emacs-orgmode@gnu.org

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

On Thursday,  8 Dec 2016 at 11:40, Stig Brautaset wrote:

[...]

> It looks promising but I can't get it to work as I expect; is it
> perhaps not fully compatible with Org 9? After following the

Stig,

maybe post an ECM?  Koma letters work fine with me with org 9.  I just
tried.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.1-49-ga43eac

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 162 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: writing letters using the latex letters class?
  2016-12-08 11:40   ` Stig Brautaset
@ 2016-12-08 15:05     ` Sebastian Christ
  2016-12-08 22:21       ` Stig Brautaset
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Christ @ 2016-12-08 15:05 UTC (permalink / raw)
  To: emacs-orgmode

On 2016-12-08 11:40, Stig Brautaset <stig@brautaset.org> wrote:
 > It looks promising but I can't get it to work as I expect; is it
 > perhaps
 > not fully compatible with Org 9? 

No. It's working fine with Org 9.

 > After following the instructions on that page to the best of my
 > abilities, and using their example document, my output contains lots
 > of stuff that I expect to be hidden. (E.g. all the to/from special
 > headings etc).

You need to load `ox-koma-letter' and make sure you're not using the
latex exporter. For letters there is (after loading `ox-koma-letter' of
course) a separate koma exporter.

Best,

Sebastian

-- 
Sebastian (Rudolfo) Christ
http://rudolfochrist.github.io
GPG Fingerprint: 306D 8FD3 DFB6 4E44 5061
                 CE71 6407 D6F8 2AC5 55DD

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: writing letters using the latex letters class?
  2016-12-08 15:05     ` Sebastian Christ
@ 2016-12-08 22:21       ` Stig Brautaset
  0 siblings, 0 replies; 8+ messages in thread
From: Stig Brautaset @ 2016-12-08 22:21 UTC (permalink / raw)
  To: Sebastian Christ; +Cc: emacs-orgmode


Sebastian Christ writes:

> You need to load `ox-koma-letter' and make sure you're not using 
> the
> latex exporter. For letters there is (after loading 
> `ox-koma-letter' of
> course) a separate koma exporter.

Doh! I used the latex exporter. Thanks, I'll give koma another try 
:-)

Stig

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: writing letters using the latex letters class?
  2016-12-08 13:56     ` Eric S Fraga
@ 2016-12-08 22:28       ` Stig Brautaset
  0 siblings, 0 replies; 8+ messages in thread
From: Stig Brautaset @ 2016-12-08 22:28 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode@gnu.org


Eric S Fraga writes:
> Stig,
>
> maybe post an ECM?  Koma letters work fine with me with org 9. 
> I just
> tried.

Yeah, this is a bit embarrassing but it works fine here too now 
that I
use the koma exporter rather than the latex one as Sebastian 
pointed
out...

Stig

^ permalink raw reply	[flat|nested] 8+ messages in thread

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