You are on page 1of 19

Outline

LaTeX Tutorial

Raphael Bahati1

1 Ph.D. Candidate

Department of Computer Science


The University of Western Ontario
Middlesex College
London, ON N6A 5B7

DiGS, 2009

Bahati LaTeX Tutorial


Outline

Outline

1 Introduction
Eclipse LaTeX Plugins
CVS and Eclipse

2 LaTeX Document
Document Layout
Document Formatting

3 Resources

Bahati LaTeX Tutorial


Introduction
Eclipse LaTeX Plugins
LaTeX Document
CVS and Eclipse
Resources

TeXlipse: http://texlipse.sourceforge.net/

Bahati LaTeX Tutorial


Introduction
Eclipse LaTeX Plugins
LaTeX Document
CVS and Eclipse
Resources

Configuration Management with CVS

Setup
1 Set CVSROOT environment variable

CVSROOT=/csd/thesis/rbahati/DiGS
export CVSROOT
2 Create repository
cvs init
3 Initialize the project
cvs import -m "LaTeX" LaTeX-2009 rbahati start

Bahati LaTeX Tutorial


Introduction
Eclipse LaTeX Plugins
LaTeX Document
CVS and Eclipse
Resources

Configuration Management with CVS

Setup
1 Set CVSROOT environment variable

CVSROOT=/csd/thesis/rbahati/DiGS
export CVSROOT
2 Create repository
cvs init
3 Initialize the project
cvs import -m "LaTeX" LaTeX-2009 rbahati start

Bahati LaTeX Tutorial


Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Small Document

 
\ documentclass [ j o u r n a l ] { IEEEtran }
\ usepackage { a l g o r i t h m }
\ usepackage { a l g o r i t h m i c }
\ usepackage { l i s t i n g s }
\ usepackage { e p s f i g }

\ begin { document }
\ t i t l e {Document T i t t l e }
\ author {Document Author }
\ maketitle

\ section { F i r s t S e c t i o n }
\ subsection { First Subsection }
\ subsubsection { First Subsubsection }
\ s u b s u b s e c t i o n { Second S u b s u b s e c t i o n }

\ s e c t i o n { Second S e c t i o n }
\ s u b s e c t i o n { Second F i r s t S u b s e c t i o n }
\ s u b s e c t i o n { Second Second S u b s e c t i o n }

\ b i b l i o g r a p h y s t y l e { IEEEtran }
\ bibliography { bib− f i l e }
\end{ document }




Bahati LaTeX Tutorial


Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Large Document
 
\ documentclass [ 1 1 pt , l e q n o ] { r e p o r t }
\ usepackage {amsmath , amssymb , a m s f o n t s }
\ usepackage { l i s t i n g s }
\ usepackage { e p s f i g }

\ begin { document }
\ t i t l e {Document T i t t l e }
\ author {Document Author }
\ maketitle

\ pagestyle { p l a i n }
\ addcontentsline { t o c }{ c h a p t e r }{ C o n t e n t s }
\pagenumbering{roman}
\tableofcontents

\ include { ch−i n t r o d u c t i o n }
\ include { ch−m o d e l l i n g −RL}

\ b i b l i o g r a p h y s t y l e { IEEEtran }
\ bibliography { r a p h a e l −PhDDISSERTATION}
\ appendix
\ include { a p p e n d i x− p o l i c i e s }
\ include { a p p e n d i x−c y c l e }
\end{ document }




Bahati LaTeX Tutorial


Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Chapter: ch-modelling-RL
 
\ chapter { Modelling Reinforcement Learning }
\ l a b e l { ch : m o d e l l i n g −RL}

\ s e c t i o n { S t a t e −T r a n s i t i o n Model }
\ l a b e l { s e c : s t a t e −t r a n s i t i o n −model }
\ s u b s e c t i o n { System S t a t e s }
\ l a b e l { s e c : system−s t a t e s }
\ s u b s e c t i o n { System T r a n s i t i o n s }
\ l a b e l { s e c : system−t r a n s i t i o n s }
\ s e c t i o n {Reward F u n c t i o n }
\ l a b e l { s e c : reward−f u n c t i o n }

