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 WordIf you need to write a short letter,a cover page, you are best ofwriting in Word. For simpledocuments, yo...
Why LaTeXVery powerful control of document generation,particularly large technical documentsVery easy for formatting, numb...
What is NeededUse MikTex for Microsoft windows platform. MikTex isfree.  http://www.miktex.org/Use TEXnicCentre as your ed...
The LaTeX Process 1.   Create a text file with your favorite text editor (TEXnicCenter      Editor). 2.   “Compile” or “Bu...
My First LaTeX Documentdocumentclass{article}begin{document}I do not like Microsoft word.end{document}                    ...
Add Sectionsdocumentclass{article}begin{document}section{Word} label{sec:word}  I do not like Microsoft word.section{Latex...
Equation Exampledocumentclass{article}begin{document}begin{equation} label{eq:sum}s = sum_{i=1}^{n}x_{i}end{equation}end{d...
Equation Example (2)documentclass{article}begin{document}begin{equation} label{eq:mean}bar{x} = frac{sum_{i=1}^{n}x_{i}} {...
Equation Example (3)documentclass{report}begin{document}begin{equation} label{eq:sd}sigma =  sqrt{frac{sumlimits_{i=1}^{n}...
Document ClassUse different class for your document.documentclass{article}documentclass{book}documentclass{letter}document...
Report Documentdocumentclass{report}title{Learn Latex}author{A. Lotfi}begin{document}maketitletableofcontentsend{document}
Report Document – Include Chaptersdocumentclass{report}title{Learn Latex}author{A. Lotfi}begin{document}maketitletableofco...
Including ImagesNeed to convert your image graphics into JPGand/or EPS.Need to include an extension package toLaTeX called...
Image Graphics Exampledocumentclass{article}usepackage{graphics}                  .jpg or .epsbegin{document}             ...
Comments in LaTeX    To comment a line or a paragraph use:%      Ignores the rest of the line    Any text after end{docume...
Special CharactersUse the  character   e.g.    My_Name.vsd    More than 10%Use `` and ‘’ for quotation marks. This is diff...
Making Referencesdocumentclass{article}begin{document}  Because we are using symbolic references,  e.g., cite{AL} a second...
Problem with this methodUser is burdened with deciding how to format articletitles, journal names, proceeding referencesDi...
Making References - BibTexdocumentclass{article}begin{document}  Because we are using symbolic  references, e.g., cite{AL}...
The BibTex Process1.   Create a BibTex file with Rerefence entries2.   Get a *.bst file (bibliographic style file. IEEE.bs...
Types of Documents BibTex can handleARTICLE             MISCBOOK                PHDTHESISBOOKLET             PROCEEDINGSIN...
Sample BibTex Book Entry@BOOK{Press,author=“A. Lotfi",title="Applications and Science in Soft  Comuting, Series.",publishe...
Create BibTex FileFrom RefWorks, export your references in BibTexformat. This is the easiest way of generating yourBIB fil...
Harvard System Use natbib package for Harvard citation style.documentclass{article}usepackage{natbib}bibpunct{(}{)}{;}{a}{...
ExamplesDownload a copy of this note and all example filesfrom:         http://lotfi.net/latex/Also available:   Writing a...
Upcoming SlideShare
Loading in...5
×

Learn Latex

950

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
950
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
34
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Learn Latex

  1. 1. Learn LaTeX in 30 Minutes A. LOTFI School of Science and Technology Nottingham Trent University
  2. 2. Use the right tool for the job
  3. 3. Latex vs. MS WordIf you need to write a short letter,a cover page, you are best ofwriting in Word. For simpledocuments, you dont need fancylayout. So, you can save time bywriting with a WYSIWYG editor likeWord.If you are writing a longdocument like a PhD thesis, anarticle, or a review, you are betterof with LaTeX.http://openwetware.org/wiki/Word_vs._LaTeX
  4. 4. Why LaTeXVery powerful control of document generation,particularly large technical documentsVery easy for formatting, numbering, and referencingYou can learn all about it in a couple of hours.
  5. 5. What is NeededUse MikTex for Microsoft windows platform. MikTex isfree. http://www.miktex.org/Use TEXnicCentre as your editor. http://www.texniccenter.org/
  6. 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. 7. My First LaTeX Documentdocumentclass{article}begin{document}I do not like Microsoft word.end{document} Ex_1
  8. 8. Add Sectionsdocumentclass{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
  9. 9. Equation Exampledocumentclass{article}begin{document}begin{equation} label{eq:sum}s = sum_{i=1}^{n}x_{i}end{equation}end{document} Ex_3
  10. 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. 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. 12. Document ClassUse different class for your document.documentclass{article}documentclass{book}documentclass{letter}documentclass{report}
  13. 13. Report Documentdocumentclass{report}title{Learn Latex}author{A. Lotfi}begin{document}maketitletableofcontentsend{document}
  14. 14. Report Document – Include Chaptersdocumentclass{report}title{Learn Latex}author{A. Lotfi}begin{document}maketitletableofcontents include{chapter_1} include{chapter_2} include{chapter_3}end{document}
  15. 15. Including ImagesNeed to convert your image graphics into JPGand/or EPS.Need to include an extension package toLaTeX called “graphics” using commandusepackage{graphics}
  16. 16. Image Graphics Exampledocumentclass{article}usepackage{graphics} .jpg or .epsbegin{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. 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. 18. Special CharactersUse the character e.g. My_Name.vsd More than 10%Use `` and ‘’ for quotation marks. This is differentfrom “ “. In Latex ``cat’’ should be used to havedouble quote.
  19. 19. Making Referencesdocumentclass{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. 20. Problem with this methodUser is burdened with deciding how to format articletitles, journal names, proceeding referencesDifficult to reuse references in other documents
  21. 21. Making References - BibTexdocumentclass{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. 22. The BibTex Process1. Create a BibTex file with Rerefence entries2. Get a *.bst file (bibliographic style file. IEEE.bst or Springer.bst) • You can use plain, abbrv, unstr or alpha3. “Compile” or “Build” your LaTeX.4. Only references that you actually cited will appear on the list.
  23. 23. Types of Documents BibTex can handleARTICLE MISCBOOK PHDTHESISBOOKLET PROCEEDINGSINBOOK TECHREPORTINCOLLECTION UNPUBLISHEDINPROCEEDINGSMANUAL
  24. 24. Sample BibTex Book Entry@BOOK{Press,author=“A. Lotfi",title="Applications and Science in Soft Comuting, Series.",publisher=“Springer",year=2004,}
  25. 25. Create BibTex FileFrom RefWorks, export your references in BibTexformat. This is the easiest way of generating yourBIB file.For Harvard system, use Natbib package.
  26. 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 isexplained citep{AL}.bibliographystyle{plainnat}bibliography{mybib}end{document} Ex_9
  27. 27. ExamplesDownload a copy of this note and all example filesfrom: http://lotfi.net/latex/Also available: Writing a Scientific Paper in Latex Writing a PhD Thesis in Latex
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×