How to install Visual Studio Code text editor on Ubuntu 16.04

This post introduces how to install the nice text editor Visual Studio Code on Ubuntu.

Step 1: Install gdebi

Open a terminal and type the following command into your terminal.

$ sudo apt-get install gdebi
# use gdebi tool to install external *.deb packages like Visual Studio Code and Google Chrome.
# gdebi will automatically fetch and install all Visual Studio Code dependencies.

Step 2: Download Visual Studio Code

 

In your terminal, cd to the directory where you downloaded the file (for example, in my case, it is in my Downloads folder.)

Step 3: Install Visual Studio Code

$ sudo gdebi code_1.15.1-1502903936_amd64.deb
# your downloaded version might be different from mine, so change it to #your .deb file

Step 4: Click “Search your computer” icon on your tool bar, and type in Visual Studio Code, you will see it’s installed on your Ubuntu.

Step 5: Right click the Visual Studio Code icon on your tool bar and pick Lock to Launcher, your are ready to use your Visual Studio Code editor on your Ubuntu 16.04:)

 

How to install Google Chrome Browser on Ubuntu 16.04

This post introduces how to install Google Chrome Browser on Ubuntu 16.04.

Step 1: Install gdebi

Open a terminal and type the following command into your terminal.

$ sudo apt-get install gdebi
# use gdebi tool to install external *.deb packages like Google Chrome.
# gdebi will automatically fetch and install all Chrome dependencies.

Step 2: Download Google Chrome browser with wget

$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
# use wget command to download a latest version of the Google Chrome browser

Step 3: Install Google Chrome 

$ sudo gdebi google-chrome-stable_current_amd64.deb

Step 4: Click “Search your computer” icon on your tool bar, and type in Chrome, you will see it’s installed on your Ubuntu.

Step 5: Right click the Chrome icon on your tool bar and pick lock to Launcher, your are ready to use your Google Chrome on your Ubuntu 16.04:)

[LaTeX] Use fancyhdr package to control page numbering style

This post introduces how to use fancyhdr package to control page numbering style in your LaTex document.

We can use the LaTeX package fancyhdr to customize how the page numbers are displayed.

For example, if you want to put the current page number in the context of the page numbers in the whole document (page 1 of 10 or 1/10), the following command can help you with that:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{lastpage}
 
\pagestyle{fancy}
\fancyhf{}


%use the following commands by uncomment (i.e., remove the % for the line you want to use.) 

%uncomment the command below (the part in bold) if you want to show the %style "Page 1 of 10" to the right of your footer)
%\rfoot{Page \thepage \hspace{1pt} of \pageref{LastPage}} 
% change \rfoot to \lfoot or \cfoot for left or center positioning

%uncomment the command below (the part in bold) if you want to show the style "1/10" to the right of your footer)
%\rfoot{\thepage \hspace{1pt}/\pageref{LastPage}} 
% change \rfoot to lfoot or \cfoot for left or center positioning

%uncomment the command below (the part in bold) if you only want to put %the current page number at the center of the header
%\fancyhead[C]{\thepage} 
% change [C] to [R] or [L] for right or left positioning 


 
\begin{document}
 
\tableofcontents
 
\section{First section}
Some text...
 
\section{Second section}
More text...
 
\end{document}

See the references given below for more style needs (e.g., even and odd page numbering).

References:

Page numbering/ Customizing numbering styles

LaTeX/Customizing Page Headers and Footers