SlideShare a Scribd company logo
1 of 27
Download to read offline
Learn LaTeX in 30 Minutes

              A. LOTFI
 School of Science and Technology
   Nottingham Trent University
Use the right tool for the job
Latex vs. MS Word
If you need to write a short letter,
a cover page, you are best of
writing in Word. For simple
documents, you don't need fancy
layout. So, you can save time by
writing with a WYSIWYG editor like
Word.
If you are writing a long
document like a PhD thesis, an
article, or a review, you are better
of with LaTeX.


http://openwetware.org/wiki/Word_vs._LaTeX
Why LaTeX
Very powerful control of document generation,
particularly large technical documents
Very easy for formatting, numbering, and referencing
You can learn all about it in a couple of hours.
What is Needed
Use MikTex for Microsoft windows platform. MikTex is
free.
  http://www.miktex.org/
Use TEXnicCentre as your editor.
  http://www.texniccenter.org/
The LaTeX Process
 1.   Create a text file with your favorite text editor (TEXnicCenter
      Editor).
 2.   “Compile” or “Build” your document using the LaTeX program
 3.   Display resulting Document in either PDF or DVI
 4.   Continue writing and go to 1 until finished.


                          latex           .div file     Yap viewer
      .tex file           bibtex
                                           .pdf file     PDF reader
                          pdflate
.bib file   .jpg & .eps   xhlatex        .html file     IE/Chrome
My First LaTeX Document
documentclass{article}
begin{document}
I do not like Microsoft word.
end{document}




                                Ex_1
Add Sections
documentclass{article}
begin{document}
section{Word} label{sec:word}
  I do not like Microsoft word.

section{Latex}label{sec:tex}
  I like Latex. As meantioned in
  Section ref{sec:word} I do not like
  MS Word.
end{document}


                                         Ex_2
Equation Example
documentclass{article}
begin{document}

begin{equation} label{eq:sum}
s = sum_{i=1}^{n}x_{i}
end{equation}

end{document}




                                  Ex_3
Equation Example (2)
documentclass{article}
begin{document}

begin{equation} label{eq:mean}
bar{x} = frac{sum_{i=1}^{n}x_{i}} {n}
end{equation}

In Equation ref{eq:mean} …
end{document}



                                           Ex_4
Equation Example (3)
documentclass{report}
begin{document}

begin{equation} label{eq:sd}
sigma =
  sqrt{frac{sumlimits_{i=1}^{n}
  left(x_{i} - bar{x}right)^{2}}
  {n-1}}
end{equation}
end{document}


                                      Ex_5
Document Class
Use different class for your document.

documentclass{article}
documentclass{book}
documentclass{letter}
documentclass{report}
Report Document
documentclass{report}
title{Learn Latex}
author{A. Lotfi}

begin{document}
maketitle
tableofcontents

end{document}
Report Document – Include Chapters

documentclass{report}
title{Learn Latex}
author{A. Lotfi}
begin{document}
maketitle
tableofcontents
  include{chapter_1}
  include{chapter_2}
  include{chapter_3}
end{document}
Including Images
Need to convert your image graphics into JPG
and/or EPS.
Need to include an extension package to
LaTeX called “graphics” using command
usepackage{graphics}
Image Graphics Example
documentclass{article}
usepackage{graphics}                  .jpg or .eps
begin{document}                       Do not specify
  begin{figure}
                                       The extension.
  includegraphics{MyCat}
  caption{This is My Cat} label{fig:cat}
  end{figure}
In Figure ref{fig:cat} …
end{document}



                                                Ex_6
Comments in LaTeX
    To comment a line or a paragraph use:
%
      Ignores the rest of the line


    Any text after end{document} also will be discarded.
Special Characters
Use the  character
   e.g.
    My_Name.vsd
    More than 10%
Use `` and ‘’ for quotation marks. This is different
from “ “. In Latex ``cat’’ should be used to have
double quote.
Making References
documentclass{article}
begin{document}
  Because we are using symbolic references,
  e.g., cite{AL} a second pass is necessary.

