Posts

Showing posts from 2014

bclogo package to produce boxed and highlighted text in LaTeX

Image
When we write article, sometime we need to highlight some portion (may be some comment, idea, home task or some hint) to differentiate it from the rest of the article. LaTeX gives us a very good and elegant way to do the job using bclogo package. Here I will describe how to use bclogo package. First you have to load the package using \usepackage[tikz]{bclogo} . And the syntax is as followis: \begin{bclogo}[options]{title} content text \end{bclogo} For example \documentclass{article} \usepackage{lipsum} \usepackage[tikz]{bclogo} \author{Apurba Paul} \title{check boxed minipage} \begin{document} \begin{bclogo}{title} some text \end{bclogo} \end{document} The above code will produce something like this You can also change the background color, shape of the rectangle and the the logo. For example the following code will produce something like the next image: \documentclass{article} \usepackage{lipsum} \usepackage[tikz]{bclogo} \author{Apurba Paul} \title{check boxed m

Using boxedminipage environment in LaTeX

Boxedminipage is an environment that is used in LaTeX to crate a pseudo page environment with border around it in your actual page. Here I am saying how to use it. First import the package using \usepackage{} command in the preamble. \usepackage{boxedminipage} Syntax to use this package is \begin{boxedminipage}{<width_of_the_minipage>} minipage content \end{boxedminipage} This environment can be used if you want to put some thing together but it is spliting up over more than one pages because this create a float, and so the box will not allow to creat page break inside it like figure environment. Also you can use this environment to place some text at the lift or right not extending more than one line. Like we put address, salutation, or header in Letter. If you don't want box around it yo can use minipage environment. Here I am giving a simple example \documentclass{report} \usepackage{boxedminipage} \author{APaul} \title{Example of boxedminipage en

Page no positioning in latex using fancyhdr package.

 We can manually position the page no. in LaTeX using fancyhdr package. To position page no. (or any other thing) in header or footer there are total six position options, left, right and centre in header and footer. The corresponding commands are given in the table bellow position fancy head command left header \lhead right header \rhead centre header \chead left footer \lfoot right footer \rfoot centre footer \cfoot And the page no inserted by the command \thepage . Now suppose I want to insert page no in the left side of each page I can use following code: \documentclass[a4paper, 11pt]{report} \usepackage{amsmath}%just some package not necessary to \usepackage{graphicx}%test this page no. \usepackage{fancyhdr} \pagestyle{fancy} %declaring page style \lhead{\thepage} %page no inserted in left side of header \chead{} \rhead{} \lfoot{} \cfoot{} \rfoot{} \author{Apurba~Paul} \title{Inserting page no in custom position in \LaTeX

Playing online radio in Ubuntu

Image
You can easily play online radios in Ubuntu using Rhythmbox music player. First you have to add the radios to Rhythmbox. You can find you huge no of online radios from the website shoutcast. Here is the step by step instructions. First go to  http://www.shoutcast.com/ . Then search for the radio you want to listen. Now click in the save button and save the link as .pls (play list) file.  Now go to the saved file and open it with Rhythmbox. This will add the radio channel in the radio option in the Rhythmbox. You can right click on the radio channel and change properties like gener, channel name etc as you want (except the channel location).  No just dubble click on the channel and it will start playing the radio channel.  Cheers APaul Source: http://askubuntu.com/questions/142360/finding-stations-for-rhythmbox

-E option to export environment variable to sudoer

Have you ever faced a problem adding ppa (Personal Package Archive) in your computer. If you are getting error like Please check your internet connection then probably the reason is sudo is not able to find proxy setting. This may happen if proxy is only set to .profile or .bashrc file. So to overcome this problem I have already wrote one post before. Here I am showing another option which is bit easier option. Here you have to add -E while running sudo (note: E is in capital letter). So -E option actually preserve the environment option . See the Sudo Manual for more detail. So to add ppa run the following command sudo -E add-apt-repository ppa:<paa_name> This should work now. Cheers APaul Source http://askubuntu.com/questions/212132/i-cant-add-ppa-repository-behind-the-proxy http://www.sudo.ws/sudo/man/sudo.html http://apurbapaul.blogspot.in/2012/09/adding-repository-behind-proxy-using.html

installing language pack from command line

To install language from terminal you have to first know the code for the language (for example bn is code for Bengali and hi is the code for Hindi). Now first install the basic language packages for your desktop using the following code: sudo apt-get install language-pack-[cod] language-pack-gnome-[cod] language-pack-[cod]-base language-pack-gnome-[cod]-base It is not still done, because every other software may have its won language pack. To know which more package you have to install more you can use the following command check-language-support -l [cod] And then install those packages also. Example: Suppose you want to install language pack for Bengali, so first run the command sudo apt-get install language-pack-bn language-pack-gnome-bn language-pack-bn-base language-pack-gnome-bn-base Then run check-language-support -l bn And then from list install language packs for all applications. Source: http://askubuntu.com/questions/149876/how-can-i-install-one-language

Solving different time problem in windows and ubuntu

In Windows and Ubuntu dual boot machine you may some time find that the time are different. This is because windows treat BIOS clock time as local time while Ubuntu treat BIOS clock time as GMT. So Windows display same time as BIOS clock but Ubuntu add/subtract time difference from GMT and show. For example Indian standard time is +5:30 hour ahead of GMT. Ubuntu will add 5:30 hour with BIOS clock and show. So there will be always difference in Windows time and Ubuntu time. To solve it just run the following command  sudo gedit /etc/default/rcS and find the portion which says "UTC=yes" and chance it to "UTC=no"  (Without quotes)   Hope this will solve the problem.   Cheers APaul Source: http://ubuntuguide.net/fix-different-time-clock-between-windows-and-ubuntu

Marging partition in gparted

Image
  Figure 1: Main window of Gparted Figure 2: Resize/Move window We can resize our disk partition or marge with another partition in Ubuntu using gparted . First you have to install gparted using following command: $ sudo apt-get install gparted Now open gparted . You may need to give administrative password. When opened it will look like the figure. First you have to unmount the partition(s) you want to resize or marge. Just right click > unmount Again right click on the partition you want to resize or marge and then select resize/move option This will open another window like the second image, you can drag and resize your partition and marge with another partition. Now click on resize/move button. Your partition size should be changed now. For more detail answer visit the following link of askubuntu.com and check the several good answers. http://askubuntu.com/questions/51272/how-do-i-repartition-with-gparted Though this doesn't delete the data in

Colour highlighting GNUPLOT code in gedit.

Gedit by default show colour highlighting for the gnuplot code. But we can easily make it. We just have to download the language definition file and copy to the proper folder. The language definition file is a .lang file. You can download the gnuplot language definition from the following linke. https://wiki.gnome.org/Projects/GtkSourceView/LanguageDefinitions Download the file and copy the file to the folder /usr/share/gtksourceview-2.0/language-specs/ . You can use the following command $ sudo cp /your/download/location/gnuplot.lang /usr/share/gtksourceview-2.0/language-specs/  Now if you open any gnuplot code file with gedit you can see all the colours. But there is a problem, it will show colour highlight only for those file having extension .plt , but gnuplot can have extension .gp also. So to add .gp also in colour highlighting you have to add one line in the .lang file. If you check the file carefully you can see that there is a protion like this. <language id= "gnu

Flash player problem in chromium in Ubuntu 14.04

After Updating to Ubuntu 14.04 I have noticed that chromium is showing error message that Flash Player is not installed, even though it is installed and Firefox is working properly with this. Reason for this problem The reason behind this problem is, till now chromium used Netscape Plugin API for flashplayer support. But starting from Ubuntu 14.04 chromium stopped using Netscape Plugin API. Hence there will be a issue. Solution To solve this issue we will use pepper flash player. This is a stable version of flash player from google. There is a paper flashplayer available in Ubuntu repo, which will download and extract flashplayer and set up fro Chromium. To install this flash player run the following command in the terminal. sudo apt-get install pepperflashplugin-nonfree sudo update-pepperflashplugin-nonfree --install Now restart chromium browser, chromium will now play flashplayer properly. Hope this will be helpful for you. Cheers A.Paul

Email disappearing from IMAP and Webmail Interface after using pine/alpine

I generally check departmental mail through IMAP using Thunderbird or using web interface using SquirrelMail . But some time, speciall when I am using someone else's computer, I check mail through pine at the remote server. But from few days I have seen that when ever I am checking any mail using pine, the mails are disappearing from the IMAP or from web interface. So when I tried to find out the reason behind this I have learned that pine moving all mail from /var/spool/mail/$USER to /home/$USER/mbox . All other client are actually looking mail in the previous folder.    You can prevent this by making the following changes to the .pinerc file. Add the following line at the end of the file.  disable-these-drivers=mbox Most probably the above line without mbox may exist some where at the file, just do a search to find out where it is and change the value as above. Now pine will not move any mail but the old mail that already moved will be in the mobox folder so you will not see

Refreshing tex installation in Windows and Ubuntu

In miktex go to admin>settings (admin) and in general tab click refres FNDB button In texlive in Ubuntu go to root directory by command cd / then run the command sudo texhash or you can run command texconfig and a window will open up with lots of option, choose "rehash rebuild file name data base".   Cheers APaul

How to manually configure blogilo for blogger.com

To configure blogilo manually for blogger.com you need two things, 1) blogger userid and password. 2) BlogID.  The userid and password are the same that you use to login in the blogger.com To get blogid first go to blogger.com and login. In the dashboard click on the name of your blog. Look at the url, it should look something like this:  https://www.blogger.com/blogger.g?blogID=5078980559402776300#overview/src=dashboard . The no after blogID is your blogID, which is 5078980559402776397 in this case. Copy the no. Now open blogilo and go to Blog>add blog In the open window insert your userid and password in the respective field.  Next go to advance tab and insert the blogID Click OK Thats all, blogilo should now start working. You should see the list of previously published blogs. Cheers APaul

Changing caption width in latex

In this post I will discuss how to change the width of the figure caption. You can use the same technique to change the width of the other caption (like table caption). Here I am using the caption package. In caption package you can specify the width while loading the package or latter using \captionsetup command. Syntax of the both command are as following \usepackage[<option>]{caption} and command for captionsetup is \captionsetup[<float type>]{<option>} In the <option> we can use width=0.8\textwidth to specify width of the caption. If we specify that in the time of loading (i.e. when using with \usepackage command) it will affect all the float (like figure, table) but if you specify it in command \usepackage then you can specify float type. Then the specific float type will only be effected. This way you can specify two different width for different float. You can also specify other kind of formatting (like italic text) usi

How can I explain the meaning of LaTeX to my grandma? Tex.SE question with some beautiful answer.

The first line of the question asked by Stefan Kottwitz in Tex.SE ( Here ) is like this I wrote a book about LaTeX, and my proud grandma wanted to have a copy. So she got it, said "What a beautiful picture on the cover!" and - "What is this, LaTeX?". So here the main moto is how to explain what is TeX or LaTeX to a non technical person.  This seems to be very interesting question and the answer are equally interesting too. I just wanted to share the question to every one so I just sharing it in my blog. Cheers APaul