Presentation is loading. Please wait.

Presentation is loading. Please wait.

Agenda Introduction Installation Document Structure

Similar presentations


Presentation on theme: "Agenda Introduction Installation Document Structure"— Presentation transcript:

1

2 Agenda Introduction Installation Document Structure
Mathematical Typesetting Handling Images Tables Bibilography Sample documents

3 Introduction Tex – Type setting program - Donald Knuth
LaTeX – Variant of Tex – focuses on document structure - Leslie Lamport Highly portable LaTeX is free software under the terms of the LaTeX Project Public License (LPPL). A plain text file or can work with an IDE

4

5 Installation Distributions and Editors Distributions - To name some
TeX Live , teTeX , fpTeX, ,MiKTeX, proTeXt, MacTeX, gwTeX, OzTeX, migaTeX, PasTeX… TeX Live ( The better maintained TeX distribution MiKTeX ( - A TeX distribution for Windows – easy of installation

6 Installation Editors - To name some
TeXmaker, TeXstudio, TeXnicCenter, TeXworks,  ShareLaTeX … TeXnicCenter ( – Feature rich environment for windows and smaller in size TeXstudio – ( -

7 C:\Users\ad\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64
Next all optional

8 Special Characters characters with special meaning $ & % # _ { } ~ ^ \
$ & % # _ { } ~ ^ \ can be used in the documents by adding a prefix backslash (escape character): \$ \& \% \# \_ \{ \} The other symbols can be printed with special commands in mathematical formulae.

9 Document Structure LATEX Commands - case sensitive
\command[optional parameter]{parameter} Eg \documentclass[12pt, letterpaper]{article} \begin{document} Comments % - for line of comment Or \begin{comment} statements \end{comment}

10 Document Structure Sample document – \documentclass[12pt]{article}
% this is the first sample text document \title{WSN in IoT - An Example} \author{Andhe Dharani, ManjuPrasad} \date{8th feb 2015} %end of preamble \begin{document} \maketitle \end{document}

11 Document Structure Sample document – \documentclass[12 pt] {article}
\title{WSN in IoT - An Example} \author{Andhe Dharani \\ Department of MCA \\ RVCE \\ \and Manju Prasad B \\ Department of CSE \\ {GSSSIETW} \\ \month \year \begin{document} \maketitle …. \end{document}

12 Document Class Defines the type of document article IEEEtran
Report - For longer reports containing several chapters, small books, thesis, … book slides letter beamer

13 Document Class Document Class Options
Size of main font in doc - 10pt, 11pt, 12pt – default is 10pt Paper size - a4paper, letterpaper, a5paper, b5paper, executivepaper, and legalpaper New page for title or not - titlepage, notitlepage Typeset the doc - twocolumn Output generation - twoside, oneside Layout of document - landscape draft

14 Basic formatting: abstract, paragraphs and newlines
Most papers have abstract – LaTeX has predefined command… \documentclass{article}  \begin{document}  \begin{abstract} Your abstract goes here... ... \end{abstract} \end{document} Default, - "Abstract" as a title for your abstract To change it into anything else, e.g. "Executive Summary“ – \renewcommand{\abstractname}{Executive Summary}

15 Basic formatting: abstract, paragraphs and newlines
When LaTeX is processing input text - Paragraph mode Math mode A paragraph is ended by one or more completely blank lines \indent:  Indent this paragraph \noindent:  Do not indent this paragraph \parskip:  Space added before paragraphs \marginal notes:  Putting remarks in the margin LaTeX usually does the line and page breaking- manually can use some commands like – \\ \newline \linebreak \nolinebreak

16 Font sizes Font sizes are identified by special names
To apply different font sizes, commands \tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \huge \Huge The commands change the size within a given scope - examples - {\Large some words} {\Large\tableofcontents}

17 Font Styles style Command medium \textmd{text} bold \textbf{ } \bf{ }
Most common styles - Bold, italic and underline style Command medium \textmd{text} bold \textbf{ } \bf{ } upright \textup{ } italic \textit{ } \emph{ } slanted \textsl{ } small caps \textsc{ }

18 LaTeX - Units and Lengths
Abbreviation Definition pt A point, is the default length unit. About mm mm a millimetre cm a centimetre in an inch ex the height of an x in the current font em the width of an m in the current font \columnsep distance between columns \columnwidth width of the column \linewidth width of the line in the current environment \paperwidth width of the page \paperheight height of the page \textwidth width of the text \textheight height of the text \unitleght units of length in the picture environment

19 \setlength{\textwidth}{15cm}

20 Sections Book has chapters, Article does not - sections
\section{Section Title} \subsection{Title} \subsubsection{Title} LaTeX provides 7 levels of depth for defining sections

21 chapters and sections in a Book/Report - Example
\documentclass{report} \begin{document} \tableofcontents{} \chapter{Introduction} \section{Wireless Sensor Networks} \subsection{Deployment and Characteristics} ….. \chapter{Literature Survey} \section{Performance} ……... \end{document}

22 Table of contents - auto generated
add the command \tableofcontents - where it needs to be printed The default ToC will list headings of level 3 and above – to change add command \setcounter{tocdepth}{number} in the preamble The commands \listoffigures and \listoftables work in exactly the same way as \tableofcontents to automatically list all the tables and figures

23 Mathematical Typesetting
There are three environments that put LaTeX in math mode: math - For formulas that appear right in the text. displaymath - For formulas that appear on their own line. equation - The same as the displaymath environment except that it adds an equation number in the right margin

24 Mathematical Typesetting
1) \(...\) or \begin{math}...\end{math} or $ … $ 2) \[...\] or \begin{displaymath}...\end{displaymath} 3) \begin{equation} \lable{key} …. \end{equation} - lable is optional

25 Mathematical Typesetting
Sample code - \begin{equation} \label{eq:solve} x^2 - 5 x + 6 = 0 \end{equation} \[ x_1 = \frac{5 + \sqrt{ \times 6}}{2} = 3 \] $ a=b+c\div{d-c} $ \begin{equation} x_2 = \frac{5 - \sqrt{ \times 6}}{2} = 2 \end{equation} and so we have solved equation~\ref{eq:solve}

26 Mathematical Typesetting

27 Inserting Images Latex can not manage images by itself, so we need to use the graphicx package. include the following line in the preamble: \usepackage{graphicx} The command \graphicspath{ }} – path of the images folder %Path in Windows format: \graphicspath{ {c:/user/images/} }  %Path in Unix-like (Linux, OsX) format \graphicspath{ {/home/user/images/} } The \includegraphics{image} command is the one that actually included the image in the document.

28 Inserting Images Sample code \documentclass{article}
\usepackage{graphicx} \graphicspath{ {images/} }  \begin{document} The universe is immense and it seems to be homogeneous, in a large scale, everywhere we look at.  \includegraphics{universe} There's a picture of a galaxy above \end{document}

29 Inserting Images Changing the image size \includegraphics[scale=1.5]{image} Positioning \begin{figure}[h] \includegraphics[width=8cm]{Plot} \end{figure} h – Place the float here, i.e., approximately at the same point it occurs in the source text

30 Inserting Images Parameters for positioning
h - places the float “here” t - position at top of the page b -position at bottom of the page p - puts a special page for floats only ! - Override internal parameters LaTeX uses for determining "good" float positions H - Places the float at precisely the location in the LaTeX code, equivalent to h

31 Inserting Image Wrap text around an image
\begin{wrapfigure}{r}{0.25\textwidth} %this figure will be at the right \centering \includegraphics[width=0.25\textwidth]{mesh} \end{wrapfigure}

32 Inserting Image Captioning images \begin{figure}[h]
\caption{Example of a WSN network)} \centering \includegraphics[width=0.5\textwidth]{WSN}\end{figure}