begin{thebibliography}{99}
bibitem{AL}
A Lotfi, emph{Learn Latex in 30 Minutes}
end{thebibliography}
end{document}




                                                Ex_7
Problem with this method
User is burdened with deciding how to format article
titles, journal names, proceeding references
Difficult to reuse references in other documents
Making References - BibTex

documentclass{article}
begin{document}
  Because we are using symbolic
  references, e.g., cite{AL} a second
  pass is necessary.

bibliographystyle{plain}
bibliography{mybib}
end{document}



                                         Ex_8
The BibTex Process
1.   Create a BibTex file with Rerefence entries
2.   Get a *.bst file (bibliographic style file. IEEE.bst or
     Springer.bst)
       •    You can use plain, abbrv, unstr or alpha
3.   “Compile” or “Build” your LaTeX.
4.   Only references that you actually cited will appear on the list.
Types of Documents BibTex can handle
ARTICLE             MISC
BOOK                PHDTHESIS
BOOKLET             PROCEEDINGS
INBOOK              TECHREPORT
INCOLLECTION        UNPUBLISHED
INPROCEEDINGS
MANUAL
Sample BibTex Book Entry
@BOOK{Press,
author=“A. Lotfi",
title="Applications and Science in Soft
  Comuting, Series.",
publisher=“Springer",
year=2004,
}
Create BibTex File
From RefWorks, export your references in BibTex
format. This is the easiest way of generating your
BIB file.
For Harvard system, use Natbib package.
Harvard System
 Use natbib package for Harvard citation style.
documentclass{article}
usepackage{natbib}
bibpunct{(}{)}{;}{a}{,}{,}

begin{document}
In citet{AL} more details about this item is
explained citep{AL}.

bibliographystyle{plainnat}
bibliography{mybib}
end{document}

                                                  Ex_9
Examples
Download a copy of this note and all example files
from:


         http://lotfi.net/latex/
Also available:
   Writing a Scientific Paper in Latex
   Writing a PhD Thesis in Latex

More Related Content

What's hot (20)

Introduction to LaTeX
Introduction to LaTeXIntroduction to LaTeX
Introduction to 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-Presentation
LaTeX-PresentationLaTeX-Presentation
LaTeX-Presentation
 
Latex workshop: Essentials and Practices
Latex workshop: Essentials and PracticesLatex workshop: Essentials and Practices
Latex workshop: Essentials and Practices
 
LaTeX for beginners
LaTeX for beginnersLaTeX for beginners
LaTeX for beginners
 
Editing documents with LaTeX
Editing documents with LaTeXEditing documents with LaTeX
Editing documents with LaTeX
 
LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners
 
Academic writing in LaTeX
Academic writing in LaTeX Academic writing in LaTeX
Academic writing in LaTeX
 
Inroduction to Latex
Inroduction to LatexInroduction to Latex
Inroduction to Latex
 
LaTex tutorial with Texstudio
LaTex tutorial with TexstudioLaTex tutorial with Texstudio
LaTex tutorial with Texstudio
 
Technical writing using LaTeX
Technical writing using LaTeXTechnical writing using LaTeX
Technical writing using LaTeX
 
Advanced latex
Advanced latexAdvanced latex
Advanced latex
 
Ms access 2007
Ms access 2007Ms access 2007
Ms access 2007
 
Compilers
CompilersCompilers
Compilers
 
Introduction to ms access
Introduction to ms accessIntroduction to ms access
Introduction to ms access
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
 
SQL
SQLSQL
SQL
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
 

Viewers also liked

Research Methodologies - Lecture 02
Research Methodologies - Lecture 02Research Methodologies - Lecture 02
Research Methodologies - Lecture 02Haitham El-Ghareeb
 
Sample chapters [data structure and algorithmic thinking with python]
Sample chapters [data structure and algorithmic thinking with python]Sample chapters [data structure and algorithmic thinking with python]
Sample chapters [data structure and algorithmic thinking with python]CareerMonk Publications
 
