Wednesday, November 19, 2008

Tex.LaTeX..TeX..LaTeX...TeX...LaTeX....TeX....LaTeX.....TeX.....LaTeX

Hi ,
I just finished writing my Masters Thesis report...great relief...some free time to watch the season change...Fall, to be specific. I have a lot of experience writing lifeless documents, but believe me, the last one I did was real piece of satisfaction, no grappling with any formatting mismatches. How did this happen??....OK this is the reason why I am putting together my lazy butt to write this Blog. I was not a great open-source enthusiast or anything...yeah but I love the concept of 'free software'...(of course, if It was not written by me ;o)) ....jokes apart..cheers to the community!!.
I have an experience to share...which many of the document gurus would know since birth...but still just wanted to gather minimum details in simple words for someone impatient like me, unaware of LaTeX.... I am talking about LaTeX....as in Documentation using LaTeX. In this blog I will show you how to setup LaTeX, without spending a cent(पैसा). Without wasting any more time lets get started.

Sitting on a MS Windows machine? does not matter...
Installing LaTeX:
1। First you need to install Miktex on your machine. Dont ask me why!
http://miktex.org/
  • Tip: it takes some time to download....
2. Install a text-editor to edit your documents . I used Crimson Editor which supports formatting for LaTeX documents. Crimson Editor is a quality text editor, in my opinion, and is free!!!
  • Available at: http://www.crimsoneditor.com/
3. Customizing Crimson editor: Crimson provides customizable functions which can be modified as required....simply said, SHORTCUTS
Go To Tools> Preferences>Tools>User Tools
Enter Menu Text, Command, Argument, Initial Directory etc.

LaTeX documents need to be compiled! yeah u heard it right but this little effort is justified....why? you will realize soon!

For example to compile my LaTeX doc and see the resulting PDF I did the following:
  1. Compile TeX file: Produces DVI (device independent output) file. --> abc.dvi
  • Menu text: Compile TeX
  • Command: Path\to\Miktex\bin\directory\latex.exe
  • Argument:$(FileName)
  • Initial dir: $(FileDir)
2. Configure Yap( Yet another Previewer) to preview how ur document looks...

  • Menu text: Open File using Yap
  • Command: Path\to\Miktex\bin\directory\yap.exe
  • Argument:$(FileTitle).dvi
  • Initial dir: $(FileDir)
3. Create quality pdf documents:
  • Menu text: Create PDF
  • Command: Path\to\Miktex\bin\directory\dvipdfm.exe
  • Argument:$(FileTitle).dvi
  • Initial dir: $(FileDir)

Apply > OK

4. Thats it....look up a sample latex doc in google is all u need to produce flawless documentation. By flawless I mean...auto-equation numbering, Table of COntents, Sections, Appendix andBibliography taken care of in a fairly intuitive, organized and reusable way.

5. Oh!! what about diagrams, graphs, charts?? Yes your LaTeX document requires all the images, diagrams charts be available in encapsulated post script (.eps) format....well...help is available on the next line:

Check out ImageMagick: http://www.imagemagick.org/script/binary-releases.php


For example: on a Windows machine
Save Excel charts as .bmp or jpg images using MSPaint. I assume you have downloaded and installed ImageMagick by now,
just open a command prompt and type:
convert abc.jpg -compress none eps2:abc.eps

Now include this figure in your document using this simple macro:
\begin{figure}[htbp]
\centering
\includegraphics[width=12cm, height=9cm]{abc.eps}
\caption{Figure Caption goes here}
\label{fig:reference}
\end{figure}

you are smart enough to customize dimensions, caption and label for figure

Voila! you have ur eps figure ready to be embedded in your document!!



if you chose to write ur thesis using LaTeX, your school will probably have a template, besides a lot of useful online material available..just like this one[;-)]..

So, if you have a comment or two ..would like to hear from you!!

and as all LaTeX guides end with, "Happy LaTeXing!"