SlideShare ist ein Scribd-Unternehmen logo
1 von 51
Downloaden Sie, um offline zu lesen
LATEX
WORKSHOP
By
Mohamed A. Alrshah
15 November, 2015
TEX?
 TEX is a typesetting system that incorporates a
macro processor.
 A TEX source document specifies a number of
macro definitions that instruct the TEX engine
how to typeset the document. 
 Its implementations are governed by the
principle that the same input should produce the
same output.
LATEX?..
LATEX2ε?..
MiKTEX?..
 LATEX is a macro package which enables authors to
typeset and print their work at the highest
typographical quality, using a predefined, professional
layout. It uses the TEX formatter as its typesetting
engine.
 LATEX2ε includes all the patches which had cropped
up since the release of LATEX 2.09.
 MiKTEX is an up-to-date implementation of TEX and
related programs (installation package).
The Concept
How does LATEX works?
INPUT
.tex : The manuscript
text with interspersed
TEX commands.
.eps, .pdf, .jpg, etc :
graphics files.
.bib: bibliography.
PROCESS/COMPILE
Latex.exe
Pdflatex.exe
LuaTeX.exe
XeTeX .exe
OUTPUT
1- .dvi or .pdf,
HTML, XML, etc.
2- .log: transcript
3- .aux: auxiliary
LATEX vs WYSIWYG
Criterion WYSIWYG LATEX
Document Editing Users need to use the same tool. Users can arbitrary use any text editor.
Changing format
The entire document needs to be
checked for any unwanted results.
The class and some commands need
to be changed.
Layout quality
High quality layout can be reached by
professional users only.
The standard Layout is already high
quality.
Huge contents
program crashes and instability likely
happen with large documents especially
if high-quality graphics incorporated.
Faster since only text and formatting
commands merged and the separate
typesetting steps are only done.
Citation
Requires additional tool such as
Mendeley or Endnote.
It is professionally handled using the
free and built-in BibTeX tool.
compatibility Low compatibility with all editors & OSs.
High compatibility with all editors &
OSs.
Backward compatibility Is not fully supported. Is not fully supported.
Split work into many files
Usually no practicable solution
available.
Available.
Cost Some are free with limited features. Free
Installation Packages
1- The TeX engine:
basic-miktex-2.9.5105-x64.exe
2- The TeX editor:
texstudio-2.10.2-win-qt5.5.0.exe
3- Postscript and PDF interpreter/renderer:
gs916w64.exe
4- Postscript and PDF viewer:
gsv50w64.exe
Note: all packages are FREE.
Installation: MikTeX
Instructions:
 Download Link : http://www.miktex.org/download/
 Which version fits your OS (x32 or x64)?
MikTeX: Options
MikTeX: Update Wizard
MikTeX: Package Manager
(ADD/Remove)
Installation: TeXstudio
 Download Link http://texstudio.sourceforge.net/
 Which version fits your OS (x32 or x64)?
TeXstudio: Dictionary Setting.
 TeXstudio>Options>General> Dictionaries
TeXstudio: Commands Configurations.
 TeXstudio>Options>Commands
TeXstudio: Compiler Configurations.
 TeXstudio>Options>Build
documentclass[option1, option2, …]{class}
…
usepackage{package1}
usepackage[options]{package2}
usepackage{package3, package4}
usepackage[options]{package5, package6}
…
…
begin{document}
…
…
...
end{document}
LATEX: Basic Document Structure
The preamble
The content
LATEX: Basic Document Structure
Examples:
documentclass[10pt,a4paper]{article}
title{You must put the title Here}
author{The name of first author
and The name of second author}
date{15/11/2015}
begin{document}
maketitle
You can write anything here. You can write
anything here. You can write anything here.
You can write anything here. You can write
anything here. You can write anything here.
You can write anything here.
end{document}
LATEX: Document classes
Document Classes Description
article
For articles in scientific journals, presentations, short reports, program
documentation, invitations, ...
IEEEtran For articles with the IEEE Transactions format.
proc A class for proceedings based on the article class.
report For longer reports containing several chapters, small books, thesis, ...
book For real books.
slides For slides. The class uses big sans serif letters.
memoir
For changing sensibly the output of the document. It is based on
the book class, but you can create any kind of document with it.
letter For writing letters.
beamer For writing presentations see LaTeX/Presentations).
elsarticle For articles with the Elsevier format.
Document Class
Options
Description
10pt, 11pt, 12pt Sets the size of the main font in the document. If no option is specified, 10pt is assumed.
a4paper, b5paper,
letterpaper,...
Defines the paper size. The default size is letterpaper; However, many European distributions of TeX now
come pre-set for A4, not Letter, and this is also true of all distributions of pdfLaTeX. Besides that, a5paper,
b5paper, executivepaper, and legalpaper can be specified.
fleqn Typesets displayed formulas left-aligned instead of centered.
leqno Places the numbering of formulas on the left hand side instead of the right.
titlepage, notitlepage
Specifies whether a new page should be started after the document title or not. The article class does not
start a new page by default, while report and book do.
onecolumn,twocolumn Instructs LaTeX to typeset the document in two columns instead of one.
twoside, oneside
Specifies whether double or single sided output should be generated. The classes article and report are
single sided and the book class is double sided by default. Note that this option concerns the style of the
document only. The option twoside does not tell the printer you use that it should actually make a two-sided
printout.
landscape Changes the layout of the document to print in landscape mode.
openright, openany
Makes chapters begin either only on right hand pages or on the next page available. This does not work with
the article class, as it does not know about chapters. The report class by default starts chapters on the next
page available and the book class starts them on right hand pages.
draft, final
makes LaTeX indicate hyphenation and justification problems with a small square in the right-hand margin
of the problem line so they can be located quickly by a human. It also suppresses the inclusion of images
and shows only a frame where they would normally occur.
LATEX: Document class options
File extension Description
.tex LATEX or TEX input file.
.sty LATEX Macro package.
.dtx Documented TEX.
.cls Document class files
.dvi Device Independent File (output).
.log Log a detailed of the compilation process
.toc Table of content
.lof List of figures
.lot List of tables
.aux Auxiliary file, store information about the cross-references.
.idx Stores the words that go into the index in this file.
LATEX: File types
LATEX: Basic Commands
documentclass{article}
begin{document}
section{Section Name}
Section body.
subsection{Subsection Name}
Subsection body.
subsubsection{SubsubSection Name}
Subsubsection body.
paragraph{Paragraph Name}
Paragraph body.
subparagraph{SubParagraph Name}
Subparagraph body.
end{document}
LATEX: Breaking lines and text
Command Description
newline,  Start a new line
* prohibits a page break after the forced line break
newpage Start a new page
mbox{text} Keep several words together with out breaking between lines
hyphenation{word list},
-
hyphenation{hyph-ena-tion}
anti-disestablishmentarianism
LATEX: Font styles
Command Description
emph{text} Emphasis (switches between textit and textrm ).
textmd{text} Medium weight (default).
textbf{text} Boldface font style.
textup{text} Upright font style
textsl{text} Slanted font style.
textsf{text} Sans serif.
textsc{text} Small caps.
texttt{text} Typewriter font style
textnormal{text} Main document font.
LATEX: Font styles
Command 10pt 11pt 12pt
tiny 5 6 6
scriptsize 7 8 8
footnotesize 8 9 10
small 9 10 10.95
normalsize 10 10.95 12
large 12 12 14.4
Large 14.4 14.4 17.28
LARGE 17.28 17.28 20.74
huge 20.74 20.74 24.88
Huge 24.88 24.88 24.88
documentclass[11pt]{article}
tiny sample text
large sample text
Huge sample text
LATEX: Cross referencing
documentclass{article}
begin{document}
section{Section1}label{sec1}
Here is the Section 1 body.
section{Section2}
As mentioned in Section ref{sec1}.
subsection{Subsection1}
$beta$ is calculated as in Equation ref{eq1}.
begin{equation} label{eq1}
beta leftarrow frac{5 (pi - 1)}{lambda^2}
end{equation}
end{document}
LATEX: Environments
begin{environment}
text
end{environment}
 List Environment
 Unnumbered list:
 Numbered list:
