Showing posts with label Letter. Show all posts
Showing posts with label Letter. Show all posts

Saturday, December 12, 2020

Some Essential difference in Writing a letter in Tamil using XeLaTeX

 
Typesetting  a Tamil letter in XeLaTeX is essentially the same as typesetting a letter in  English.But it has some significant difference. I will list it out below. 

1. Load the Polyglossia or Babel Package

To typeset in Tamil  one has to load either the polyglossia or Babel package. 
Add the following to your preamble.

\usepackage[babelshorthands=true]{polyglossia}
\enablehyphenation
\setmainlanguage{tamil}
% if you need English
\setotherlanguage{english}
\setmainfont{TAU-Barathi}[Renderer=Harfbuzz,Ligatures=TeX,Script=Tamil]
% if you need English then set the font
\newfontfamily\englishfont{Times New Roman}[Scale=MatchLowercase,Renderer=Harfbuzz,Ligatures=TeX]  
 
OR if you are using the Babel Package then add the following to your preamble 

\usepackage{babel}
\babelprovide[main, import]{tamil}
% if you need English
 \babelprovide[import]{english}
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TAU-Barathi}[Renderer=Harfbuzz,Ligatures=TeX,Script=Tamil]

% if you need English then set the font
\newfontfamily\englishfont{Georgia}[Scale=0.98,Renderer=Harfbuzz,Ligatures=TeX]

2. Date is Messed up. 

If you want the date to print automatically it follows Year-Month-date format Since  most people Follow either dd/mm/yyyy or month-date-year format. So you have to set manually the date, to do this load the datetime package
 
\usepackage{datetime}
\date{dd/mm/yyyy}   or
\date{month date, year} 

3. You Can't use \cc or \encl command  

Unless you create your own class and style it is impossible to use the native \cc and \encl command in the letter class. However we can do it manually in the letter class. Since CC and Enclosures are placed after the signature we manually  typeset them.
In Tamil cc is typed as நகல்  and enclosures as இணைப்புகள்.You can use the following commands after the signature in letter.

\par
நகல்:{\par\hspace{10mm}{1. அ \par\hspace{10mm} 2. ஆ}}
\par
இணைப்புகள்:{\par\hspace{10mm}
{2. அ \par\hspace{10mm} 2.ஆ}}
 

Saturday, November 21, 2020

Writing a Letter using Latex

Latex is a typesetting system which follows the WISWYM paradigm.It can be used to   typeset any kind of document such as books,reports and even letters.  

To write a letter in you have load the letter class. By default it uses the modified block layout.

Important Packages to Load:

These are the important packages to  load in my perspective, they are

  • Nag 
  • Inputenc
  • fontenc
  • microtype
  • setspace
  • datetime
  • block [if you need the full block layout]

 The package Nag is to prevent from running obsolete or depreciated commands.  

Inputenc  is for loading unicode encodings and fontenc is for the extended character set.

 The microtype package is for character protrusion and font expansion, furthermore the adjustment of interword spacing and additional kerning, as well as hyphenatable letter spacing (tracking) and the possibility to disable all or selected ligatures.

The set space package as the name indicates sets the line spacing. The datetime packages helps modifies the date to our liking. 

Some website may say use the newlfm and isodoc packages but compare to them this package doesn't have any other options and works within the letter class makes it an ideal package for the letter layout

 code for loading the packages:

\RequirePackage[orthodox]{nag}                         \documentclass[a4paper,12pt,oneside]{letter}        \usepackage[utf8]{inputenc}                             \usepackage[T1]{fontenc}              \usepackage{microtype}                  \usepackage{setspace}                           \usepackage[nodayofweek]{datetime}

Page styles:

The letter class supports the following styles

        1. Headings
        2. Empty
        3. First Page
        4. Plain      

We  will be using the page style empty. The code to load the style is 

\pagestyle{empty}  

  Writing the letter:

We are using the empty page style,by default the letter class leaves an 1 inch space for the header and another 1.5 in for the top margin. We will be removing the header in our document. This will make sure there will be 1.5 inch margin from top,left and right.

The commands supported inside the document are 

          1. \address
          2. \signature
          3. \name
          4. \location
          5. \telephone  
          6. \opening
          7. \closing
          8. \encl
          9. \cc 

We begin the document by \begin{document}  in the letter the address of the sender is first written.  The From address is typed within the \address command. using \\ for starting a new line. The \signature command  as the name implies will put your name in closing leaving a space for you to manually sign your letter.

     \begin{document}   

     \address{type your address}             

     \signature{your name}

We begin the letter with the \begin{letter} followed by the receipient address. Next we add the opening greeting of the letter with \opening  followed by the subject of the letter. There is no command for the  subject. The subject must be below 1pt from the  opening and should be left justified  so we use the \begin{spacing} environment were we write our  subject.

   \begin{letter}{receipient's address} 

Before the \opening run the following  commands so that there won't be  a huge space from the top. Use the following commands with caution.If you have an header file then you shouldn't use this command. 

     \makeatletter
  \def\@texttop{}
  \setlength\headheight{0\p@}
  \setlength\headsep{0\p@}
  \setlength\footskip{0\p@}
  \setlength\topmargin{20pt}
  \setlength\footnotesep{0\p@}
  \setlength{\skip\footins}{0\p@}
  \makeatother

               \opening{Dear sir/Madam}
               \begin{spacing}{1}
                 \begin{flushleft}
                    Re: Your subject
                 \end{flushleft}
               \end{spacing}

After this write your content of the letter. A business or formal letters should be a one  page document. Finish the letter with the \closing{Regards,} command. If you have  enclosures with the letter then run the \encl{\\1. xy \\2. xx} and if you have multiple receipients then you should add courtesy copy command          \cc{\\1. aa \\2.bb

End the document with \end{letter} and \end{document}. The signature and closing might not be adequately right justified so use the \hfill command within that command. Finally save the file and compile in pdflatex and if compiled successfully it will produce a pdf containing your letter which you can now print. 

Popular Posts