\ section { Exploration / E x p l o i t a t i o n }
\ l a b e l { s e c : e x p l o r a t i o n −e x p l o i t a t i o n }
\ subsection { Exploration Strategy }
\ l a b e l { s e c : e x p l o r a t i o n −s t r a t e g y }
\ subsection { Exploitation Strategy }
\ l a b e l { s e c : e x p l o i t a t i o n −s t r a t e g y }

\ s e c t i o n { L e a r n i n g by R e i n f o r c e m e n t }
\ l a b e l { s e c : l e a r n i n g −by−r e i n f o r c e m e n t }

\ section { D i s c u s s i o n }
\ l a b e l { s e c : m o d e l l i n g −RL−d i s c u s s i o n }




Bahati LaTeX Tutorial


Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Document Classes and Packages

documentstyle[options]{class}
1 {article}: 11pt, 12pt, twoside, twocolumn, draft, fleqn, leqno, acm
2 {report}: 11pt, 12pt, twoside, twocolumn, draft, fleqn, leqno, acm
3 {letter}: 11pt, 12pt, fleqn, leqno, acm
4 {book}: 11pt, 12pt, twoside, twocolumn, draft, fleqn, leqno

usepackage{package}
{amsmath,amssymb,amsfonts}: Mathematics
{epsfig}: Figures (.jpeg, .png)
{subfigure}: SubFigures
{listings}: Codes
{algorithm, algorithmic}: Algorithms
{multirow}: Table formatting

Bahati LaTeX Tutorial


Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Bibliography
@INPROCEEDINGS; @TECHREPORT; @ELECTRONIC; @INBOOK;
@PHDTHESIS; @MASTERSTHESIS;

 
@INPROCEEDINGS{REF5 0 2 ,
TITLE=”{ R e i n f o r c e m e n t L e a r n i n g i n P o l i c y −d r i v e n Autonomic
Management } ” ,
YEAR=”2008” ,
PAGES=”899−−902”,
MONTH=” A p r i l ” ,
BOOKTITLE=”Network O p e r a t i o n s \& Management Symposium
(NOMS’ 0 8 ) ” ,
ADDRESS=”S a l v a d o r , Bahia , B r a z i l ” ,
FILE=” r a p h a e l −NOMS2 0 0 8 . p d f ” ,
AUTHOR=”Raphael M. B a h a t i and M i c h a e l A . Bauer ”
}




Reference
1 R. M. Bahati and M. A. Bauer, “Reinforcement Learning in Policy-driven
Autonomic Management,” in Network Operations & Management
Symposium (NOMS’08), Salvador, Bahia, Brazil, April 2008, pp. 899–902.

Bahati LaTeX Tutorial


Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Figures: usepackage{epsfig, subfigure}


 
\ begin { f i g u r e } [ htb ]
\ begin { c e n t e r }
\ s u b f i g u r e [ O r i g i n a l model ] { \ l a b e l { f i g : c h a n g e 7}
\ e p s f i g { f i l e =f i g u r e s / c h a n g e 7 , h e i g h t =1.3 i n , w i d t h =1.9 i n }}
\ e p s f i g { f i l e =f i g u r e s / a r r o w 3 , h e i g h t =1.3 i n , w i d t h =0.2 i n }
\ s u b f i g u r e [ New model ] { \ l a b e l { f i g : m o d i f i c a t i o n 7}
\ e p s f i g { f i l e =f i g u r e s / m o d i f i c a t i o n 7 , h e i g h t =1.3 i n , w i d t h =1.9 i n }}
\ caption { Sample T a b l e . }
\end{ c e n t e r }
\end{ f i g u r e }




(a) Original model (b) New model

Figure: Sample Figure.


