LaTex is a typesetting system that is used to produce publication quality documents. LaTex is predominantly used by academics to produce technical/scientific/journal/conference papers. LaTex began its roots from Tex designed and developed by Donald Knuth around late 1970s. You can read more on the history from here. LaTex was developed by Lesslie Lamport around early 1980s.
LaTex is not for everyone. Most of us who are already very much used to wordprocessors such as Ms Word/LibreOffice Writer, the “point and click toolbar to get everything done” approach cannot be used. Everything is done using special markup or escape sequences of code. However, the benefit is that, you can be assured that the output and formatting is consistent all the time. The file is basically a plan text file, and the LaTex processor handles the processing and generation of the output (either PDF, PS, etc. format). More advantages and disadvantages here.
LaTex does not support Thaana typesetting natively. There are some packages such as bidi or babel that can be used for multilingual/right-to-left language support. LaTex uses packages to add features to the document. Similar to including library at the header when programming. But it wasn’t working out very well for Thaana. So XeTex was the preferred choice. Since I used XeTex for the task in hand, you must be wondering why I have been talking about LaTex all this while. The simple and honest answer is that most of us are familiar with LaTex and we often use it synonymously to refer to Tex style typesetting.
There are plenty of articles about producing documents in LaTex, but none specifically for Thaana/Dhivehi. So after a few hours research, I found out that it is possible to produce a decent document in Thaana. I was pleased with the results, given the nature of typesetting Thaana documents.
Things you would need:
- LaTex installed and running. Instructions for Windows/Mac/Linux here. When you install the LaTex installation from any of the packages, XeTex will also be installed, along with an editor. I would recommend using the editor, however, you can also use any text editor for creating the document. But then you would have to “compile” the document from command line to generate the output.
- Install polyglossia and fontspec installed if they are not already installed along with the LaTex. Polyglossia enables the right-to-left support. If you don’t use it, then the output using the standard packages will produce a mirror image for all the words in Thaana script (even if you type it correctly in the editor). Fontspec allows you to specify fonts that are installed on the system such as “Faruma” or any other unicode Thaana font, instead of the standard fonts that are used by default.
- Make sure your OS (Windows/Mac/Linux) has the Dhivehi/Maldives keyboard installed to allow you to actually type Thaana text in unicode. If you are already typing Thaana in Microsoft Word or LibreOffice, then you’ve probably completed this step.
- Finally install the Thaana unicode fonts that you like and start creating the document. The font that I’ve used is Faruma.
After completing the above requirements, you would have to place the following lines in the preamble before actually creating the content of the document. These lines tell the LaTex engine to use the polyglossia and fontspec packages, and sets “divehi” as the default language (it’s not a typo, that’s how divehi is spelled in this package) and sets “Faruma” as the default language.
The following are the source document and the output in PDF format.
- LaTex source file: dhilatex.doc (This file was uploaded with extension .doc, because WordPress doesn’t allow to upload documents with .tex extension. Please download and rename to .tex extension before opening in the editor).
- PDF output file: dhilatex.pdf
As you can see the bullets are alright, but the numbered list shows the “dot” after the number on the wrong side (in left-to-right format). Like I said before, it’s not perfect. Hopefully I will be posting more updates of my future experiments as this looks quite promising.