33 Inserting Images Labels and cross-references \begin{figure}[h]
\centering \includegraphics[width=0.25\textwidth]{mesh} \caption{a nice plot} \label{fig:mesh1} \end{figure}  As you can see in the figure \ref{fig:mesh1}, the function grows near 0. Also, in the page \pageref{fig:mesh1} is the same example.

34 Inserting Images There are three commands that generate cross-references in this example. \label{fig:mesh1} This will set a label for this figure. Since labels can be used in several types of elements within the document, it's a good practice to use a prefix, such as fig: in the example. \ref{fig:mesh1} This command will insert the number assigned to the figure. It's automatically generated and will be updated if insert some other figure before the referenced one. \pageref{fig:mesh1} This prints out the page number where the referenced image appears. \listoffigures - to automatically generate a list of figures.

35 Inserting Tables Tables can be created using tabular environment.
\begin{tabular}[pos]{cols} table content \end{tabular} pos : Vertical position. It can assume the following values: t - the line at the top is aligned with the text baseline b - the line at the bottom is aligned with the text baseline c or none - the table is centered to the text baseline

36 Inserting Tables cols : Defines the alignment and the borders of each column l - left-justified column c - centred column r - right-justified column p{'width'} - text vertically aligned at the top m{'width'} - text vertically aligned in the middle (requires array package) b{'width'} - text vertically aligned at the bottom (requires array package) | vertical line || double vertical line

37 Inserting Tables To separate between cells and introducing new lines use the following commands: & - column separator \\ -start new row (additional space may be specified after \\ using square brackets, such as \\[6pt]) \hline - horizontal line between rows \newline - start a new line within a cell (in a paragraph column) \cline{i-j} - partial horizontal line beginning in column i and ending in column j

38 Inserting Tables Example 1 \begin{center} \begin{tabular}{ c c c }
cell1 & cell2 & cell3 \\ cell4 & cell5 & cell6 \\ cell7 & cell8 & cell9 \end{tabular} \end{center}

39 Inserting Tables Example 2 \begin{center} \begin{tabular}{ |c|c|c| }
\hline cell1 & cell2 & cell3 \\ cell4 & cell5 & cell6 \\ cell7 & cell8 & cell9 \\ \end{tabular} \end{center} { |c|c|c| }

40 Referencing Referencing Style:
ieeetr, unsrt, plain, acm, abbrv, apa, alpha Usage: \cite{bdvs07} – bdvs07: Article details in Bib file (sample.bib) \bibliographystyle{ieeetr}- ieeetr referencing style \bibliography{sample}- sample.bib file which contains articles details

41 Sample

42 BIB File(sample.bib)

43 Generating BIB File

44 Google Scholar Or Any Citation Data Base With Text to BiB online
Generating BIB File Google Scholar Or Any Citation Data Base With Text to BiB online

45 andhedharani@rvce.edu.in & manjuprasad32@gsss.edu.in
Thank you &


Download ppt "Agenda Introduction Installation Document Structure"

Similar presentations


Ads by Google