Bahati LaTeX Tutorial
Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Tables: usepackage{multirow}

 
\ b e g i n { t a b l e } [ htb ]
\ begin { center }
\ begin { small }
\ begin { tabular }{| c | c | c | c | p{2.2 in }|}
\hline
S t a t e &$R {m { j }}ˆ{ k}$&$ f (R {m { j }}ˆ{ k })$&\ m u l t i c o l u m n {2}{ c | }
{$A( s { i } ) $ } \ \
\hline
$ s { i }$&$R {m { 1 } } ˆ { k}$&$ f (R {m { 1 } } ˆ { k })$&$ a { l }$& S t a t e a c t i o n \\
\hline
\ m u l t i r o w {4}{∗}{$ s {1}$}&\ m u l t i r o w {4}{∗}{$R {m {1}}ˆ{3}$}&
\ m u l t i r o w {4}{∗}{0}&$ a {0}$&\ t e x t t t {$\gamma$− a c t i o n }\\
\ c l i n e {4−5} & & &$a {1}$& \ t e x t t t { A d j u s t M a x C l i e n t s (+25)}\\
\ c l i n e {4−5} & & &$a {2}$& \ t e x t t t { AdjustMaxKARequests ( −30)}\\
\ c l i n e {4−5} & & &$a {3}$& \ t e x t t t { AdjustMaxBandwidth ( −128)}\\
\hline
\end{ t a b u l a r }
\end{ s m a l l }
\end{ c e n t e r }
\ c a p t i o n { Sample T a b l e . }
\ l a b e l { t a b : system−s t a t e s }
\end{ t a b l e }




Bahati LaTeX Tutorial


Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Tables

k k
State Rm j
f (Rm j
) A(si )
k k
si Rm 1
f (Rm 1
) al State action
a0 γ-action
3 a1 AdjustMaxClients(+25)
s1 Rm 0
1
a2 AdjustMaxKARequests(-30)
a3 AdjustMaxBandwidth(-128)
Table: Sample Table.

Bahati LaTeX Tutorial


Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Equations

 
\ begin { e q u a t i o n }
Q { 0 } ( s , a)=\ f r a c {\sum\ l i m i t s { p { j }\ i n [ P { v } ] { a }}
tanh [ S ( p { j } ) ] \ times W { a } ( p { j } ) } { \ | [ P { v } ] { a } \ | }
\ l a b e l { equ : a c t i o n −s t r e n g t h }
\end{ e q u a t i o n }




Eguation
P
tanh[S(pj )] × Wa (pj )
pj ∈[Pv ]a
Q0 (s, a) = (1)
k [Pv ]a k

Bahati LaTeX Tutorial


Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Equations

 
\ begin { a l i g n }
S ( p { 1 } ) &= \sum\ l i m i t s { c { i }\ i n p { 1 } } c { i } . \ omega
\ times V( c { i } ) \\
&= \{\ f r a c {1}{6} \ times 0 . 0 5 8 8 \ } + \{\ f r a c {1}{6}
\ times 1 . 0 0 0 0 \ } \\
&= 0 . 0 0 9 8 + 0 . 1 6 6 7 \\
&= 0 . 1 7 6 5
\end{ a l i g n }




Equation

X
S(p1 ) = ci .ω × V (ci ) (2)
ci ∈p1
1 1
={ × 0.0588} + { × 1.0000} (3)
6 6
= 0.0098 + 0.1667 (4)
= 0.1765 (5)

Bahati LaTeX Tutorial


Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Listings: usepackage{listings}
 
\ b e g i n { f i g u r e } [ htb ]
\ begin { center }
\ l s t s e t { l a n g u a g e=C++, numbers=l e f t , b a s i c s t y l e =\ t i n y }
\ l s t i n p u t l i s t i n g { l i s t i n g s / l i s t i n g . cpp }
\ l a b e l { l i s : l i s t i n g −cpp }
\ end { c e n t e r }
\ end { f i g u r e }



1 s t a t u s t A c t i o n T e s t L i s t : : g e t V a l i d A c t i o n T e s t ( A c t i o n T e s t I n f o ∗∗ e n t r y )
2 {
3 register int count ;
4 i f ( l o c k ( ) == NOTOK)
5 return NOTOK;
6 f o r ( c o u n t = 0 ; c o u n t < numItems ; c o u n t++)
7 {
8 i f ( a c t i o n L i s t [ c o u n t ] . t y p e != INVALID TEST )
9 {
10 ∗ e n t r y = &a c t i o n L i s t [ c o u n t ] ;
11 break ;
12 }
13 }
14 i f ( u n l o c k ( ) == NOTOK)
15 return NOTOK;
16 return OK;
17 }