Unordered list
begin{itemize}
item An item.
item another item.
end{itemize}
Numbered list
begin{enumerate}
item first item.
item second item.
end{enumerate}
LATEX: Environments
 Text Justification
 Flushleft
 Flushright
 Center
begin{flushleft}
This text is left-aligned.
force LaTeX{} not to make
each line the same length.
end{flushleft}
begin{flushright}
This text is right-aligned. 
The second line is a also right-aligned
end{flushright}
begin{center}
This text centered. 
The second line is a also centered
end{center}
LATEX: Environments
 Tables
Table
Tabular
begin{table}[placement]
body of the table
caption{table title}
end{table}
begin{tabular}[pos]{cols}
entry 1 & entry 2... & entry n 
...
end{tabular}
Placement Description
h here
t at the top of the page
b at the bottom of the page
p on a dedicated page of floats
! override the default float
restrictions
pos Description
t align on top row
b align on bottom row
c align to the centre
cols Description
l a column of left-aligned items
r a column of right-aligned items
c a column of centered items
p{wd} a column with specific width
| A vertical line
Tables
 Example
begin{table}[h]
centering
caption {Simulation Parameters}
begin{tabular}[width=linewidth]{p{5cm}p{2.2cm}} hline
Parameter & Value  hline
Simulation time & 500 sec 
MAC layer & IEEE 802.11e 
Preamble length & 144 bits 
PLCP header length & 48 bits  hline
end{tabular}
label{tab:SimPars}
end{table}
Table
Tabular
begin{table}[placement]
body of the table
caption{table title}
end{table}
begin{tabular}[pos]{cols}
entry 1 & entry 2... & entry n 
...
end{tabular}
Tables (multirows and multicoulmns)
 Add usepackage{multirow} to the preamble
begin{table}
centering
begin{tabular}{ |l|l|l| } hline
multicolumn{3}{ |c| }{Something}  hline
entity 1 & entity 2 & entity 3  hline
multirow{4}{*}{Anything}
& entity 4 & entity 5 
& entity 6 & entity 7 
& entity 8 & entity 9 
& entity 10 & entity 11  hline
end{tabular}
caption{Example of Multirow and Multicolumn}
label{tab:label}
end{table}
Including graphics
 You can include any type of graphs (jpg, png, bmp, pdf, eps, ps, etc.)
 But the most preferable graph types is Encapsulated PostScript (EPS)
 Usable by any vector graphic application
 Supports transparency
 Editable file since it contains a description of the graphic objects using
the PostScript page description language.
 Can be enlarged indefinitely without losing quality.
 Steps to include graphics to LaTeX document:
1. prepare the .eps graphic
2. Load the graphics or graphicx package
3. Include the graphic in the .tex file
Including graphics
 Load the graphicx package
 Put the following command in the preamble
usepackage{graphicx}
 Include the graph
 The options of Includegraphics
begin{figure}[h]
centering
includegraphics[width=0.7linewidth]{plot}
caption{Figure Caption Here}
label{fig:plot}
end{figure}
option Description
width change the graphic width
height change the graphic hight
angle rotate graphic counterclockwise with a specific degree
scale scale graphic (% from the original size)
option Description
Is there any wizard?
 Yes there are several wizards in TeXstudio.
 Wizards can help you quickly to do:
 Quick starting.
 Quick beamer presentation.
 Quick letter.
 Quick tabular.
 Quick tabbing.
 Quick array.
 Insert graphics (but drag and drop is much easier).
 Math assistant.
Algorithms: Predefined keywords
Command Description
; End of line
tcp*{} Comment on the line
tcp{} Comment as a separate line
BlankLine for new blank line
KwIn{input} KwOut{output}
KwData{input} KwResult{output}
Input, output keywords
KwRet{value} Return{value} Return keywords
If(then comment){condition} {then block} If statement with end keyword
uIf(then comment){condition}{ then block without end} If statement without end keyword
ElseIf(else comment){elseif block} elseIf statement with end keyword
uElseIf( else comment){elseif block} elseIf statement without end keyword
Switch(switch comment){condition}{Switch block} Switch keyword
Case(case comment){a case}{case block} case keyword with end keyword
uCase(case comment){a case}{case block without end} case keyword without end keyword
Other(other comment){otherwise block} otherwise keyword
For(for comment){condition}{text loop} for loop with end keyword
lFor(for comment){condition}{text loop} for loop without end keyword
While(while comment){condition}{text loop} while loop with end keyword
ForEach(foreach comment){condition}{text loop} for each loop with end keyword
ForAll(forall comment){condition}{text loop} forall loop with end keyword
Algorithms
 Redefine the keywords