Python data structures(University of michigan)
Python data structures(University of michigan)Python data structures(University of michigan)
Python data structures(University of michigan)Abdullah Al Mamun
 
Lecture 9 - DSA - Python Data Structures
Lecture 9 - DSA - Python Data StructuresLecture 9 - DSA - Python Data Structures
Lecture 9 - DSA - Python Data StructuresHaitham El-Ghareeb
 

Viewers also liked (7)

DSA-Lecture-05
DSA-Lecture-05DSA-Lecture-05
DSA-Lecture-05
 
Research Methodologies - Lecture 02
Research Methodologies - Lecture 02Research Methodologies - Lecture 02
Research Methodologies - Lecture 02
 
Sample chapters [data structure and algorithmic thinking with python]
Sample chapters [data structure and algorithmic thinking with python]Sample chapters [data structure and algorithmic thinking with python]
Sample chapters [data structure and algorithmic thinking with python]
 
Lecture-05-DSA
Lecture-05-DSALecture-05-DSA
Lecture-05-DSA
 
Python data structures(University of michigan)
Python data structures(University of michigan)Python data structures(University of michigan)
Python data structures(University of michigan)
 
Lecture 9 - DSA - Python Data Structures
Lecture 9 - DSA - Python Data StructuresLecture 9 - DSA - Python Data Structures
Lecture 9 - DSA - Python Data Structures
 
DSA - Lecture 04
DSA - Lecture 04DSA - Lecture 04
DSA - Lecture 04
 

Similar to Learn Latex

Similar to Learn Latex (20)

Latex Notes
Latex NotesLatex Notes
Latex Notes
 
LaTeX Survival Guide
LaTeX Survival Guide LaTeX Survival Guide
LaTeX Survival Guide
 
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
 
Latex intro s_dutta_v2
Latex intro s_dutta_v2Latex intro s_dutta_v2
Latex intro s_dutta_v2
 
latex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshahlatex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshah
 
latex.pptx
latex.pptxlatex.pptx
latex.pptx
 
Latex workshop
Latex workshopLatex workshop
Latex workshop
 
LATEX.ppt
LATEX.pptLATEX.ppt
LATEX.ppt
 
LaTeX_tutorial_Syed_Jan09.ppt
LaTeX_tutorial_Syed_Jan09.pptLaTeX_tutorial_Syed_Jan09.ppt
LaTeX_tutorial_Syed_Jan09.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 Tuitorial
Latex TuitorialLatex Tuitorial
Latex Tuitorial
 
Introduction to LaTeX
Introduction to LaTeXIntroduction to LaTeX
Introduction to LaTeX
 
Chap03 scr
Chap03 scrChap03 scr
Chap03 scr
 
latex cource.pptx
latex cource.pptxlatex cource.pptx
latex cource.pptx
 
La tex basics
La tex basicsLa tex basics
La tex basics
 
Latex Tutorial
Latex TutorialLatex Tutorial
Latex Tutorial
 
