Sie sind auf Seite 1von 24

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

Lecture 2
LATEX- Documentation with article
Chintan Kr Mandal

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

Exercise

Similar to HTML, LaTeX is a language for describing pages


This means that a latex document writer does not see the
layout of the document during editing, i.e. no WYSIWIG
(What You See Is What You Get) like it is provided by
Word or StarOffice.
The LaTeX environments
MikTex in Microsoft Windows
TeX Live in Unix / Ubuntu / Fedora / . . . for cross platform
TeX development
MacTex in Mac

The editors
Texmaker, TeXworks
Vim
Kile (available only for Ubuntu / Fedora / . . . open source o/s)
WinEdt (available only for Microsoft Windows )

The Beginning

Document Types

Front Matter

Some Latex Commands

Starting the document

Inside Article

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

Exercise

Steps . . .
Open the editor and write the following.
\documentclass{article}
\begin{document}
My first LaTeX document!
\end{document}
Save it as example.tex
By typing latex example.tex into your shell, one gets
example.dvi
The latex compiler (latex) generates .dvi (device independent)
files from the tex sources. .dvi files can be viewed by a dvi
viewer (e.g Yap which come with the mikTeX environment)

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

The flowchart !!

Figure: Flowchart of converting a .tex file to .pdf

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Components of the TeX system

Figure: Components of TeX System

Inside Article

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Document Types

Inside Article

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

\documentclass[options]{class}

Different class-es
article

book
report
slides
beamer

Papers in general with no extra title page (scientific papers, seminar work, reports, descriptions,
etc.)
For books
For
reports
divisions:
chapter,section,subsections,subsubsection,paragraph
For slides and presentations

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

\documentclass[options]{class}

Different option-s
10pt / 11pt / 12pt
letterpaper / a4paper
/ portrait (default) /
landscape / letterpaper
/ oneside (default) /
twoside
onecolumn (default) /
twocolumn

font size
paper format

Number of columns in
the article

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

Front Matter of the Document

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

Front Matter

Front Matter (title) defined in preamble


\title{Title of Document}
\author{Author Name1 \and Author Name2 }
\author{Author Name1 \thanks{Text in footnote}}
\date{Date} Option: \today

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

Abstract and Table of Contents

Some classes such as article and report define an


abstract environment
\begin{abstract}
This is the body of the abstract.
\end{abstract}
Table of contents : - \tableofcontents
List of figures, tables, etc : - \listoffigures,
\listoftables, . . .

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

Some Latex Commands and


Defining the parts of an article

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

LaTeX Commands

Non letter characters & , $ , % , , , { , } , , # ; Can be


printed by using a \{Single Special Character}
\COMMAND[Optional Arguments]{Mandatory Arguments
} e.g
\textit{Hello Everybody !!}
gives
Hello Everybody !!

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

The article / document sectioning I


Chapter Name (applicable for book or thesis) : \chapter[Short Chapter Name (opt)]{Long Chapter Name
(mand.)}
Section of a document : - \section[Short Section Name
(opt)]{Long Section Name}
Sub-section of a section of a document : \subsection[Short Sub-section Name (opt)]{Long
Sub-section Name}
Sub-subsection of a section of a document : \subsubsection[Short Sub-secsection Name (opt)]{Long
Sub-subsection Name}
Chapter Name without chapter number : - \chapter*[Short
Chapter Name (opt)]{Long Chapter Name (mand.)}

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

The article / document sectioning II

Section of a document without section number : \section*[Short Section Name (opt)]{Long Section Name}
Sub-section of a section of a document without subsection
number : - \subsection*[Short Sub-section Name
(opt)]{Long Sub-section Name}
Sub-subsection of a section of a document without
sub-subsection number : - \subsubsection*[Short
Sub-secsection Name (opt)]{Long Sub-subsection Name}

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside the article

Inside Article

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

Environments

An environment groups segments of code


The body of an environment is treated differently from the
outside
General syntax
\begin{environment}
body of environment
\end{environment}

Changes insides an environment are usually local

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

Exercise

Grouping
Text can be grouped using {Some text}
Changes inside group are local
To emphasize text in a sentence
This is {\bf important} !!
This is important !!
Effect of command (or declaration) \bf ends with end of group

An argument to a command is similar to a group, but the


command is outside, e.g.
This is \textbf{important} text
Yields the same result, but the different command \bf takes
the text as argument

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

Characters, Words, Paragraphs

LATEXregards groups of characters separated by spaces (even


multiple spaces) or newlines as words.
Sentences end with . ? !.
LATEXinserts extra space after these symbols.
New lines can be forced with \\.
A blank line (or multiple blank lines together) tells LATEXto
begin a new paragraph (or use command \par)
% indicates a comment and everything until the end of line is
ignored (incl. newline character)

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Exercise

Inside Article

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Inside Article

Exercise

Exercise
Create an article of your favourite topic by the name fav.tex
with your editor .
Remember, that as we move along in our discussion, we are
going to add new data to your article.
The article should have a heading, the authors name with his
affiliation.
The article should have at least a section and a subsection.
Pssstttt . . . . . . U can copy the data from the internet pages if
you want BUT dont tell anyone you copied from the internet
!!!!!

Time : 10 mins

The Beginning

Document Types

Front Matter

Some Latex Commands

Questions !!

Inside Article

Exercise

The Beginning

Document Types

Front Matter

Some Latex Commands

Thank you !!

Inside Article

Exercise

Das könnte Ihnen auch gefallen