Saturday, October 19, 2019

Devanagari in Latex

Devanagari in LaTeX


Step 1: Start the Package Manager and install devanagari package.
Step 2: Create a dn file using notepad

Sample (hindi1.dn)

\documentclass{article}
\usepackage{devanagari}
\begin{document}
{\dn amira khusaru akhatara|}
\end{document}


Step 3: Pre-process the dn file to generate the tex file

Command
devnag hindi1.dn

This command will generate hindi1.tex file shown below

\def\DevnagVersion{2.17}
\documentclass{article}
\usepackage{devanagari}
\begin{document}
{\dn aEmr \7{K}sz aKtr.}
\end{document}

Step 4: Run the tex file

Output

Numerals and Rupee Symbol in LaTeX

For numerals use \dnnum command and for rupee symbol use \rupee command

Sample Code (.dn file)

\documentclass{article}
\usepackage{devanagari}
\usepackage{tfrupee}
\begin{document}
{\dn kiimata}:
 \rupee~{\dn \dnnum 5,500}
\end{document}

.tek file

\def\DevnagVersion{2.17}
\documentclass{article}
\usepackage{devanagari}
\usepackage{tfrupee}
\begin{document}
{\dn kFmt}:
 \rupee~{\dn \dnnum \rn{5}{\rs ,\re}\rn{500}}
\end{document}
Output

Devanagari letters


Devanagari letters

Wednesday, October 2, 2019

Thesis Writing Sample Code in Latex

Thesis Writing Sample Code in Latex

A sample code is shown below.

\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{cite}
\graphicspath{ {images/} }
\title{
{Designing Novel Methodologies for efficient Routing in MANET...}\\
{\large Birla Institute of Technology}\\
{\includegraphics{logo1.png}}
}
\author{Md. Amir Khusru Akhtar}
\date{}
\begin{document}

\maketitle
\chapter*{Abstract}
The prevalent applications of WSN have fascinated a plethora of research efforts. WSN still faces s.....ges associated with sensor networks. The euiler equation $e^{\pi i} + 1 = 0 $ has...

\chapter*{Dedication}
To mom and dad

\chapter*{Declaration}
I declare that..

\chapter*{Acknowledgements}
I want to ...

\tableofcontents
\listoffigures
\listoftables
\chapter{Introduction}
Wireless sensor networks (WSN), ......sion. It ..... such as temperature, pressure, humidity, sound etc. shown in figure \ref{img1}. The collected data ... health, military \cite {wohwesamboOptimizedClusteringAlgorithms2019, akyildizWirelessSensorNetworks2002} etc. The f...and communication capabilities. $$ x_1^2 + x_2^2 = x_3^2 $$
\begin{figure}[h!]
\centering
\includegraphics[width=0.5\textwidth]{fig1.jpg}
\caption{Sensor Network}
\label{img1}
\end{figure}
\chapter{Literature Review}
Lots of works have been proposed in the field of energy efficient clustering and routing but they have serious limitations......

Major factors contributing to overloading of CHs may be classified into three categories shown in Table \ref{tab1}.
\\
\begin{table}[!ht]
\centering
\caption{Componets}

\label{tab1}
\begin{tabular}{|r|r|r|r|}
\hline
Item & 2012 & 2013 & 2014 \\
\hline
Desktop & 23 & 25 & 26 \\
\hline
Laptop & 53 & 55 & 86 \\
\hline
Monitor & 13 & 85 & 28 \\
\hline
\end{tabular}
\end{table}
\chapter{Freindly Group Model}
In this ...\begin{equation}
\label{eq01}
e^{\pi i} + 1 = 0
\end{equation}
The is an example of equation in \ref{eq01} Label
\chapter{Compressive Sensing}
We have .....
\begin{itemize}
\item One
\item Two
\begin{itemize}
\item Two one
\item Two two
\end{itemize}  \item Three
\end{itemize}
\chapter{Conclusion}
In this paper...........
\appendix
\chapter{Appendix 1}
\bibliographystyle{plain}
\bibliography{art1}
\end{document}

OUTPUT

Output of Sample Code

Writing Article in Latex Step by Step

Writing Article in Latex Step by Step

Step 1: If you are new in LaTeX please visit my blog LaTex Tutorial

ok..

Use the below code to write Title, Author, Address, Abstract and Keywords \

\documentclass[options]{article}
\title{Energy Efficient Clustering and Routing Algorithm for WSN}
\author{Mohit Kumar$^{1}$, Md. Amir Khusru Akhtar$^{2}$  \\
\small $^{1}$ Cambridge Institute of Technology \\
\small $^{2}$Usha Martin University }
\begin{document}
\maketitle
\begin{abstract}
The prevalent applications of WSN have fascinated a plethora of research efforts. WSN still faces several critical challenges. Even though many algorithms have been proposed for WSN, there are still many challenges associated with sensor networks.
\end{abstract}\hspace{10pt}
{\bf Keywords:} Wireless sensor network, clustering, routing, energy consumption, network lifetime
\end{document}

OUTPUT

Step 2: Create a BibTeX file for references (steps shown in below link)


