Posts

How to insert table of content in the report using LaTeX

Hi everyone, welcome to my blog where I share some tips and tricks on using LaTeX, a powerful document preparation system. Today, I'm going to show you how to insert a table of content in your LaTeX document. A table of content is a list of the sections and subsections of your document, along with their page numbers. It helps your readers to navigate your document and find the information they need. It also gives an overview of the structure and organization of your document. To insert a table of content in LaTeX, you need to use two commands: \tableofcontents and \section. The \tableofcontents command tells LaTeX where to place the table of content in your document. Usually, you put it right after the \begin{document} command. The \section command tells LaTeX the title of each section of your document. You can also use \subsection and \subsubsection commands to create sub-levels of sections. Here is an example of a LaTeX document with a table of content:

Fix - quick search box not visible in synaptic package manager.

Image
Problem I like to install software using synaptic package manager rather than using Ubuntu software center or using gnome software center . Recently I have noticed that the quick search or filter box is disapeared from the top bar of the synaptic package manager. I this post I will discuss how to get the quick filter box back. Solution The quick serch box is provided by the package apt-xapian-index , and it does not installed by default with synaptic since it is in the recomended dependency list. So to solve the problem, we just have to installed the package and rebuld the search index. To install the package, run the following command in terminal sudo apt install apt-xapian-index After installing the package, we have to rebuild the search index, which we can do by running the following command in the terminal. sudo update-apt-xapian-index -vf Now if you lunch the Synaptic Package Manager , we can see that the quick search box is there, and if we type anyth

Setting default text alignment in blogger html view

Image
By default the text alignment of the blogger is left alignment. But I feel that the justify alignment looks better, and most of the time I write blog using "HTML view" since most of the time I share some kind of source code, which, I feel, is better using html view compared to compose view. So it will be better for me if I can add default text alignment to justify for whole document instead of doing for each paragraph. Here I am sharing how I do it in blogger. Solution One of the easiest way is to use the <style> function in the head secetion of html and setting the body to justify alignment using the body{text-align: justify} . So basically add the following section at the start of the document. <head> <style> body{text-align: justify} </style> </head> Now start writing your post inside the <body> section, the text will be aligned accordingly. Your will look something like thi: <bo

Getting time google.com

Some time setting up time using ntp server does not work in Ubuntu, especially when you are inside some kind of proxy. And setting up time manually may not be accurate and obviously you need to know time properly. But there is way in which you can set time using time stamp from google. Just open the terminal and run the following command. date -s "$(curl -sD - google.com | grep ^Date: | cut -d' ' -f3-6)Z" Hope this will help. Cheers A. Paul

Syntax highlighting for code in blogger

Introduction: There is no straight forward or simple way to do syntax highlighting to share any code through blogger. But we can easily do that by using some third party service. One such service is highligtjs.org . Use the following steps for code highlighting. Solution: We have to work in html view rather than compose view of blogger. For syntax highlighting we have to first add JS script for importing CSS in the header of the html. To do that add the following line at the starting in the html view. <head> <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.2.0/build/styles/androidstudio.min.css"> <script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.2.0/build/highlight.min.js"></script> <script>hljs.initHighlightingOnLoad();</script> </head> Then start writing inside the body html tag, as

LyX not showing math font properly

Problem: I faced this problem after reinstalling Linux Mint on my computer. I simply installed the LyX, TeXLive and other LaTeX-related software. But when I started using LyX, it was not showing the math fonts properly. It was showing ‘a’ instead of ‘alpha’ or ‘b’ instead of ‘beta’, even though its corresponding latex code was correct, and the pdf output was correct. See the following figure for more clarity. Reason: One of the required packages of LyX is fonts-lyx, which is needed to visually display the math symbol in LyX. It was not automatically installed in when I installed LyX, and hence the math symbols were not visible properly. Solution: The solution is simple. Just install the fonts-lyx package from the package manager or from the command line. To install it from the command line, use the following command. sudo apt install -y fonts-lyx That’s all, this should solve the problem. Cheers A.Paul

Installing SciDaVis on Ubuntu 20.04

Image
SciDaVis is a free and open source application to visualize and analyze scientific data. This is kind of clone to the proprietary and commercial applications like Origin and Igor pro. This application can generate 2D and 3D plot and perform functions like curve fitting or Fourier transform. Problem The application is not available in the Ubuntu software center, so we can not directly install from Ubuntu repository. Solution: The latest version of the application is available on the GitHub, you can see it here. The easiest way to install the application is by using the prebuilt binary package. You can either download the deb file or install by adding the repo. I prefer the later because it will automatically update the application using the Ubuntu software update. The instruction can be found here. Go to the link, select Ubuntu and select Add Repository and Install Manually. Following are the command to install int in Ubuntu 20.04. sudo sh -c "echo 'd