How to reset root/single_user password in Ubuntu on a Virtual Machine
In order to access the grub menu on a virtual machine, you need to hold the shift key down for a while. You must let your virtual machine to capture your mouse before holding the shift key. Follow the steps to change your password:
1. Let your virtual Machine to capture your mouse.
2. Hold the shift key down to get the grub menu.
3. Select the recovery mode option.
4. Select drop to root shell prompt.
5. Now, change with # passwd [username] (You can also see the list of users using # nano /etc/passwd).
How to span table/figure in two columns for writing paper in latex
While writing paper in latex in two columns, you might need to span table or figure in two columns. If you follow the template and use the following, then you might not get expected result.
\begin {table} …. \end {table}
or
\begin {figure} …. \end {figure}
To solve this problem, just use \begin{table*} instead of \begin {table} and \begin {figure*} instead of \begin {figure}. And, you will find your expected result
Converting a Visio Image to EPS
I fought for two days to understand the way of embedding eps image in latex. You cannot convert a image directly to eps from VISIO. At first, you need to convert it to PS (Post Script format). To do that you need to add a printer which can print a visio document to ps. To do it in windows 7, go to devices and printer and select add printer.
After that, Open Microsoft Visio and click print and the following window will pop up and select the printer and don’t forget to print on file and save the file as your_file_name.ps
After that you need a software that will convert the ps file to eps and you can do it with GSview. I faced the bounding box problem while converting the file to eps. To do that when you convert to eps, follow don’t forget to check it automatic bounding box calculation.

So, now you have your eps file ready to be embedded. If you still face problem with the bounding box, then you can manually edit the bounding box by opening the file using textpad or winedit. You need to change the bounding box parameter (To do that take the mouse cursor to the top left most corner of the image to see the co-ordination (normally in pt (i.e 200,300 pt) and bottom right most corner of your image and change it accordingly).
If you want to use pdflatex then you will encounter an error saying that “EPS file not supported”. To do so, you need to add epstopdf package which will convert the eps to pdf on the fly.
\usepackage{epstopdf}
But, using this package might not solve your problem. You can convert according to the following sequence to avoid the bounding box problem:
Tex>Dvi, and then Dvi>pdf
Reducing paragraph gap between items in latex
In order to remove the paragraph gap between two bullets or items in latex put the following in your document class. First one removes gap between the numbered item and second one removes gap between the unnumbered items.
%%%%% unnumbered item %%%%%
\newenvironment{enumerate*}
{\begin{enumerate}%
\setlength{\itemsep}{0pt}%
\setlength{\parskip}{0pt}}%
{\end{enumerate}}
%%%%% for unnumbered item %%%%%
\newenvironment{itemize*}%
{\begin{itemize}%
\setlength{\itemsep}{0pt}%
\setlength{\parskip}{0pt}}%
{\end{itemize}}
You can define your items using the following way:
\begin{itemize*}
\item
\item
\end{itemize*}
Some useful tips for Latex
To remove the hyphenation from the line break use the following in your document class:
\hyphenpenalty=5000
\tolerance=1000
To add urls in your document use the url package and include this in your document to use it:
\usepackage{url}
And use the following command to add URLs:
\url { your url}
Referring to a section, figure, subsection or table you can use the following commands:
~\ref{your referring label}
And to refer a listing label use only \ref instead of ~\ref.
To generate a quotation in latex use this “ for left quote and use this ” for right quote.
For special character å use \r{a}, for ä use \”{a} and for ö use \”{o}.
Subfigures in Latex
It took me so long to identify how to include subfigures. I have used the subfig package for this. Include the following in your document class to use subfigures.
\usepackage{subfig}
To define subfigures use the following steps to configure it.
%%% %% Starts of a table %%% %%
\begin{figure}[h]
%%% %% Center alignment %%% %%
\centering
%%% %% starting first subfigure and a line break after the first figure. Starts with \subfloat tag and command shown below %%% %%
\subfloat[Title] {{\label{subfig:lable_name}}\includegraphics[width=0.6\textwidth]{pic location}
} \linebreak
%%% %% starting second subfigure and a line break %%% %%
\subfloat[Title] {{\label{subfig:lable_name}}\includegraphics[width=0.6\textwidth]{pic location}
} \linebreak
}\linebreak
\subfloat[Title] {{\label{subfig:lable_name}}\includegraphics[width=0.6\textwidth]{pic location}
} \linebreak
%%% %% Caption of all the images %%%%%
\caption{(a)Title 1; (b) Title 2; and (c) Title 3}
%%% %% End of Figure tag %%%%%
\end{figure}
Image below shows an example of subfigures in latex:
Decimal point alignment in Latex
Decimal point alignment in Latex can be done in two different ways. But I prefer using dcolumn package because you will have the advantage of creating your own column type.
Include the package dcolumn and create a new column using the following command (you can add this in your document class).
\usepackage{dcolumn}
\newcolumntype{.}{D{.}{.}{-1}}
For defining table and heading you can use multicolumn as shown below:
\begin{tabular}{| c | . | . |}
\textbf{header 1} & \multicolumn{1} {|c|}{heading 2 } & \multicolumn{1}{|c|} {Heading 3} \\
1 & 2563.05 & 2095.22 \\
…. (more data)
\end tabular
The image below illustrates the decimal point alignment in latex.
First non-technical post – Nothing Special
Just thought about writing a non-technical post but couldn’t find anything special to write. With extreme pressures and workloads, I am living a despondent life and hoping for good days to come again in life. I am going to overlook my second valentine’s day, as you know; Valentine ’s day is just another ordinary day for researchers
.







