How to produce formal Indian-style Letters using Org-mode and OpenDocument exporter


A letter is unlike a text document

Lately, I have been interacting with many Government Departments, submitting applications forms for one reason or the other. In many instances, these applications had to be accompanied by a Cover Letter.

A formal letter is unlike a text document, and type-setting a letter poses a different type of challenge.

The components that make up the letter—the sender, the reciever, the subject line, the reference line, salutation, sign-off, place and date, signature—all have to be placed in specific positions on the paper, and the positions themselves depend on the culture one lives in.

In other words, while producing letters, the relative positioning of elements on the paper becomes a challenge.

That a letter is a beast which is unlike a a text document can be inferred from availability of packages like scrlttr2 – Koma-Script ‘letter’ class, and its Org-counterpart ox-koma-letter.el — KOMA Scrlttr2 Back-End for Org Export Engine.

As I have remarked elsewhere, most Emacs users use LaTeX for typesetting, and they have no need for using OpenDocument Format or LibreOffice. So, I couldn’t find any Emacs Lisp package that will help me author letters using LibreOffice; there are no counterparts to scrlttr2 or ox-koma-letter.el in LibreOffice-world. This meant that I had to scour the web, specifically the Emacs Stack Exchange, for a possible solution. Fortunately, I wasn’t disappointed.(1)

I outline here a quick recipe for how you may produce a formal Indian-style letter using Org-mode and The enhanced OpenDocument Exporter. This recipe is a slightly simplified version of the recipe shared on Emacs Stack Exchange. The solution relies on using a special-type of table, a Trascluded Table, for achieving the desired layout. A Transcluded Table is a type of table that is exclusive to the unofficial OpenDocument exporter . I have written about these tables in How to create a Table with multi-paragraph content & spanned cells using Emacs Org mode.

An Indian-style Letter

An Indian-style Letter

demo-letter

An Org recipe for producing the above letter

#+odt_preferred_output_format: png

#+ATTR_ODT: :target "extra_styles"
#+begin_src nxml
<style:style style:name="OrgVerse"
             style:parent-style-name="Text_20_body"
             style:family="paragraph">
  <style:paragraph-properties fo:background-color="transparent"
                              fo:border="none"
                              fo:margin-bottom="0.21cm"
                              fo:margin-top="0cm"
                              fo:padding="0cm"
                              style:shadow="none" />
</style:style>
#+end_src

#+ATTR_ODT: :widths "3,2,3"
|         |   | [fn:from] |
| [fn:to] |   |           |

Sir / Madam,

#+begin_center
_*Sub*_:  /*Officia dolore excepteur velit sint*/\\
/*Pariatur aliquip magna proident,*/\\
#+end_center

Reprehenderit culpa excepteur pariatur aliquip dolore nulla irure
commodo nisi duis do qui culpa reprehenderit ullamco.  Amet, aliqua
nostrud dolore sunt dolore dolore voluptate labore deserunt ipsum eu
laboris id fugiat do nulla id exercitation et.  Incididunt qui duis
commodo mollit enim velit reprehenderit veniam,.  Minim aliquip id
magna sed ipsum in qui duis enim.  Aute ullamco sunt duis qui aliquip
enim nulla.

Officia voluptate do dolore lorem est velit elit, est cupidatat.
Exercitation cillum do cupidatat irure ipsum culpa laboris.

#+begin_center
Thanking You,
#+end_center

|                     |   | [fn:sign-off]           |
|                     |   |                         |
| [fn:place-and-date] |   | [fn:name-and-signature] |

* Footnotes

[fn:from]

# From

#+begin_verse
548 Market St
PMB 57274
San Francisco, California
94104-5401 US

May 13, 2023
#+end_verse

[fn:to]

#+begin_verse
To

  Free Software Foundation
  51 Franklin Street, Fifth Floor
  Boston, MA 02110
  USA
#+end_verse

[fn:sign-off]

Your Sincerely,

[fn:place-and-date]
*Place*: San Francisco\\
*Date*: May 13, 2023

[fn:name-and-signature]

*The Linux Foundation*
Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close