Now, start your Section and Subsection and cite references from the bib file.
An Example of Latex code is shown below:

\documentclass[options]{article}
\usepackage{cite}
\title{Energy Efficient Clustering and Routing Algorithm for WSN}
\author{Mohit Kumar$^{1}$, Md. Amir Khusru Akhtar$^{2}$  \\
\small $^{1}$ Cambridge Institute of Technology \\
\small $^{2}$Usha Martin University }
\begin{document}
\maketitle
\begin{abstract}
The prevalent applications of WSN have fascinated a plethora of research efforts. WSN still faces several critical challenges. Even though many algorithms have been proposed for WSN, there are still many challenges associated with sensor networks. 
\end{abstract}\hspace{10pt}
{\bf Keywords:} Wireless sensor network, clustering, routing, energy consumption, network lifetime
\section{Introduction}
Wireless sensor networks (WSN), are geographically distributed autonomous sensors which are deployed either arbitrarily or using some predefined provision. It is used to monitor the physical or environmental characteristics such as temperature, pressure, humidity, sound etc. shown in figure 1. The collected data ... health, military \cite {wohwesamboOptimizedClusteringAlgorithms2019, akyildizWirelessSensorNetworks2002} etc. The f...and communication capabilities.
\bibliographystyle{plain}
\bibliography{art1}
\end{document}


OUTPUT

Step 3: Write rest of the Article and add figures, tables and equation.
In case you are facing trouble in ( figures, tables and equations,...)
please visit my blog LaTex Tutorial
A sample code is shown below.

\documentclass[options]{article}
\usepackage{cite}
\usepackage{graphicx}
\title{Energy Efficient Clustering and Routing Algorithm for WSN}
\author{Mohit Kumar$^{1}$, Md. Amir Khusru Akhtar$^{2}$  \\
\small $^{1}$ Cambridge Institute of Technology \\
\small $^{2}$Usha Martin University }
\begin{document}
\maketitle
\begin{abstract}
The prevalent applications of WSN have fascinated a plethora of research efforts. WSN still faces s.....ges associated with sensor networks. The euiler equation $e^{\pi i} + 1 = 0 $ has...
\end{abstract}\hspace{10pt}
{\bf Keywords:} Wireless sensor network, clustering, routing, energy consumption, network lifetime
\section{Introduction}
Wireless sensor networks (WSN), ......sion. It ..... such as temperature, pressure, humidity, sound etc. shown in figure \ref{img1}. The collected data ... health, military \cite {wohwesamboOptimizedClusteringAlgorithms2019, akyildizWirelessSensorNetworks2002} etc. The f...and communication capabilities. $$ x_1^2 + x_2^2 = x_3^2 $$
\begin{figure}[h!]
\centering
\includegraphics[width=0.5\textwidth]{fig1.jpg}
\caption{Sensor Network}
\label{img1}
\end{figure}
\section{Related Work}
Lots of works have been proposed in the field of energy efficient clustering and routing but they have serious limitations......

Major factors contributing to overloading of CHs may be classified into three categories shown in Table \ref{tab1}.
\\
\begin{table}[!ht]
\centering
\caption{Componets}

\label{tab1}
\begin{tabular}{|r|r|r|r|}
\hline
Item & 2012 & 2013 & 2014 \\
\hline
Desktop & 23 & 25 & 26 \\
\hline
Laptop & 53 & 55 & 86 \\
\hline
Monitor & 13 & 85 & 28 \\
\hline
\end{tabular}
\end{table}

\section {Numerical Simulation}
This Section Covers....
\subsection {Model 1}
In this ...\begin{equation}
\label{eq01}
e^{\pi i} + 1 = 0
\end{equation}
The is an example of equation in \ref{eq01} Label
\subsubsection{Scenario 1}
We have .....
\begin{itemize}
\item One
\item Two
\begin{itemize}
\item Two one
\item Two two
\end{itemize}  \item Three
\end{itemize}

\section*{Conclusion}
In this paper...........
\bibliographystyle{plain}
\bibliography{art1}
\end{document}

OUTPUT

Creating BibTeX file from Zotero Library

Creating BibTeX file from Zotero Library


Phase 2: Run Zotero and perform the following steps in Zotero

1. Tools > Add-ons
2. Select ‘Extensions’
3. Click on the gear in the top-right corner and select ‘Install Add-on From File…’
4. Choose .xpi that we have downloaded in phase 1, 5. click ‘Install
6. Restart Zotero


Phase 3: Export Library from Zotero
1. File > Export Library
2. Select Format ‘Better BibTeX’ and Click on OK
3. Choose your Location to save your file and  Click on OK

Now your BibTeX file is ready.

Bibliography in LaTeX

Bibliography in LaTeX


Create a BibTeX file (.bib). It should be given the same name as and kept in the same folder as your .tex file.

Ex.  bib file
@article{akhtarMathematicalModelDetection2008,
  title = {Mathematical Model for the Detection of Selfish Nodes in {{MANETs}}},
  volume = {1},
  number = {3},
  journal = {International Journal of Computer science and Informatics},
  author = {Akhtar, Md Amir Khusru and Sahoo, G.},
  year = {2008},
  pages = {25--28}
}

