Saturday, December 5, 2020

Extract data from PDF in Debian

Every one of us in our lifetime have encountered a PDF file from which we need to extract the texts from it. There are commercial solutions and some free solutions available in the web. In Debian for most of the time there is an application called Ghostscript that would have been installed by default. By using Ghostscript we can extract our textual data from PDF with no hassle. If it's not installed you can use synaptic package manager to install it or you can use the command line to install. 

apt-get install ghostscript

Now open your terminal and type the following command

/usr/bin/gs  -sDEVICE=txtwrite -o output.txt input.pdf

That's it. You can now check the output.txt in the working directory to check your data.

Reference:

https://stackoverflow.com/questions/3650957/how-to-extract-text-from-a-pdf


Wednesday, November 25, 2020

General Tips For Writing a Formal Letter

  • Your letter should be simple and focused; make the purpose of your letter clear.
  • The subject is optional,but is highly recommended since the letter will not be opened by the intended recipient first. It should start with either subject: or Re:
  • The subject (if you include one) should be left-aligned for full block format, but can be either left aligned or centered for modified block format.
  • Have an margin of 1 in on all sides
  • Use a std font size of 10pt or 12 pt.
  • It is also appropriate to use “To Whom It May Concern” when you are making an inquiry (also known as a prospecting letter or letter of interest), but don’t have details of a contact person.
  • If you are writing to someone whose name you don't know, "Dear Personnel Manager (or other job title)" and "Dear Sir or Madam" are acceptable.
  • Address recipient by personal title. You can address the recipient by starting with "Dear" followed by a personal title, such as Mr. or Ms. If you have the full name of the recipient of your business letter, you can enhance the formal nature of the letter by starting with "Dear" followed by a personal salutation, such as "Dear Ms. Levatson."
  • When in doubt, use Ms. If you want to use a personal title ahead of a female recipient's full name, but you are unsure of her marital status, it is always best to use the title "Ms." followed by the recipient's name instead of Miss or Mrs.
  • Single space your letter and leave a space between each paragraph.
  • Use a serif font like Times New Roman.
  • Left justify your letter.
  • Leave a blank line after the salutation and before the closing.
  • Use the modified block layout since it looks modern and stylish.

References

1. https://www.indeed.com/career-advice/career-development/business-letter-salutation
2. https://www.lexico.com/grammar/how-to-lay-out-a-letter
3. https://www.thebalancecareers.com/sample-letter-format-2063479
4. https://www.dailywritingtips.com/how-to-format-a-us-business-letter/
5. https://www.thebalancecareers.com/business-letter-layout-example-2059703
6. https://penandthepad.com/format-cover-letter-2068849.html
7. https://www.writeawriting.com/letter/formal-letter-format-rules-guide-examples/
8. https://www.letterwritingguide.com/businessletterformat.htm
9. https://letterslibrary.com/writing-tips/structure-of-letters/  --good ref

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. 

Monday, October 19, 2020

You too can easily write in Hindi in Linux using IBus

 

 Yes you read that right, you can easily write in Hindi using IBus in Linux. Select itrans transliteration method for the Devanagari writing system.  Open your favorite editor and you can now type in Hindi. I am giving the keymap for the letters all you had to do is combine them.

Vowels

 

Consonants

 

 

 

 

 

 
 

 Numerals

 

Ligatures 


 






References:

1. https://www.aczoom.com/itrans/html/dvng/dvng.html


Friday, October 16, 2020