Bahati LaTeX Tutorial


Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

Algorithms: usepackage{algorithm, algorithmic}


 
\ begin { a l g o r i t h m }
\ caption {\ t e x t t t { C r e a t e S t a t e } ( $E {m} ’ , A { v } $ ) }
\ l a b e l { p r o : c r e a t e −s t a t e }
\ begin { a l g o r i t h m i c } [ 1 ]
\REQUIRE $ r {m { i }}\ i n M {R}ˆ{P}$
\ENSURE $ s=\l a n g l e \mu, M( s ) , A( s ) \ rangle $
\FOR { e a c h $ e \ i n E {m} ’ $ }
\FOR { e a c h $ r {m { i }} \ i n M {R}ˆ{P}$}
\ IF { ( $ \ alpha {m { i } } . \ t e x t t t { m e t r i c } = e . \ t e x t t t { m e t r i c } $ ) }
\STATE $ s .m { i } . \ t e x t t t {ID}\ l e f t a r r o w \ alpha {m { i } } . \ t e x t t t {ID }$
\STATE $ s .m { i } . \ omega \ l e f t a r r o w \ alpha {m { i } } . \ omega$
\STATE $ s .m { i } . \ t e x t t t { v a l u e } \ l e f t a r r o w e . \ t e x t t t { v a l u e }$
\STATE $ s .m { i } . f (R {m { i }}ˆ{ l } ) \ l e f t a r r o w $
\ t e x t t t { R e g i o n } ( $ e . \ t e x t t t { v a l u e } , \ sigma {m { i } } $ )
\STATE $M( s ) \ l e f t a r r o w M( s ) ˜ \ cup˜ s .m { i }$
\STATE b r e a k ;
\ENDIF \ l a b e l { l i n e −C : c r e a t e −s t a t e }
\ENDFOR
\ENDFOR
\STATE $M( s ) \ l e f t a r r o w $\ t e x t t t { S o r t } ( $M( s ) , s .m { i } . \ t e x t t t {ID } $ )
\STATE $ a { 0 } \ l e f t a r r o w $\ t e x t t t {$\gamma$− a c t i o n }
\STATE $A( s ) \ l e f t a r r o w A( s ) ˜ \ cup˜ a { 0 } $
\FOR { e a c h $ a { i } \ i n A { v }$}
\STATE $A( s ) \ l e f t a r r o w A( s ) ˜ \ cup˜ a { i }$
\ENDFOR
\RETURN $ s $
\end{ a l g o r i t h m i c }
\end{ a l g o r i t h m }



Bahati LaTeX Tutorial
Introduction
Document Layout
LaTeX Document
Document Formatting
Resources

0 ,A )
Algorithm 1 CreateState(Em v
Input: rmi ∈ MR P

Output: s = hµ, M (s), A(s)i


1: for each e ∈ Em 0 do

2: for each rmi ∈ MR P do

3: if (αmi .metric = e.metric) then


4: s.mi .ID ← αmi .ID
5: s.mi .ω ← αmi .ω
6: s.mi .value ← e.value
7: l ) ← ComputeRegionValue(e.value, σ
s.mi .f (Rm i mi )
8: M (s) ← M (s) ∪ s.mi
9: break;
10: end if
11: end for
12: end for
13: M (s) ←Sort(M (s), s.mi .ID)
14: a0 ←γ-action
15: A(s) ← A(s) ∪ a0
16: for each ai ∈ Av do
17: A(s) ← A(s) ∪ ai
18: end for
19: return s

Bahati LaTeX Tutorial


Introduction
LaTeX Document
Resources

Resources

1 CVS: http://www.csd.uwo.ca/˜rbahati/courses/CS212b/resources.html
2 LaTeX: http://frodo.elon.edu/tutorial/tutorial/node1.html
3 TeXlipse: http://texlipse.sourceforge.net/
4 Beamer: http://latex-beamer.sourceforge.net/

Bahati LaTeX Tutorial

You might also like