Wednesday, November 12, 2008

Kile and latex features


The people who are typing alot will probably know that latex is one of the most powerful text editors available. Using latex we can have the most accurate and desirable typesetting we want and is very good for writing equations and other mathematical stuff.
The latex requires a platform to be written on, like generally people who write word documents use the openoffice software or microsoft office. Conventionally people have been using VIM or Emacs as the text editor, but now some more versatile editors have developed, kile is one of them.
To give a brief introduction to what latex is and can do, for people who are new to this feature, I will summarize it here first. Unlike word documents where we just enter texts and take the help of the in built functions to give the document a customized look, in latex we can actually do anything by including the package files and knowing the commands to modify the way the text is displayed. It is not just about the text but also about the graphics and the drawings that can be added to the document, the most important benefit of latex is in the typesetting of the equations which can be aligned in a proper way and there is more freedom in modification than just the in built functions in word writers. The latex document begins by inclusion of standard packages and fonts which we have to write the document in, there are various options of making a latex file. We can either choose it to have an article format or a letter or a report and also the thesis. Most of the scientific papers and presentations and the thesis are written in latex and then converted to pdf or ps files using the command line. The start of the document looks like


\documentclass[12pt,notitlepage,axodraw]{report}
\usepackage{setspace}
\doublespacing
%\onehalfspacing
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=1.8in, right=1.5in, top=1in, bottom=1in, includefoot]{geometry}
%\usepackage{a4wide}

\usepackage[hang, small, bf, margin=20pt, tableposition=top]{caption}
\setlength{\abovecaptionskip}{0pt}
%\usepackage{mathpazo}

\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage[english]{babel}
\usepackage{slashed}

\usepackage{fancybox}
\usepackage{fancyhdr}
\usepackage{axodraw}

\usepackage{latexsym}

