Install LaTeX in Ubuntu

LaTeX is a markup language which produces documents, separating content and style. While using LaTeX, you have to focus on content without worrying about the style. For using it, just learn few commands and you are good to go.

There are number of LaTeX distributions and one of them is TeX Live.

To install Tex Live, type this command on your terminal:

sudo apt-get install texlive-full

After this is complete, we need to install LaTeX editor. There are many available, but I am using Texmaker. To install it, type:

sudo apt-get install texmaker

After you are done with installation part, open it from terminal by typing following:

texmaker

Okay! Now here is small tutorial on how to create a document in LaTeX. Click on File -> New and type following in space provided:

  1. \documentclass{article}
  2. \begin{document}
  3. Hello world!
  4. \end{document}

Save it as a ‘tex’ file by clicking File -> Save. Compile the document clicking the arrow Quick Build.

Now enjoy creating your documents without being worried about its style 🙂

 

Way to Change text colour of icon on Desktop|Ubuntu 12.04 desk

If you are jaded with text color of your icons on desktop, then you just need to make few changes. Here are steps:

Go to path:

 /usr/share/themes/Ambiance/gtk-3.0/apps/

This path is for Ambiance  (theme in my case), if you are using Radiance or something like that, don’t worry. Make a little change in your path. Replace Ambiance with a theme you are using.

Now, in apps you would find a file “nautilus.css”.

Look for a line:

color: @bg_color;

Replace the @bg_color with hex code of color you want. It would be better if you uncomment the above line and copy it to replace hex code of color.

/*color: @bg_color;*/

color: #FF0000;

Then you will get your own color .Enjoy !!

 

Install graphics.h in ubuntu

For using graphics.h library in Ubuntu, you need to follow few simple steps given below:

First of all, you need to install few packages. For that, run command this on your terminal “sudo apt-get install libsdl-image1.2 libsdl-image1.2-dev guile-1.8 guile-1.8-dev”

Next you need to install libgraph package. Download libgraph-1.0.2.tar.gz from link:

download.savannah.gnu.org/releases/libgraph/libgraph-1.0.2.tar.gz

Extract this where you want. Now navigate to the folder, where you just extracted your libgraph-1.0.2.tar.gz using cd command. Run these commands on your terminal.

> cd libgraph-1.0.2
> ./configure
>sudo make
> sudo make install
> sudo cp /usr/local/lib/libgraph.* /usr/lib

And if you got error message “configure: error: *** SDL version 1.2.0 not found!”, try installing it using: sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev”

Another error which you can get is: “configure: cannot find guile-config; is Guile installed?” Solve this by using command“sudo apt-get install guile guile-dev.

If this didn’t helped much, then we have another way to get it work in right way. Use synaptic package manager to install related files.

synaptic

Now try compliling your C program.

#include<stdio.h>
#include<graphics.h>

int main()

{
int gd=DETECT,gm;
initgraph(&gd,&gm,NULL);
int i,x=10;
char str[3]=”0″;
setbkcolor(BLUE);

setcolor(12); //outline heart
circle(50,50,40);
circle(110,50,40);
line(22,80,80,140);
line(80,140,138,80);

floodfill(50,50,12); //fill heart
floodfill(110,50,12);
floodfill(80,50,12);
floodfill(80,100,12);

getch();
closegraph();
return 0;
}

terminal