A Hitchhiker S Guide To LaTex (Or How I Learned To Stop Worrying And Love Wri...
A Hitchhiker S Guide To LaTex (Or How I Learned To Stop Worrying And Love Wri...A Hitchhiker S Guide To LaTex (Or How I Learned To Stop Worrying And Love Wri...
A Hitchhiker S Guide To LaTex (Or How I Learned To Stop Worrying And Love Wri...
 
LaTeX로 문서 작성하자
LaTeX로 문서 작성하자LaTeX로 문서 작성하자
LaTeX로 문서 작성하자
 
documents writing with LATEX
documents writing with LATEXdocuments writing with LATEX
documents writing with LATEX
 
Latex ppt copy
Latex ppt   copyLatex ppt   copy
Latex ppt copy
 

More from Haitham El-Ghareeb (20)

مختصر وحدة التعلم الذاتي 2015
مختصر وحدة التعلم الذاتي 2015مختصر وحدة التعلم الذاتي 2015
مختصر وحدة التعلم الذاتي 2015
 
وحدة التعلم الذاتي 2015
وحدة التعلم الذاتي 2015وحدة التعلم الذاتي 2015
وحدة التعلم الذاتي 2015
 
NoSQL Databases, Not just a Buzzword
NoSQL Databases, Not just a Buzzword NoSQL Databases, Not just a Buzzword
NoSQL Databases, Not just a Buzzword
 
EMC Academic Alliance Presentation
EMC Academic Alliance PresentationEMC Academic Alliance Presentation
EMC Academic Alliance Presentation
 
DSA - 2012 - Conclusion
DSA - 2012 - ConclusionDSA - 2012 - Conclusion
DSA - 2012 - Conclusion
 
Data Structures - Lecture 8 - Study Notes
Data Structures - Lecture 8 - Study NotesData Structures - Lecture 8 - Study Notes
Data Structures - Lecture 8 - Study Notes
 
Lect07
Lect07Lect07
Lect07
 
Lecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic SortingLecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic Sorting
 
LectureNotes-06-DSA
LectureNotes-06-DSALectureNotes-06-DSA
LectureNotes-06-DSA
 
LectureNotes-05-DSA
LectureNotes-05-DSALectureNotes-05-DSA
LectureNotes-05-DSA
 
LectureNotes-04-DSA
LectureNotes-04-DSALectureNotes-04-DSA
LectureNotes-04-DSA
 
LectureNotes-03-DSA
LectureNotes-03-DSALectureNotes-03-DSA
LectureNotes-03-DSA
 
LectureNotes-02-DSA
LectureNotes-02-DSALectureNotes-02-DSA
LectureNotes-02-DSA
 
LectureNotes-01-DSA
LectureNotes-01-DSALectureNotes-01-DSA
LectureNotes-01-DSA
 
DSA - Lecture 03
DSA - Lecture 03DSA - Lecture 03
DSA - Lecture 03
 
Ph.D. Registeration seminar
Ph.D. Registeration seminarPh.D. Registeration seminar
Ph.D. Registeration seminar
 
Lecture 01 - Research Methods
Lecture 01 - Research MethodsLecture 01 - Research Methods
Lecture 01 - Research Methods
 
Lecture 02 - DSA
Lecture 02 - DSALecture 02 - DSA
Lecture 02 - DSA
 
DSA-2012-Lect00
DSA-2012-Lect00DSA-2012-Lect00
DSA-2012-Lect00
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
 

Recently uploaded

Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 

Recently uploaded (20)

Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 

Learn Latex

  • 1. Learn LaTeX in 30 Minutes A. LOTFI School of Science and Technology Nottingham Trent University
  • 2. Use the right tool for the job
  • 3. Latex vs. MS Word If you need to write a short letter, a cover page, you are best of writing in Word. For simple documents, you don't need fancy layout. So, you can save time by writing with a WYSIWYG editor like Word. If you are writing a long document like a PhD thesis, an article, or a review, you are better of with LaTeX. http://openwetware.org/wiki/Word_vs._LaTeX
  • 4. Why LaTeX Very powerful control of document generation, particularly large technical documents Very easy for formatting, numbering, and referencing You can learn all about it in a couple of hours.
  • 5. What is Needed Use MikTex for Microsoft windows platform. MikTex is free. http://www.miktex.org/ Use TEXnicCentre as your editor. http://www.texniccenter.org/
  • 6. The LaTeX Process 1. Create a text file with your favorite text editor (TEXnicCenter Editor). 2. “Compile” or “Build” your document using the LaTeX program 3. Display resulting Document in either PDF or DVI 4. Continue writing and go to 1 until finished. latex .div file Yap viewer .tex file bibtex .pdf file PDF reader pdflate .bib file .jpg & .eps xhlatex .html file IE/Chrome
  • 7. My First LaTeX Document documentclass{article} begin{document} I do not like Microsoft word. end{document} Ex_1
  • 8. Add Sections documentclass{article} begin{document} section{Word} label{sec:word} I do not like Microsoft word. section{Latex}label{sec:tex} I like Latex. As meantioned in Section ref{sec:word} I do not like MS Word. end{document} Ex_2
  • 10. Equation Example (2) documentclass{article} begin{document} begin{equation} label{eq:mean} bar{x} = frac{sum_{i=1}^{n}x_{i}} {n} end{equation} In Equation ref{eq:mean} … end{document} Ex_4
  • 11. Equation Example (3) documentclass{report} begin{document} begin{equation} label{eq:sd} sigma = sqrt{frac{sumlimits_{i=1}^{n} left(x_{i} - bar{x}right)^{2}} {n-1}} end{equation} end{document} Ex_5
  • 12. Document Class Use different class for your document. documentclass{article} documentclass{book} documentclass{letter} documentclass{report}
  • 13. Report Document documentclass{report} title{Learn Latex} author{A. Lotfi} begin{document} maketitle tableofcontents end{document}
  • 14. Report Document – Include Chapters documentclass{report} title{Learn Latex} author{A. Lotfi} begin{document} maketitle tableofcontents include{chapter_1} include{chapter_2} include{chapter_3} end{document}
  • 15. Including Images Need to convert your image graphics into JPG and/or EPS. Need to include an extension package to LaTeX called “graphics” using command usepackage{graphics}
  • 16. Image Graphics Example documentclass{article} usepackage{graphics} .jpg or .eps begin{document} Do not specify begin{figure} The extension. includegraphics{MyCat} caption{This is My Cat} label{fig:cat} end{figure} In Figure ref{fig:cat} … end{document} Ex_6
  • 17. Comments in LaTeX To comment a line or a paragraph use: % Ignores the rest of the line Any text after end{document} also will be discarded.
  • 18. Special Characters Use the character e.g. My_Name.vsd More than 10% Use `` and ‘’ for quotation marks. This is different from “ “. In Latex ``cat’’ should be used to have double quote.
  • 19. Making References documentclass{article} begin{document} Because we are using symbolic references, e.g., cite{AL} a second pass is necessary. begin{thebibliography}{99} bibitem{AL} A Lotfi, emph{Learn Latex in 30 Minutes} end{thebibliography} end{document} Ex_7
  • 20. Problem with this method User is burdened with deciding how to format article titles, journal names, proceeding references Difficult to reuse references in other documents
  • 21. Making References - BibTex documentclass{article} begin{document} Because we are using symbolic references, e.g., cite{AL} a second pass is necessary. bibliographystyle{plain} bibliography{mybib} end{document} Ex_8
  • 22. The BibTex Process 1. Create a BibTex file with Rerefence entries 2. Get a *.bst file (bibliographic style file. IEEE.bst or Springer.bst) • You can use plain, abbrv, unstr or alpha 3. “Compile” or “Build” your LaTeX. 4. Only references that you actually cited will appear on the list.
  • 23. Types of Documents BibTex can handle ARTICLE MISC BOOK PHDTHESIS BOOKLET PROCEEDINGS INBOOK TECHREPORT INCOLLECTION UNPUBLISHED INPROCEEDINGS MANUAL
  • 24. Sample BibTex Book Entry @BOOK{Press, author=“A. Lotfi", title="Applications and Science in Soft Comuting, Series.", publisher=“Springer", year=2004, }
  • 25. Create BibTex File From RefWorks, export your references in BibTex format. This is the easiest way of generating your BIB file. For Harvard system, use Natbib package.
  • 26. Harvard System Use natbib package for Harvard citation style. documentclass{article} usepackage{natbib} bibpunct{(}{)}{;}{a}{,}{,} begin{document} In citet{AL} more details about this item is explained citep{AL}. bibliographystyle{plainnat} bibliography{mybib} end{document} Ex_9
  • 27. Examples Download a copy of this note and all example files from: http://lotfi.net/latex/ Also available: Writing a Scientific Paper in Latex Writing a PhD Thesis in Latex