Tuesday, September 21, 2010

Using kile On School/Faculty Unix Machines

A Simple Latex File

Tex is a computer program that can typeset text and mathematical formulae. Latex is a markup language that uses tex as its typesetting engine. Basically this allows the user to embed commands within a text file that can be interpreted by latex to produce a high quality typeset documents. Kile is a latex integrated development environment (IDE), that means that you can both edit text files and produce typeset documents all in one program, it is available for free as part of any linux distribution. As it is written in Qt it is also available on windows. The interface is similar to that found on windows based IDEs, so learning latex on unix should be the same as learning it on windows.

Open up the program 'kile' from the menu bar. If you cannot find it open a terminal and type 'kile' followed by a return carriage. Once the program has opened, go the file menu and select new. At first select empty document, you can try using the wizard or standard templates at a later date.

Latex commands are always preceded by a backslash, there are predefined commands and the user may also specify their own. There is also a certain structure that must be adhered to. Two of the most common commands are \begin{} and \end{}, that signify the start and end of an environment. Like a good story all latex files need a start and an end, and the document environment signifies the start and end of a document, so all files require \begin{document} and \end{document}. The other requirement is some information about the structure of the document that you are creating. This information must be presented in the preamble (before \begin{document}) with the \documentclass{} command. There are certain default options that can be used, article is a popular choice. For the most simple of latex files enter the following text:

\documentclass{article}

\begin{document}
Some text...
\end{document}
and then save the file in a new directory. Call the file something like "test.tex", with the file ending ".tex".

Once the "tex" has been written, it must be compiled in order to generate a file that can be printed or viewed on screen. A standard file type to convert to is pdf. There are at least 2 ways to generate a pdf, one is to go directly from the latex file to a pdf (using the latexpdf command) or and another is by converting from tex->dvi->ps->pdf. Obviously the second method sounds more cumbersome but if you want to use packages such as pstricks or psfrag to make your document look nice you must use the second method. Luckily kile has a "QuickBuild" option that can run multiple latex commands in one go. Go to Settings->Configure kile and select Tools->Build->QuickBuild, then select Latex->DVItoPS->PStoPDF->ViewPDF from the configuration options. You may need to change the configuration of ViewPDF to acroread.

Now press quick build to preview your latex document...

7 comments:

  1. There are lots of information about latest technology and how to get trained in them, like Shell Scripting Training in Chennai have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies(Shell Scripting Training). By the way you are running a great blog. Thanks for sharing this.

    Shell Scripting Training in Chennai | Shell Scripting Training

    ReplyDelete
  2. This is my first visit to your blog, your post made productive reading, thank you. dot net training in chennai

    ReplyDelete
  3. Great post! I am actually getting ready to across this information, It's very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
    UNIX Training in Chennai

    ReplyDelete
  4. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Android Training in Chennai
    Ios Training in Chennai

    ReplyDelete
  5. Informative article, just what I was looking for.seo services chennai

    ReplyDelete