\begin{document}
\begin{titlepage}
The % before \ indicates that they are not used by the latex editor while compiling and are just like the comments and when we want the latex to use them we can remove % and then they will be included while compilation of the latex document. The spacing of the whole document is affected by the choice \doublespacing or \onehalfspacing. If we do not have to have any specific spacing we can just not mention anything and the document will look like a normal pdf file with normal spacing between the various lines. The other packages are the instructions to use the maths symbols, fonts and graphics packages, so that we can include any diagram and include equations in our document. The special package axodraw is a package to include feynman diagrams involving photons, gluon and quarks in the document.
Next we have the content page and the page numbers, this can be automatically included as we keep writing our document by including the command line
\thispagestyle{plain}
\tableofcontents{}
{}
\nextpage
the command of \nextpage will take the text and diagrams to the next page and all we write in various chapters will be automatically shown in the table of contents with page numbers once we compile the document.
Then we come to having special greek symbols which come now and then in science. Such symbols can be included simply by writing them first between the dollar signs, $. For example i want to write lambda, I will write it as $\lambda$ or if I have to make it capital greek letter I will write it simply as $\Lambda$. This holds true for all the other greek symbols. When we have to include something in subscript or superscript we do this as $\lambda_{QCD}$ and $\lambda^{QCD}$ respectively. Crucial is to specify the braces at the beginning and ending of the quantity written as a subscript or a superscript.
Now we come to writing equations in latex, if we want our equations not to have a number, this will be written as $$ $$\int_{0}^{1}Sin[x] dx $$. The double $$ sign puts the equation in the new line, a single dollar sign will not write it as a new line but will include it as a part of the line it was written after and in the same line. If we want to number our equations, we can do this by writing the equations insde the following
\begin{equation}..............\end{equation}
Where ...... indicate the equation that has to be written. Integrals can be easily written as above by $\int$ such basic symbols can be found on the internet where they have long lists of symbols compiled for use in the latex document and we will not go into that aspect here as it is easily available in the google search!
Now we come to some style of writing the equations. If the equations are big and have to be aligned properly, the begin equation command will make it go out of the paper, better is to use $$\begin{eqnarray}&&............&& &&...........&&\end{eqnarray}
where the dots refer to the part of equation you want to fit in the first line, && symbol marks the start and end of the line, rest of the equation comes in second and sucessiding lines, by use of this technique. However this will start assigning equation number to every line and we probably want only one number or none,so the trick is to put \nonumber at the end of each && operator marking the end of the equation line. So that sorts it out.
Another thing is about using proper braces in these equations, if we just use ({[ as they are, they will appear as they are, but sometime we want them to cover the entire body of the start and end of the equation, we can do this by saying \left( and ending it with \right). However this does not works when we are using eqnarray and trying to set braces across the && in two different lines. But thats ok I guess!
Now it brings us to kile, it is a very good equation editor for latex. it can be downloaded in fedora systems by typing in the command line sudo yum install kile and in ubuntu by sudo apt-get install kile. This has several features like automatic completion of latex commands when we just start writing the command. This also tries to make the word users more familiar with the latex environment as it has a similar template as the word editor. Besides it has the option of choosing the kind of document we want to write with latex, whether a report or an article or anything else, including beamer! Beamer is used for presentations and is a substitute of the windows power point presentation.
The commands for compiling a latex document which is saved as .tex document are simple to follow. in the terminal type in
latex documentname.tex
This will compile the latex document and issue errors in the lines where they are in the document. One of the basic error can be that latex could not find the package you included at the start of the document, this can be removed by simply including the relevant .sty file in the folder where you have the latex document as then the latex will automatically locate it while compiling. Other errors are due to forgotten $ signs or due to not putting } at the end or start. Its very easy to get confused in the braces, like you are typing a fraction with alot of subscripts, $$dfrac{p_{g}.p_{q}}{Q}$$. Here we have to be careful in using the braces and this error will stop the compilation of the document and you wont be able to see anything after this.
After the compilation stage we get a .dvi file,this is converted to a ps file first by typing in the terminal :-
dvips -Ppdf documentname.dvi
Then we can convert the ps file we get by
ps2pdf documentname.ps
And then we have created out pdf file!
Infact linux has many good commands to convert one format to another, which can be installed using yum or apt-get. Like if I want to convert eps to ps I will type in the terminal convert documentname.eps documentname.ps and vice versa.
The eps is the encapsulated post script file which is included in the main latex document. This can be a diagram made in Xfig or a mathematica.nb file to be included in the document.
Once we know these basic steps we can start writing documents, dissertations very easily and diligently using latex. After we are above the barrier of using latex properly typing a document perfectly is only about how good your language skills are! Infact one can also check the spelling by typing in the terminal ispell documentname.tex. Just remember to be in the same folder as your document when typing the commands in the terminal!
Have fun with linux and latex ;). Here is a snapshot of it
http://kile.sourceforge.net/showscreenshot.php?id=7

5 comments:

Anonymous said...

Bonjour I'd like to congratulate you for such a terrific made site!
Was thinking this is a perfect way to make my first post!

Sincerely,
Monte Phil
if you're ever bored check out my site!
[url=http://www.partyopedia.com/articles/unicorn-party-supplies.html]unicorn Party Supplies[/url].

Anonymous said...

Bonjour I'd love to congratulate you for such a terrific quality forum!
Was thinking this would be a nice way to introduce myself!
The only right way pile assets it is usually a clever idea to start a savings or investing strategy as early in life as imaginable. But don't worry if you have not begun saving your capital until later on in life. As a result of honest work, that is investigating the best investment vehicles for your cash you can slowly but surely increase your growth so that it adds up to a large amount by the time you want to retire. Scout out all of the achievable asset classes from stocks to real estate as investments for your money. A smartly diversified portfolio of investments in various asset classes can make your money enlarge through the years.

-Kelly Figura
[url=http://urwealthy.com]currency exchange rates[/url]

Preety said...

You have presented the introduction to latex and kile in such a sophisticated way, it has helped me a lot...
Thanx n wish u all the Best!!

Anonymous said...

Thanks for the good writeup. It if truth be told was once a leisure account it.

Glance complex to more brought agreeable from you! However, how can we keep
in touch?

Here is my site; mein spć³„ster Blogpfosten

Anonymous said...

vapor cigarette, e cigarettes, e cig forum, e cigarette health, smokeless cigarettes, electronic cigarette