Latex Tutorial

TeX is a program for typesetting documents, created by D.E. Knuth.
It is created for helping authors and publishers to typeset or prepare documents for any kind of printers. LaTeX, written by L.B. Lamport, is a type of TeX. It is suitable for the production of long articles and books since it has many useful features for automatic referencing.

Refer to the LaTeX Companion book for the complete info on LaTeX. Otherwise, use Google or follow the links I provide here for quick tutorials.


Installation of LaTeX (for Windows)

Here we only consider the latest version of MiKTeX (June 2008 - MiKTeX 2.7). MiKTeX is a free version of LaTeX for Windows. Follow the instructions below for the installation of MiKTeX.

  1. Download MiKTeX installation package from http://www.miktex.org (or download locally from Intranet here)
  2. Go inside the "setup" directory and double click "setup-2.7.2960.exe".
  3. Follow onscreen instruction. Make sure that you add the MiKTeX directory to your path environment.
  4. Install Ghostscript and Ghostview.
  5. Install Adobe PDF Reader.
  6. Install LaTeX editor. I use WinEdt.

Installation of Thai LaTeX

  1. You must complete the installation of MiKTeX, ghostscript and ghostview. Here we assume that the install location for MiKTeX is at "C:\Program Files\MiKTeX 2.7"
  2. Download the file "All_MiKTeXThai.zip" and unzip the file into a directory. (Download locally from Intranet here)
  3. Unzip the file "ThaiMiKTeX.zip" and place the directory name "ThaiMiKTeX" at "C:\Program Files\MiKTeX 2.7"
  4. Unzip the file "lthuni.zip" and place the file "lthuni.enc" in the directory "C:\Program Files\MiKTeX 2.7\dvips\base"
  5. Unzip the file "thai.zip" and place the file "thai.map" in the directory "C:\Program Files\MiKTeX 2.7\dvips\config"
  6. Unzip the file "afmfont.zip" and place the directory "thai" in the directory "C:\Program Files\MiKTeX 2.7\fonts\afm\public"
  7. Unzip the file "tfmfont.zip" and place the directory "thai" in the directory "C:\Program Files\MiKTeX 2.7\fonts\tfm\public"
  8. Unzip the file "type1font.zip" and place the directory "thai" in the directory "C:\Program Files\MiKTeX 2.7\fonts\type1\public"
  9. Unzip the file "vffont.zip" and place the directory "thai" in the directory "C:\Program Files\MiKTeX 2.7\fonts\vf\public"
  10. Unzip the file "tlatex.zip" and place the files (sw.bat, swath.exe, tlatex.exe) in the directory "C:\Program Files\MiKTeX 2.7\miktex\bin"
  11. Unzip the file "fontdef.zip" and place the files in the directory "C:\Program Files\MiKTeX 2.7\tex\generic\babel"
  12. Use "notepad" to open the file "Add_to_updmap.cfg" and copy the text to the end of the file "C:\Program Files\MiKTeX 2.7\miktex\config\updmap.cfg" using "notepad". Save the file "updmap.cfg".
  13. Open your command prompt and update the font map of MiKTex by issuing this command "C:\Program Files\MiKTeX 2.7\miktex\bin> initexmf -v --mkmaps -u" twice. Each time will take approximately 5 minutes. Make sure that you have no other program running on your machine.



Example of Thai LaTeX document

Note for WinEdt user: If you are using WinEdt as your LaTeX editor. Go to "Options", "Preferences". Change the font by clicking on the Font button to Tahoma with "Thai" scripting, Extra Line Spacing: 1 and Extra Char Spacing: 1.

  1. Download the file "thaitest.ttx" and open the file in WinEdt. You will notice the Thai characters in the file.
  2. Open up command prompt and issuing this command to reorganize the Thai characters in the file. "swath -f latex -d "C:\Program Files\MiKTeX 2.7\ThaiMiKTeX\SWATH" < thaitest.ttx > thaitest.tex". The file "thaitest.tex" will be created.
  3. Open "thaitest.tex" in WinEdt and notice the difference between "thaitest.ttx" and "thaitest.tex".
  4. Click the "LaTeX" button twice to compile the dvi file. Then click on "dvi->pdf" button to create the pdf document version of the document. Now you can view the output document using Adobe PDF Reader.

Note: For students senior project, you will only use one page of Thai LaTeX. I recommend that students work together to setup a machine that has Thai LaTeX install. Create one page document for the Thai version of your senior project abstract and add the page in the final PDF version of your senior project later.

Acknowledgement: Thai MiKTeX

- Back to Home -