SetKwInput{KwData}{Data}
SetKwInput{KwResult}{Result}
SetKwInput{KwIn}{Input}
SetKwInput{KwOut}{Output}
SetKw{KwTo}{to}
SetKw{KwRet}{return}
SetKw{Return}{return}
SetKwBlock{Begin}{begin}{end}
SetKwComment{tcc{/*}{*/}
SetKwComment{tcp}{//}{}
SetKwIF{If}{ElseIf}{Else}{if}{then}{else if}{else}{endif}
…
 Example
SetKwFor{For}{for}{do}{done}
Default definition New definition
For condition do for comment
| text loop
end
For condition do for comment
| text loop
done
Algorithms
 usepackage[linesnumbered, ruled]{algorithm2e}
For more information about algorithm2e refer to: http://ctan.mirrorcatalogs.com/macros/latex/contrib/algorithm2e/doc/algorithm2e.pdf
SetKwProg{Initialize}{Initialize}{ }{end}
SetKwProg{Function}{Function}{ }{end}
SetKwProg{Event}{Event}{ do}{event-end}
SetKwInOut{Input}{input}
begin{algorithm}
caption{Agile-SD Congestion Avoidance.}label{algo01}
Input{$tcp_status$}
Initialize{Variables}
{
$lambda_{min} leftarrow 1, lambda_{max} leftarrow 3,$
$beta_1 leftarrow 0.90, beta_2 leftarrow 0.95,$
$cwnd leftarrow 2$
}
Function{On ACK Receiption}
{
calculate $gap_{current}$
calculate $gap_{total}$
calculate $lambda$
$alpha = frac{lambda}{cwnd}$
$cwnd leftarrow cwnd + alpha$
}
Event{On Loss Detection}
{
$cwnd_{loss} leftarrow cwnd$
uIf {$tcp_status = SlowStart$} {
$cwnd leftarrow cwnd times beta_1$ }
Else {
$cwnd leftarrow cwnd times beta_2$ }
$ssthresh leftarrow cwnd - 1$
$cwnd_{degraded} leftarrow cwnd$
}
end{algorithm}
Theorems
(theorems, definitions, propositions, remarks, corollaries, lemmas, etc.)
 usepackage{amsthm}
 Define the environment in the preamble
newtheorem{name}{display word}
 Examples
newtheorem{theorem}{Theorem}
newtheorem{corollary}{Corollary}
newtheorem{lemma} {Lemma}
newtheorem{prop}{Proposition}
 Numbering rules
newtheorem{theorem}{Theorem}[section]
newtheorem{corollary}{Corollary}[theorem]
newtheorem{lemma}[theorem]{Lemma}
newtheorem{prop}{Proposition}
Theorems
newtheorem{theorem}{Theorem}[section]
newtheorem{corollary}{Corollary}[theorem]
newtheorem{lemma}[theorem]{Lemma}
newtheorem{prop}{Proposition}
section{Introduction}
Introduction to use $setminus newtheorem$ command.
begin{theorem}[anyoption] label{theo1}
Place the theorem definition here.
end{theorem}
begin{proof}
Place the proof of Theorem ref{theo1} here.
end{proof}
begin{corollary} label{cor1}
Place the corollary definition here.
end{corollary}
Refer to your theorem ref{theo1} or corollary ref{cor1}
begin{prop} label{prop1}
Place the proposition definition here.
end{prop}
begin{proof}
Place the proof of Proposition ref{prop1} here.
end{proof}
Mathematical Formulas
 usepackage{amsmath}
 in-line mathematical formula
$ inline formula here $
 Example
$c$ squared is calculated as the summation of $a$
squared and $b$ squared. Or, using more
mathematical approach: $c^2 = a^2 + b^2$
Mathematical Formulas
 equation environment
begin{equation}
your formulas here
end{equation}
o Numbered equation
o Unnumbered equation
Add $a$ squared and $b$ squared
to get $c$ squared. Or, using
a more mathematical approach
begin{equation}
a^2 + b^2 = c^2
end{equation}
Add $a$ squared and $b$ squared
to get $c$ squared. Or, using
a more mathematical approach
begin{equation*}
a^2 + b^2 = c^2
end{equation*}
Mathematical Formulas
 multiline
 align
begin{multline*}
a + b + c + d + e + f + g + h + I 
= j + k + l + m + n
end{multline*}
begin{align}
a & = b + c 
& = d + e + f + g + h + i + j + k + l nonumber 
& + m + n + o 
& = p + q + r + s
end{align}
Mathematical Formulas
 IEEEeqnarray
 Requires IEEEtrantools.sty which can be obtained from
https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/tools
 usepackage[retainorgcmds]{IEEEtrantools}
 Example:
 Fine whitespaces can be added by using “:” to fix the unaligned entities
begin{IEEEeqnarray}{rCl}
a & = & b + c 
& = & d + e + f + g + h nonumber
& + & l + m + n + o 
& = & p + q + r + s
end{IEEEeqnarray}
Mathematical Formulas
 Arrays
Example1
Example2
begin{equation*}
mathbf{X} = left(
begin{array}{ccc}
x_1 & x_2 & ldots 
x_3 & x_4 & ldots 
vdots & vdots & ddots
end{array} right)
end{equation*}
begin{equation*}
|x| = left{
begin{array}{rl}
-x & text{if } x < 0,
0 & text{if } x = 0,
x & text{if } x > 0.
end{array} right.
end{equation*}
Mathematical Formulas
 Matrices
Example
practice TeXstudio>Wizards>Quick Array… for more matrix types
begin{equation}
mathbf{P}=
begin{bmatrix}
p_{11} & p_{12} & ldots
& p_{1n} 
p_{21} & p_{22} & ldots
& p_{2n} 
vdots & vdots & ddots
& vdots 
p_{m1} & p_{m2} & ldots
& p_{mn}end{bmatrix}
end{equation}
Mathematical Formulas
 Spacing
, : quad qquad
 Delimiter sizes
Without left and right macros
With left and right macros
begin{equation*}
1 + (frac{1}{1-x^{2}})^3
end{equation*}
begin{equation*}
1 + left(frac{1}{1-x^{2}}
right)^3
end{equation*}
Bibliography
 Bibliography database (.bib)
…
@ARTICLE{ruscelli2012,
author = {{A}nna {L}ina {R}uscelli and {G}abriele {C}ecchetti and {A}ngelo
{A}lifano and {G}iuseppe {L}ipari},
title = {{E}nhancement of {Q}o{S} support of {HCCA} schedulers using {EDCA}
function in {IEEE} 802.11e networks},
journal = {{A}d {H}oc {N}etworks},
year = {2012},
volume = {10},
pages = {147 - 161},
number = {2},
doi = {10.1016/j.adhoc.2010.09.014},
issn = {1570-8705},
opturl = {http://www.sciencedirect.com/science/article/pii/S157087051000154X}
}
…
Bibliography
 Steps to deal with citation
1. Prepare the bibliography file (.bib), perhaps using jabRef
2. Add the following command in the end of the (.tex) document file,
where the references section is:
Example:
4. Cite the reference in you text using the following command
bibliographystyle{bibliography style}
bibliography{bibliograpy database file}
bibliographystyle{IEEEtran}
bibliography{your-bib-database}
… cite{ruscelli2012} …
Bibliography
 List of bibliography styles
Style Name Author Name Format Sorting
unsrt Homer Jay Simpson as referenced
plain Homer Jay Simpson by author
named Homer Jay Simpson
authordate1 Simpson, Homer Jay
apa Simpson, H. J. (1995)
alpha Homer Jay Simpson by author
acm Simpson, H. J.
abstract Homer Jay Simpson
abbrv H. J. Simpson by author
Bibliography
 Multiple citation
Several approaches such as cite{Lee2009, Jansang2011,
Cecchetti2012, cecchettielAL2012, ruscelli2012} have been
presented in the literature attempting to remedy the deficiency of
the HCCA reference scheduler in supporting QoS for VBR traffics.
Getting things together
 applying latex template
1. Get the IEEEtrans template from https://www.ctan.org/ or
https://www.ieee.org/conferences_events/conferences/publishin
g/templates.html
2. Extract the template file (which includes IEEEtran.cls)into a folder
3. Copy images files
4. Copy reference.bib
5. add your material in the given template’s places
6. Compile
7. Done!
References
 https://en.wikibooks.org/wiki/LaTeX
 LaTeX Tutorial, Je Clark, Revised February 26, 2002
 Learning LATEX by Doing, Andr’e Heck, March 2005, AMSTEL Institute
 The Not So Short Introduction to LATEX2E, Tobias Oetiker,Hubert Partl,
Irene Hyna and Elisabeth Schlegl, Version 5.05, July 18, 2015
 Latex Workshop, Mohammed A. Al-maqri, April 2015, UPM.

Weitere ähnliche Inhalte

Was ist angesagt?

LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners Tilak Devaraj
 
Latex workshop: Essentials and Practices
Latex workshop: Essentials and PracticesLatex workshop: Essentials and Practices
Latex workshop: Essentials and PracticesMohamed Alrshah
 
Latex Introduction for Beginners
Latex Introduction for BeginnersLatex Introduction for Beginners
Latex Introduction for Beginnersssuser9e8fa4
 
Research 101 - Paper Writing with LaTeX
Research 101 - Paper Writing with LaTeXResearch 101 - Paper Writing with LaTeX
Research 101 - Paper Writing with LaTeXJia-Bin Huang
 
How to make a presentation with LATEX? Introduction to BeamerPresentation ben...
How to make a presentation with LATEX? Introduction to BeamerPresentation ben...How to make a presentation with LATEX? Introduction to BeamerPresentation ben...
How to make a presentation with LATEX? Introduction to BeamerPresentation ben...researchcenterm
 
documents writing with LATEX
documents writing with LATEXdocuments writing with LATEX
documents writing with LATEXAnusha Vajrapu
 
Introduction to LaTeX (For Word users)
 Introduction to LaTeX (For Word users) Introduction to LaTeX (For Word users)
Introduction to LaTeX (For Word users)Guy K. Kloss
 
scientific writing 01 - latex
scientific writing   01 - latexscientific writing   01 - latex
scientific writing 01 - latexLeo Chen
 
Editing documents with LaTeX
Editing documents with LaTeXEditing documents with LaTeX
Editing documents with LaTeXLaura M. Castro
 
Control structures functions and modules in python programming
Control structures functions and modules in python programmingControl structures functions and modules in python programming
Control structures functions and modules in python programmingSrinivas Narasegouda
 
Academic writing in LaTeX
Academic writing in LaTeX Academic writing in LaTeX
Academic writing in LaTeX Daniele Di Mitri
 
Introduction to pandas
Introduction to pandasIntroduction to pandas
Introduction to pandasPiyush rai
 

Was ist angesagt? (20)

Introduction to Latex
Introduction to Latex Introduction to Latex
Introduction to Latex
 
LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners
 
Latex workshop: Essentials and Practices
Latex workshop: Essentials and PracticesLatex workshop: Essentials and Practices
Latex workshop: Essentials and Practices
 
Latex workshop
Latex workshopLatex workshop
Latex workshop
 
Latex Introduction for Beginners
Latex Introduction for BeginnersLatex Introduction for Beginners
Latex Introduction for Beginners
 
LaTeX Basics
LaTeX BasicsLaTeX Basics
LaTeX Basics
 
Research 101 - Paper Writing with LaTeX
Research 101 - Paper Writing with LaTeXResearch 101 - Paper Writing with LaTeX
Research 101 - Paper Writing with LaTeX
 
How to make a presentation with LATEX? Introduction to BeamerPresentation ben...
How to make a presentation with LATEX? Introduction to BeamerPresentation ben...How to make a presentation with LATEX? Introduction to BeamerPresentation ben...
How to make a presentation with LATEX? Introduction to BeamerPresentation ben...
 
documents writing with LATEX
documents writing with LATEXdocuments writing with LATEX
documents writing with LATEX
 
Introduction to LaTeX (For Word users)
 Introduction to LaTeX (For Word users) Introduction to LaTeX (For Word users)
Introduction to LaTeX (For Word users)
 
Latex Tuitorial
Latex TuitorialLatex Tuitorial
Latex Tuitorial
 
scientific writing 01 - latex
scientific writing   01 - latexscientific writing   01 - latex
scientific writing 01 - latex
 
Editing documents with LaTeX
Editing documents with LaTeXEditing documents with LaTeX
Editing documents with LaTeX
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 
Control structures functions and modules in python programming
Control structures functions and modules in python programmingControl structures functions and modules in python programming
Control structures functions and modules in python programming
 
Academic writing in LaTeX
Academic writing in LaTeX Academic writing in LaTeX
Academic writing in LaTeX
 
Data structures using c
Data structures using cData structures using c
Data structures using c
 
Heap sort
Heap sortHeap sort
Heap sort
 
Introduction to pandas
Introduction to pandasIntroduction to pandas
Introduction to pandas
 
What is matlab
What is matlabWhat is matlab
What is matlab
 

Ähnlich wie Introduction to Latex

Ähnlich wie Introduction to Latex (20)

latex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshahlatex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshah
 
LATEX.ppt
LATEX.pptLATEX.ppt
LATEX.ppt
 
Latex Tutorial by Dr. M. C. Hanumantharaju
Latex Tutorial by Dr. M. C. HanumantharajuLatex Tutorial by Dr. M. C. Hanumantharaju
Latex Tutorial by Dr. M. C. Hanumantharaju
 
LaTex tutorial with Texstudio
LaTex tutorial with TexstudioLaTex tutorial with Texstudio
LaTex tutorial with Texstudio
 
Write effectlively in late x
Write effectlively in late xWrite effectlively in late x
Write effectlively in late x
 
Chap03 scr
Chap03 scrChap03 scr
Chap03 scr
 
La tex basics
La tex basicsLa tex basics
La tex basics
 
Introduction to LaTeX
Introduction to LaTeXIntroduction to LaTeX
Introduction to LaTeX
 
Latex Tutorial
Latex TutorialLatex Tutorial
Latex Tutorial
 
Latex Notes
Latex NotesLatex Notes
Latex Notes
 
Installation guide for Latex and MOODLE
Installation guide for Latex and MOODLEInstallation guide for Latex and MOODLE
Installation guide for Latex and MOODLE
 
latex document for IT workshop Lab . B.Tech
latex document for IT workshop Lab . B.Techlatex document for IT workshop Lab . B.Tech
latex document for IT workshop Lab . B.Tech
 
Chap16 scr
Chap16 scrChap16 scr
Chap16 scr
 
Latex ppt copy
Latex ppt   copyLatex ppt   copy
Latex ppt copy
 
LaTeX Part 1
LaTeX Part 1LaTeX Part 1
LaTeX Part 1
 
Inroduction to Latex
Inroduction to LatexInroduction to Latex
Inroduction to Latex
 
Latex
LatexLatex
Latex
 
xml2tex at TUG 2014
xml2tex at TUG 2014xml2tex at TUG 2014
xml2tex at TUG 2014
 
Technical writing using LaTeX
Technical writing using LaTeXTechnical writing using LaTeX
Technical writing using LaTeX
 
latex cource.pptx
latex cource.pptxlatex cource.pptx
latex cource.pptx
 

Mehr von Mohamed Alrshah

الذكاء الإصطناعي لكل الناس
الذكاء الإصطناعي لكل الناسالذكاء الإصطناعي لكل الناس
الذكاء الإصطناعي لكل الناسMohamed Alrshah
 
المعايير الدولية للنشر العلمي
المعايير الدولية للنشر العلمي المعايير الدولية للنشر العلمي
المعايير الدولية للنشر العلمي Mohamed Alrshah
 
Course of academic writing skills
Course of academic writing skillsCourse of academic writing skills
Course of academic writing skillsMohamed Alrshah
 
International scientific publication standards and mechanisms almahfal 3
International scientific publication standards and mechanisms   almahfal 3International scientific publication standards and mechanisms   almahfal 3
International scientific publication standards and mechanisms almahfal 3Mohamed Alrshah
 
Publishing in high impact factor journals
Publishing in high impact factor journalsPublishing in high impact factor journals
Publishing in high impact factor journalsMohamed Alrshah
 
Soho wireless network applications
Soho wireless network applicationsSoho wireless network applications
Soho wireless network applicationsMohamed Alrshah
 
Publishing in high impact factor journals - Universiti Putra Malaysia
Publishing in high impact factor journals - Universiti Putra MalaysiaPublishing in high impact factor journals - Universiti Putra Malaysia
Publishing in high impact factor journals - Universiti Putra MalaysiaMohamed Alrshah
 
International scientific publication standards and mechanisms
International scientific publication standards and mechanismsInternational scientific publication standards and mechanisms
International scientific publication standards and mechanismsMohamed Alrshah
 
Publishing in high impact factor journals
Publishing in high impact factor journalsPublishing in high impact factor journals
Publishing in high impact factor journalsMohamed Alrshah
 
Getting Ready For Successful Viva
Getting Ready For Successful VivaGetting Ready For Successful Viva
Getting Ready For Successful VivaMohamed Alrshah
 
Mendeley reference management tool
Mendeley reference management toolMendeley reference management tool
Mendeley reference management toolMohamed Alrshah
 
Concepts on some benificial research tools
Concepts on some benificial research toolsConcepts on some benificial research tools
Concepts on some benificial research toolsMohamed Alrshah
 

Mehr von Mohamed Alrshah (12)

الذكاء الإصطناعي لكل الناس
الذكاء الإصطناعي لكل الناسالذكاء الإصطناعي لكل الناس
الذكاء الإصطناعي لكل الناس
 
المعايير الدولية للنشر العلمي
المعايير الدولية للنشر العلمي المعايير الدولية للنشر العلمي
المعايير الدولية للنشر العلمي
 
Course of academic writing skills
Course of academic writing skillsCourse of academic writing skills
Course of academic writing skills
 
International scientific publication standards and mechanisms almahfal 3
International scientific publication standards and mechanisms   almahfal 3International scientific publication standards and mechanisms   almahfal 3
International scientific publication standards and mechanisms almahfal 3
 
Publishing in high impact factor journals
Publishing in high impact factor journalsPublishing in high impact factor journals
Publishing in high impact factor journals
 
Soho wireless network applications
Soho wireless network applicationsSoho wireless network applications
Soho wireless network applications
 
Publishing in high impact factor journals - Universiti Putra Malaysia
Publishing in high impact factor journals - Universiti Putra MalaysiaPublishing in high impact factor journals - Universiti Putra Malaysia
Publishing in high impact factor journals - Universiti Putra Malaysia
 
International scientific publication standards and mechanisms
International scientific publication standards and mechanismsInternational scientific publication standards and mechanisms
International scientific publication standards and mechanisms
 
Publishing in high impact factor journals
Publishing in high impact factor journalsPublishing in high impact factor journals
Publishing in high impact factor journals
 
Getting Ready For Successful Viva
Getting Ready For Successful VivaGetting Ready For Successful Viva
Getting Ready For Successful Viva
 
Mendeley reference management tool
Mendeley reference management toolMendeley reference management tool
Mendeley reference management tool
 
Concepts on some benificial research tools
Concepts on some benificial research toolsConcepts on some benificial research tools
Concepts on some benificial research tools
 

Kürzlich hochgeladen

Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 

Kürzlich hochgeladen (20)

Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 

Introduction to Latex

  • 2. TEX?  TEX is a typesetting system that incorporates a macro processor.  A TEX source document specifies a number of macro definitions that instruct the TEX engine how to typeset the document.   Its implementations are governed by the principle that the same input should produce the same output.
  • 3. LATEX?.. LATEX2ε?.. MiKTEX?..  LATEX is a macro package which enables authors to typeset and print their work at the highest typographical quality, using a predefined, professional layout. It uses the TEX formatter as its typesetting engine.  LATEX2ε includes all the patches which had cropped up since the release of LATEX 2.09.  MiKTEX is an up-to-date implementation of TEX and related programs (installation package).
  • 5. How does LATEX works? INPUT .tex : The manuscript text with interspersed TEX commands. .eps, .pdf, .jpg, etc : graphics files. .bib: bibliography. PROCESS/COMPILE Latex.exe Pdflatex.exe LuaTeX.exe XeTeX .exe OUTPUT 1- .dvi or .pdf, HTML, XML, etc. 2- .log: transcript 3- .aux: auxiliary
  • 6. LATEX vs WYSIWYG Criterion WYSIWYG LATEX Document Editing Users need to use the same tool. Users can arbitrary use any text editor. Changing format The entire document needs to be checked for any unwanted results. The class and some commands need to be changed. Layout quality High quality layout can be reached by professional users only. The standard Layout is already high quality. Huge contents program crashes and instability likely happen with large documents especially if high-quality graphics incorporated. Faster since only text and formatting commands merged and the separate typesetting steps are only done. Citation Requires additional tool such as Mendeley or Endnote. It is professionally handled using the free and built-in BibTeX tool. compatibility Low compatibility with all editors & OSs. High compatibility with all editors & OSs. Backward compatibility Is not fully supported. Is not fully supported. Split work into many files Usually no practicable solution available. Available. Cost Some are free with limited features. Free
  • 7. Installation Packages 1- The TeX engine: basic-miktex-2.9.5105-x64.exe 2- The TeX editor: texstudio-2.10.2-win-qt5.5.0.exe 3- Postscript and PDF interpreter/renderer: gs916w64.exe 4- Postscript and PDF viewer: gsv50w64.exe Note: all packages are FREE.
  • 8. Installation: MikTeX Instructions:  Download Link : http://www.miktex.org/download/  Which version fits your OS (x32 or x64)?
  • 12. Installation: TeXstudio  Download Link http://texstudio.sourceforge.net/  Which version fits your OS (x32 or x64)?
  • 13. TeXstudio: Dictionary Setting.  TeXstudio>Options>General> Dictionaries
  • 14. TeXstudio: Commands Configurations.  TeXstudio>Options>Commands
  • 15. TeXstudio: Compiler Configurations.  TeXstudio>Options>Build
  • 16. documentclass[option1, option2, …]{class} … usepackage{package1} usepackage[options]{package2} usepackage{package3, package4} usepackage[options]{package5, package6} … … begin{document} … … ... end{document} LATEX: Basic Document Structure The preamble The content
  • 17. LATEX: Basic Document Structure Examples: documentclass[10pt,a4paper]{article} title{You must put the title Here} author{The name of first author and The name of second author} date{15/11/2015} begin{document} maketitle You can write anything here. You can write anything here. You can write anything here. You can write anything here. You can write anything here. You can write anything here. You can write anything here. end{document}
  • 18. LATEX: Document classes Document Classes Description article For articles in scientific journals, presentations, short reports, program documentation, invitations, ... IEEEtran For articles with the IEEE Transactions format. proc A class for proceedings based on the article class. report For longer reports containing several chapters, small books, thesis, ... book For real books. slides For slides. The class uses big sans serif letters. memoir For changing sensibly the output of the document. It is based on the book class, but you can create any kind of document with it. letter For writing letters. beamer For writing presentations see LaTeX/Presentations). elsarticle For articles with the Elsevier format.
  • 19. Document Class Options Description 10pt, 11pt, 12pt Sets the size of the main font in the document. If no option is specified, 10pt is assumed. a4paper, b5paper, letterpaper,... Defines the paper size. The default size is letterpaper; However, many European distributions of TeX now come pre-set for A4, not Letter, and this is also true of all distributions of pdfLaTeX. Besides that, a5paper, b5paper, executivepaper, and legalpaper can be specified. fleqn Typesets displayed formulas left-aligned instead of centered. leqno Places the numbering of formulas on the left hand side instead of the right. titlepage, notitlepage Specifies whether a new page should be started after the document title or not. The article class does not start a new page by default, while report and book do. onecolumn,twocolumn Instructs LaTeX to typeset the document in two columns instead of one. twoside, oneside Specifies whether double or single sided output should be generated. The classes article and report are single sided and the book class is double sided by default. Note that this option concerns the style of the document only. The option twoside does not tell the printer you use that it should actually make a two-sided printout. landscape Changes the layout of the document to print in landscape mode. openright, openany Makes chapters begin either only on right hand pages or on the next page available. This does not work with the article class, as it does not know about chapters. The report class by default starts chapters on the next page available and the book class starts them on right hand pages. draft, final makes LaTeX indicate hyphenation and justification problems with a small square in the right-hand margin of the problem line so they can be located quickly by a human. It also suppresses the inclusion of images and shows only a frame where they would normally occur. LATEX: Document class options
  • 20. File extension Description .tex LATEX or TEX input file. .sty LATEX Macro package. .dtx Documented TEX. .cls Document class files .dvi Device Independent File (output). .log Log a detailed of the compilation process .toc Table of content .lof List of figures .lot List of tables .aux Auxiliary file, store information about the cross-references. .idx Stores the words that go into the index in this file. LATEX: File types
  • 21. LATEX: Basic Commands documentclass{article} begin{document} section{Section Name} Section body. subsection{Subsection Name} Subsection body. subsubsection{SubsubSection Name} Subsubsection body. paragraph{Paragraph Name} Paragraph body. subparagraph{SubParagraph Name} Subparagraph body. end{document}
  • 22. LATEX: Breaking lines and text Command Description newline, Start a new line * prohibits a page break after the forced line break newpage Start a new page mbox{text} Keep several words together with out breaking between lines hyphenation{word list}, - hyphenation{hyph-ena-tion} anti-disestablishmentarianism
  • 23. LATEX: Font styles Command Description emph{text} Emphasis (switches between textit and textrm ). textmd{text} Medium weight (default). textbf{text} Boldface font style. textup{text} Upright font style textsl{text} Slanted font style. textsf{text} Sans serif. textsc{text} Small caps. texttt{text} Typewriter font style textnormal{text} Main document font.
  • 24. LATEX: Font styles Command 10pt 11pt 12pt tiny 5 6 6 scriptsize 7 8 8 footnotesize 8 9 10 small 9 10 10.95 normalsize 10 10.95 12 large 12 12 14.4 Large 14.4 14.4 17.28 LARGE 17.28 17.28 20.74 huge 20.74 20.74 24.88 Huge 24.88 24.88 24.88 documentclass[11pt]{article} tiny sample text large sample text Huge sample text
  • 25. LATEX: Cross referencing documentclass{article} begin{document} section{Section1}label{sec1} Here is the Section 1 body. section{Section2} As mentioned in Section ref{sec1}. subsection{Subsection1} $beta$ is calculated as in Equation ref{eq1}. begin{equation} label{eq1} beta leftarrow frac{5 (pi - 1)}{lambda^2} end{equation} end{document}
  • 26. LATEX: Environments begin{environment} text end{environment}  List Environment  Unnumbered list:  Numbered list: Unordered list begin{itemize} item An item. item another item. end{itemize} Numbered list begin{enumerate} item first item. item second item. end{enumerate}
  • 27. LATEX: Environments  Text Justification  Flushleft  Flushright  Center begin{flushleft} This text is left-aligned. force LaTeX{} not to make each line the same length. end{flushleft} begin{flushright} This text is right-aligned. The second line is a also right-aligned end{flushright} begin{center} This text centered. The second line is a also centered end{center}
  • 28. LATEX: Environments  Tables Table Tabular begin{table}[placement] body of the table caption{table title} end{table} begin{tabular}[pos]{cols} entry 1 & entry 2... & entry n ... end{tabular} Placement Description h here t at the top of the page b at the bottom of the page p on a dedicated page of floats ! override the default float restrictions pos Description t align on top row b align on bottom row c align to the centre cols Description l a column of left-aligned items r a column of right-aligned items c a column of centered items p{wd} a column with specific width | A vertical line
  • 29. Tables  Example begin{table}[h] centering caption {Simulation Parameters} begin{tabular}[width=linewidth]{p{5cm}p{2.2cm}} hline Parameter & Value hline Simulation time & 500 sec MAC layer & IEEE 802.11e Preamble length & 144 bits PLCP header length & 48 bits hline end{tabular} label{tab:SimPars} end{table} Table Tabular begin{table}[placement] body of the table caption{table title} end{table} begin{tabular}[pos]{cols} entry 1 & entry 2... & entry n ... end{tabular}
  • 30. Tables (multirows and multicoulmns)  Add usepackage{multirow} to the preamble begin{table} centering begin{tabular}{ |l|l|l| } hline multicolumn{3}{ |c| }{Something} hline entity 1 & entity 2 & entity 3 hline multirow{4}{*}{Anything} & entity 4 & entity 5 & entity 6 & entity 7 & entity 8 & entity 9 & entity 10 & entity 11 hline end{tabular} caption{Example of Multirow and Multicolumn} label{tab:label} end{table}
  • 31. Including graphics  You can include any type of graphs (jpg, png, bmp, pdf, eps, ps, etc.)  But the most preferable graph types is Encapsulated PostScript (EPS)  Usable by any vector graphic application  Supports transparency  Editable file since it contains a description of the graphic objects using the PostScript page description language.  Can be enlarged indefinitely without losing quality.  Steps to include graphics to LaTeX document: 1. prepare the .eps graphic 2. Load the graphics or graphicx package 3. Include the graphic in the .tex file
  • 32. Including graphics  Load the graphicx package  Put the following command in the preamble usepackage{graphicx}  Include the graph  The options of Includegraphics begin{figure}[h] centering includegraphics[width=0.7linewidth]{plot} caption{Figure Caption Here} label{fig:plot} end{figure} option Description width change the graphic width height change the graphic hight angle rotate graphic counterclockwise with a specific degree scale scale graphic (% from the original size) option Description
  • 33. Is there any wizard?  Yes there are several wizards in TeXstudio.  Wizards can help you quickly to do:  Quick starting.  Quick beamer presentation.  Quick letter.  Quick tabular.  Quick tabbing.  Quick array.  Insert graphics (but drag and drop is much easier).  Math assistant.
  • 34. Algorithms: Predefined keywords Command Description ; End of line tcp*{} Comment on the line tcp{} Comment as a separate line BlankLine for new blank line KwIn{input} KwOut{output} KwData{input} KwResult{output} Input, output keywords KwRet{value} Return{value} Return keywords If(then comment){condition} {then block} If statement with end keyword uIf(then comment){condition}{ then block without end} If statement without end keyword ElseIf(else comment){elseif block} elseIf statement with end keyword uElseIf( else comment){elseif block} elseIf statement without end keyword Switch(switch comment){condition}{Switch block} Switch keyword Case(case comment){a case}{case block} case keyword with end keyword uCase(case comment){a case}{case block without end} case keyword without end keyword Other(other comment){otherwise block} otherwise keyword For(for comment){condition}{text loop} for loop with end keyword lFor(for comment){condition}{text loop} for loop without end keyword While(while comment){condition}{text loop} while loop with end keyword ForEach(foreach comment){condition}{text loop} for each loop with end keyword ForAll(forall comment){condition}{text loop} forall loop with end keyword
  • 35. Algorithms  Redefine the keywords SetKwInput{KwData}{Data} SetKwInput{KwResult}{Result} SetKwInput{KwIn}{Input} SetKwInput{KwOut}{Output} SetKw{KwTo}{to} SetKw{KwRet}{return} SetKw{Return}{return} SetKwBlock{Begin}{begin}{end} SetKwComment{tcc{/*}{*/} SetKwComment{tcp}{//}{} SetKwIF{If}{ElseIf}{Else}{if}{then}{else if}{else}{endif} …  Example SetKwFor{For}{for}{do}{done} Default definition New definition For condition do for comment | text loop end For condition do for comment | text loop done
  • 36. Algorithms  usepackage[linesnumbered, ruled]{algorithm2e} For more information about algorithm2e refer to: http://ctan.mirrorcatalogs.com/macros/latex/contrib/algorithm2e/doc/algorithm2e.pdf SetKwProg{Initialize}{Initialize}{ }{end} SetKwProg{Function}{Function}{ }{end} SetKwProg{Event}{Event}{ do}{event-end} SetKwInOut{Input}{input} begin{algorithm} caption{Agile-SD Congestion Avoidance.}label{algo01} Input{$tcp_status$} Initialize{Variables} { $lambda_{min} leftarrow 1, lambda_{max} leftarrow 3,$ $beta_1 leftarrow 0.90, beta_2 leftarrow 0.95,$ $cwnd leftarrow 2$ } Function{On ACK Receiption} { calculate $gap_{current}$ calculate $gap_{total}$ calculate $lambda$ $alpha = frac{lambda}{cwnd}$ $cwnd leftarrow cwnd + alpha$ } Event{On Loss Detection} { $cwnd_{loss} leftarrow cwnd$ uIf {$tcp_status = SlowStart$} { $cwnd leftarrow cwnd times beta_1$ } Else { $cwnd leftarrow cwnd times beta_2$ } $ssthresh leftarrow cwnd - 1$ $cwnd_{degraded} leftarrow cwnd$ } end{algorithm}
  • 37. Theorems (theorems, definitions, propositions, remarks, corollaries, lemmas, etc.)  usepackage{amsthm}  Define the environment in the preamble newtheorem{name}{display word}  Examples newtheorem{theorem}{Theorem} newtheorem{corollary}{Corollary} newtheorem{lemma} {Lemma} newtheorem{prop}{Proposition}  Numbering rules newtheorem{theorem}{Theorem}[section] newtheorem{corollary}{Corollary}[theorem] newtheorem{lemma}[theorem]{Lemma} newtheorem{prop}{Proposition}
  • 38. Theorems newtheorem{theorem}{Theorem}[section] newtheorem{corollary}{Corollary}[theorem] newtheorem{lemma}[theorem]{Lemma} newtheorem{prop}{Proposition} section{Introduction} Introduction to use $setminus newtheorem$ command. begin{theorem}[anyoption] label{theo1} Place the theorem definition here. end{theorem} begin{proof} Place the proof of Theorem ref{theo1} here. end{proof} begin{corollary} label{cor1} Place the corollary definition here. end{corollary} Refer to your theorem ref{theo1} or corollary ref{cor1} begin{prop} label{prop1} Place the proposition definition here. end{prop} begin{proof} Place the proof of Proposition ref{prop1} here. end{proof}
  • 39. Mathematical Formulas  usepackage{amsmath}  in-line mathematical formula $ inline formula here $  Example $c$ squared is calculated as the summation of $a$ squared and $b$ squared. Or, using more mathematical approach: $c^2 = a^2 + b^2$
  • 40. Mathematical Formulas  equation environment begin{equation} your formulas here end{equation} o Numbered equation o Unnumbered equation Add $a$ squared and $b$ squared to get $c$ squared. Or, using a more mathematical approach begin{equation} a^2 + b^2 = c^2 end{equation} Add $a$ squared and $b$ squared to get $c$ squared. Or, using a more mathematical approach begin{equation*} a^2 + b^2 = c^2 end{equation*}
  • 41. Mathematical Formulas  multiline  align begin{multline*} a + b + c + d + e + f + g + h + I = j + k + l + m + n end{multline*} begin{align} a & = b + c & = d + e + f + g + h + i + j + k + l nonumber & + m + n + o & = p + q + r + s end{align}
  • 42. Mathematical Formulas  IEEEeqnarray  Requires IEEEtrantools.sty which can be obtained from https://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/tools  usepackage[retainorgcmds]{IEEEtrantools}  Example:  Fine whitespaces can be added by using “:” to fix the unaligned entities begin{IEEEeqnarray}{rCl} a & = & b + c & = & d + e + f + g + h nonumber & + & l + m + n + o & = & p + q + r + s end{IEEEeqnarray}
  • 43. Mathematical Formulas  Arrays Example1 Example2 begin{equation*} mathbf{X} = left( begin{array}{ccc} x_1 & x_2 & ldots x_3 & x_4 & ldots vdots & vdots & ddots end{array} right) end{equation*} begin{equation*} |x| = left{ begin{array}{rl} -x & text{if } x < 0, 0 & text{if } x = 0, x & text{if } x > 0. end{array} right. end{equation*}
  • 44. Mathematical Formulas  Matrices Example practice TeXstudio>Wizards>Quick Array… for more matrix types begin{equation} mathbf{P}= begin{bmatrix} p_{11} & p_{12} & ldots & p_{1n} p_{21} & p_{22} & ldots & p_{2n} vdots & vdots & ddots & vdots p_{m1} & p_{m2} & ldots & p_{mn}end{bmatrix} end{equation}
  • 45. Mathematical Formulas  Spacing , : quad qquad  Delimiter sizes Without left and right macros With left and right macros begin{equation*} 1 + (frac{1}{1-x^{2}})^3 end{equation*} begin{equation*} 1 + left(frac{1}{1-x^{2}} right)^3 end{equation*}
  • 46. Bibliography  Bibliography database (.bib) … @ARTICLE{ruscelli2012, author = {{A}nna {L}ina {R}uscelli and {G}abriele {C}ecchetti and {A}ngelo {A}lifano and {G}iuseppe {L}ipari}, title = {{E}nhancement of {Q}o{S} support of {HCCA} schedulers using {EDCA} function in {IEEE} 802.11e networks}, journal = {{A}d {H}oc {N}etworks}, year = {2012}, volume = {10}, pages = {147 - 161}, number = {2}, doi = {10.1016/j.adhoc.2010.09.014}, issn = {1570-8705}, opturl = {http://www.sciencedirect.com/science/article/pii/S157087051000154X} } …
  • 47. Bibliography  Steps to deal with citation 1. Prepare the bibliography file (.bib), perhaps using jabRef 2. Add the following command in the end of the (.tex) document file, where the references section is: Example: 4. Cite the reference in you text using the following command bibliographystyle{bibliography style} bibliography{bibliograpy database file} bibliographystyle{IEEEtran} bibliography{your-bib-database} … cite{ruscelli2012} …
  • 48. Bibliography  List of bibliography styles Style Name Author Name Format Sorting unsrt Homer Jay Simpson as referenced plain Homer Jay Simpson by author named Homer Jay Simpson authordate1 Simpson, Homer Jay apa Simpson, H. J. (1995) alpha Homer Jay Simpson by author acm Simpson, H. J. abstract Homer Jay Simpson abbrv H. J. Simpson by author
  • 49. Bibliography  Multiple citation Several approaches such as cite{Lee2009, Jansang2011, Cecchetti2012, cecchettielAL2012, ruscelli2012} have been presented in the literature attempting to remedy the deficiency of the HCCA reference scheduler in supporting QoS for VBR traffics.
  • 50. Getting things together  applying latex template 1. Get the IEEEtrans template from https://www.ctan.org/ or https://www.ieee.org/conferences_events/conferences/publishin g/templates.html 2. Extract the template file (which includes IEEEtran.cls)into a folder 3. Copy images files 4. Copy reference.bib 5. add your material in the given template’s places 6. Compile 7. Done!
  • 51. References  https://en.wikibooks.org/wiki/LaTeX  LaTeX Tutorial, Je Clark, Revised February 26, 2002  Learning LATEX by Doing, Andr’e Heck, March 2005, AMSTEL Institute  The Not So Short Introduction to LATEX2E, Tobias Oetiker,Hubert Partl, Irene Hyna and Elisabeth Schlegl, Version 5.05, July 18, 2015  Latex Workshop, Mohammed A. Al-maqri, April 2015, UPM.