@article{akhtarHumanisticApproachMobile2013,
  title = {Humanistic Approach in Mobile Ad Hoc Network: {{HAMANET}}},
  shorttitle = {Humanistic Approach in Mobile Ad Hoc Network},
  journal = {arXiv preprint arXiv:1312.7660},
  author = {Akhtar, Md and Khusru, Amir and Sahoo, G.},
  year = {2013},
}

.....................

Citing references
Use \cite{citation-key} command where you want to cite a reference in your .tex file.

Inserting the bibliography
Write the given commands where you want to insert the bibliography in your document (normally at the end)
\bibliographystyle{plain}
\bibliography{BibTeX filename}

Ex.
\documentclass{article}
\title{\LaTeX Management}
\author{Dr. Md. Amir Khusru Akhtar}
\usepackage{cite}
\begin{document}
\maketitle
In \LaTeX we can use cite package for multiple citation  \cite{johnsonDSRDynamicSource2001,huPacketLeashesDefense2003,johnsonAcidMineDrainage2005} and single citation \cite{wohwesamboOptimizedClusteringAlgorithms2019}.
\bibliographystyle{plain}
\bibliography{2}
\end{document}

OUTPUT
Ex. 

Use package apacite for apa style

\documentclass{article}
\usepackage{apacite}
\title{DDoS Attack}
\author{Dr. Md. A. K. Akhtar}
\begin{document}
\maketitle
Distributet DoS \cite{huPacketLeashesDefense2003}.
\bibliographystyle{apacite}
\bibliography{2}
\end{document}

Output


Tuesday, October 1, 2019

LaTeX Special Characters

LaTeX Special Characters

PUNCTUATION MARKS
Put a backslash (\) in front of given characters

 \#     \$        \%        \^{}      \&      \_      \{      \}       \~{}

GREEK LETTERS in LOWER-CASE
     \alpha    \eta      \nu       \tau 
     \beta     \theta    \xi       \upsilon
     \gamma    \iota      o        \phi 
     \delta    \kappa    \pi       \chi 
     \epsilon  \lambda   \rho      \psi 
     \zeta     \mu       \sigma    \omega 

Ex. $\alpha$

GREEK LETTERS in UPPER-CASE
     \Gamma    \Lambda   \Sigma    \Psi 
     \Delta    \Xi       \Upsilon  \Omega 
     \Theta    \Pi       \Phi

Ex.
$\Delta$

MATHEMATICAL SYMBOLS/commands
  plus/minus (±) use \pm 
  minus/plus            use \mp
  times (×) use \times
  division (÷) use \div
  tilde (~)         use \sim
  Angstrom(Å) use \AA
  angstrom(å) use \aa
  degree (°) use  $^{\circ}$
  Square root            use  \sqrt{...}
  Fraction                 use \frac{numerator}{denominator}
  Backslash              use  \textbackslash

Mathematics in LaTeX

Mathematical Expressions
In LaTex we have two modes to use mathematical expressions (inline and display mode)

For inline mode use any one of these delimiters.
1.  \( \)
2.  $ $
3.  \begin{math} \end{math}

Ex.
$c=a+b$

In displayed mode we have two versions (numbered and unnumbered)

We can use  any one of these delimiters in display mode
1. \[ \]
2. $$ $$
3. \begin{displaymath} \end{displaymath}
4. \begin{equation} \end{equation}

Ex.
$$ c=a+b $$

Note: include package amsmath
\usepackage{amsmath}

In Latex we can use the symbols ^  for superscripts and symbols  _ for subscripts.

Ex. 
\documentclass[options]{article}
\usepackage{amsmath}
\begin{document}

$$ x_1^2 + x_2^2 = x_3^2 $$

$$ x^{a \beta} - 1 = y_{ijk} + y_{lm}  $$

$$ ((xa)^n)^{p+q} = xa^{\theta}  $$

\[ \int\limits_0^\infty a^2 + b^2 \ dx \]

$$ \sum_{i=0}^{\infty} \frac{2}{n^s}
= \prod_p ^ n \frac{i}{1 - p^{-s}} $$

\end{document}

Output

Label in equation
We can use label for future reference
\documentclass[options]{article}
\usepackage{amsmath}
\begin{document}
\begin{equation} \label{eq01}
e^{\pi i} + 1 = 0
\end{equation}
The is an example of equation in \ref{eq01} Label
\end{document}

OUTPUT
Multiline Equation
use \begin{multline} command for numbered equation and \begin{multline*} for unnumbered equation.

\documentclass[options]{article}
\usepackage{amsmath}
\begin{document}
\begin{multline*}
f(x) = 4x^6 + 4x^5y + 59x^4y^2 + 9x^3y^3\\
- 12x^91y^4 - 2xy^5 + 21y^6 - a^3b^3
\end{multline*}

\begin{multline}
f(x) = 4x^6 + 4x^5y + 5x^4y^2 + 9x^3y^3\\
- 12x^91y^4 - 2xy^5 + 21y^6 - a^3b^3
\end{multline}
\end{document}

Output