Best Fonts for writing in Tamil in Debian Linux

 
Today there are many fonts for Tamil language, some fonts supports the sri [ஶ்à®°ீligature and some don't, also most fonts renders the word à®°், à®°ி, à®°ீ as à®°், à®°ி, à®°ீ. There is no balance between these renderings. The Tamil Nadu govt in order to avoid the confusion specified that  à®°், à®°ி, à®°ீ should be rendered as  à®°், à®°ி, à®°ீ and most of the people become accustomed to this usage and moved on. As for the Word à®¶்à®°ீ it is a ligature of ஶ் + à®°ீ so some fonts renders à®¶்à®°ீ  as  ஶ்à®°ீ. In my opinion these are some of the best Tamil fonts. 

1. Lohit Tamil Classical


This font by Red Hat renders the words properly and also looks more professional and antique. As the word classical implies the word னை will be rendered as à®©ை. This was how the word was written before the 70's. Here is a look of how this font looks.

ஶ்à®°ீ கிà®°ுà®·்னர் வந்தாà®°். அனைவருà®®் வணக்கம் செலுத்தினர்.



2. Noto Serif Tamil


This Font by  Google is the next best font. it renders  the  word  à®°், à®°ி, à®°ீ  as  à®°், à®°ி, à®°ீ


 à®¶்à®°ீ à®•ிà®°ுà®·்னர் வந்தாà®°். அனைவருà®®் வணக்கம் செலுத்தினர்.



3. TAU Series Fonts


The TAU series of fonts are released by Tamil Virtual Academy[TVA]. There  

is  also  TAU- Elango series also released by TVA don't get confused with

that series  of  Fonts.  Of all the fonts TAU-Barathi  has good font 

shape and renderings. Its also  like  Noto  serif Tamil.

ஶ்à®°ீ à®•ிà®°ுà®·்னர் வந்தாà®°். à®…னைவருà®®் வணக்கம் செலுத்தினர்.

There you have it. I believe these three fonts  are enough for professional looking documents written in Tamil language.


References:


1. http://www.tamilvu.org/tkbd/Tamil_Unicode_G.O.zip

2. https://logic10.tumblr.com/post/25302495177

Thursday, October 15, 2020

Easy way to write in Tamil in Linux Using Ibus

 In the last post I had written on how to use IBus. Now we will see how to write in Tamil. When you select Tamil in the preferences it will give you a wide range of options such as Phonetic,Tamil99, Vutam, Inscript , Typewriter, Itrans and lk-renganathan. Of these use the phonetic and Tamil99  which are easier to write. One limitation is that it does not support the Tamil99 extended characters, viz the Tamil numeral for 10,100,1000 and fractions
Keymap for Tamil Phonetic

vowels


Image showing tamil vowels and its keymap




Consonants

Image Showing tamil Consonants and its keymap


Grantha Words 

The word க்à®·  is a ligature of க+à®·, and similarly ஶ்à®°ீ is a ligature of  ஶ் +à®°ீ . To write  க்à®·  properly in Tamil phonetic layout do the following.
 
First type à®·் then move your cursor before à®·்   and type க் then go over to your next word it will render it as க்à®·். Similary  for க்à®·ி  first type à®·ி move your cursor before à®·ி and   type க் then go over to your next word now it will render it as à®·ி 

Image Showing Grantha words and its keymap

* in Tamil99 layout. 

Tamil99 Keymap for Grantha Words

For the Grantha words one can use Tamil99 layout and for others phonetic layout as it is easy to write in tamil using phoentic layout.

image showing grantha word in tamil99 keymap




image showing grantha word and its  tamil99 keymap


image showing grantha word and its  tamil99 keymap


image showing grantha word and its  tamil99 keymap


image showing grantha word and its  tamil99 keymap

image showing grantha word and its  tamil99 keymap

Tamil Numerals And Special Characters 


In the Tamil language numerals are represented by letters and also there are special ligatures, we have to use the Tamil99 input method for writing this special characters

image showing tamil numerals and its tamil99 keymap



Image showing special characters and its tamil99 keymap


References:




Wednesday, October 14, 2020

Writing in Indian Launguages in Linux using IBus


To compose a document other than in English you need transliteration software. In Linux there is one such software that is IBus.Through IBus you can write in any language with ease. 

Installation

 In Debian start the synaptic package manager click the search button  and type IBus in the search field and press enter.

Image showing synaptic package manager with the search dialog box
Synaptic Package Manager

 Now scroll down and select IBus it will show the dependencies of the packages click ok and again the same with IBus-m17n and click apply in the taskbar. Make sure you have m17n-db package is installed before installing IBus.  

Location & Usage

After installation configure your system to make IBus starts when you login.IBus is typically located in your systray. It will show as EN.

image showing the xfce systray with IBus input system

This is your default locale setting. Now right click that icon in your panel and click preferences, a dialog box will open up and then goto Input Method 

Image showing the IBus Preferences Dialog box
IBus Preferences Dialog Box

 

Click the Add button and click the … in the bottom it will show you more choice and scroll down and you can now select your desired Indian language to write. 




Image showing the input method selection screen after clicking the add button


 

Image showing the indian language Tamil option







Image showing the type of input method to be selected after selecting the Tamil Language


Image showing the input method options when we right click the IBus interface in the systray

The Indian languages supported in IBus are Assamese, Bengali, Devanagari, Gujrati, Malayalam, Marathi, Tamil, Telugu, Kannada, Kashmiri, Maithili, Oriya, Punjabi, Sanskrit and Urdu. You can now open your favourite text editor and left click the Ibus icon in your systray to select your language or pressing ctrl+spacebar to change the language.

Popular Posts