Time Pass, But Serious...Let's Learn Latex...
I am a novice to Latex. Even though I started quite late, now I am an ardent fan of this wonderful typesetting program. It is the ``real'' user friendly type setter. No more jumping of figures here and there; No more the error message ``this program has created an illegal operation''; Intricate referencing according to all those journal styles is no more a pain; and more importantly, No more the frustration of being ``ditched by your favorite typesetter'' at the crucial moment. It has changed my views of writing within this short interval of time. Never before was there a pleasure in typesetting!
This page is dedicated to all those people who has worked and is still working for the betterment of this marvelous program. Since I didn't have a predecessor in my department for Latex, it took little bit more time for me to get into. That made me think of putting some routinely used expressions in scientific writing together in one page. Most of these are just `cut and pasted codes' from various sites during my learning process. The following codes might not be the best one to do the particular job, but, will definitely work as most of them I myself have tested in my documents. But, I do not take any responsibility for the contents of this page (as they are from the `trial and error' experiments of a novice!). So, if anyone plan to use the following codes, it will be better if he/she try it on a test document first. But, I sincerely hope this might be of some use - at least to a beginner.
Some info: - may be helpful only to an `ignorant' Chemist like me ):
Join TUG list - The best way to learn Latex is to be in a discussion forum.
The ``Not so short introduction to Latex'' and TUG list tutorials are excellent first hand reference materials while writing.
Chemdraw is a good program (Though a hard core linux fan, sometimes we, the chemists, have to depend upon some of these windows based programs to get our work done. I personally feel that this is one of the main reasons why most of the chemistry labs still depend on windows machines) to draw chemical structures. Save them directly as foo.eps for using in Latex to retain the quality to the maximum level.
Use at least Origin to draw the figures. I have seen the more `popular' ``Sigma Plot'' offers less options for saving files in different formats. I found Origin more reliable than Sigma Plot. If you are using Origin, use fonts like `Times New Roman' (and not the proprietary fonts) in the graphics so that you will face less problems on your file conversions, say foo.dvi to foo.ps and foo.pdf. Add a good post script printer (something like HP Color Laser 5/5M PS printer). Print the graphics to a file, say, foo.prn (select encapsulated postscript option from the printer menu). Rename foo.prn as foo.eps. This can be included in foo.tex without any problems.
- Some extra effort for mastering `The Editor' Vi can make a big difference. Latex and Vi go hand in hand!
- Using Bibtex makes referencing much easier.
#text within this are the comments#
- A very general Latex article file (foo.tex) might look like this.
\documentclass[12pt, a4paper]{article}
\bibliographystyle{ieeetr}
\begin{document}
One will include the document is here. The present document is an article which has to be referenced according to the journal IEEE Transaction. The reference file used is myref.bib. So one will put all his references (even those which are not relevant to the present article!) in one reference file `myref.bib'according to the Bibtex format(can be seen in the above link for Bibtex)
\bibliography{myref}
\end{document}
- To put figures side by side:
use \usepackage[dvips]{graphicx} in the preamble.
- Using minipage - Individual Captions can be given for individual figures:
\begin{figure}
\begin{minipage}[b]{0.5\linewidth} #start a minipage of 0.5 linewidth#
\centering # make the figure at the center #
\includegraphics[width=\textwidth]{figurename.eps} #width of graphics is to be same as textwidth of minipage#
\caption{figure caption}
\label{figure label}
\end{minipage}
\hspace{0.5cm} #spacing between the figures#
\begin{minipage}[b]{0.5\linewidth}
\centering
\includegraphics[width=\textwidth]{nextfig.eps}
\caption{figurecaption for nextfig}
\lable{figurelabel for nextfig}
\end{minipage}
\end{figure}
If one puts both the figures in one minipage environment, instead of two as in the previous example, the figures will come one down the other.
- Using the package ``subfigure'' - One single caption for the figures together. Individual figures will be identified as (a), (b) etc.:
Include the line ``usepackage{subfigure}'' in preamble.
\begin{figure}
\begin{center}
\subfigure[fig.1] # will come as (a) fig.1 #
{
\label{label for fig.1} #On referring, this will come as figure. X(a)# \includegraphics[width=0.4\textwidth]{figure1.eps} #width of the figure has to to 0.4 times the textwidth - two figures are going to come side by side!#
}
\hspace{0.5cm}
\subfigure[fig.2]
{
\label{label for fig.2}
\includegraphics[width=0.4\textwidth]{figure2.eps}
} \caption{Caption for all the subfigures together}
\label{genral label for the figure}# On referring, this will come as figure.X#
\end{center}
\end{figure}
If you are putting vacant line in between the subfigure environment, I have seen that the figures come one down the other.
- General outline of a simple table:
\begin{table}
\begin{center}
\begin{tabular}{|c|c|c|} #generates three columns with the text `c'entralised#
\hline # makes a horizontal line; starting of the table#
Heading 1 &Heading 2 & Heading 3\\ \hline #`&', separates the column entries; `\\', break the line; and `\hline', makes a horizontal line#
1 & X1 & X2 \\ \hline
2 & X1 & X2 \\ \hline
3 & X1 & X2 \\ \hline
4 & X1 & X2 \\ \hline
5 & X1 & X2 \\ \hline
\end{tabular}
\caption{Put the caption here}
\label{put the label of the table here}
\end{center}
\end{table}
I will be updating this page whenever time permits:-)