Download
latex n.
Skip this Video
Loading SlideShow in 5 Seconds..
LATEX PowerPoint Presentation

LATEX

148 Vues Download Presentation
Télécharger la présentation

LATEX

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. LATEX Fergus Toolan Intelligent Information Retrieval Group University College Dublin

  2. What is Latex? • Latex appeared in 1982 as an extension to TeX. • TeX was created in 1978 by Donald Knuth (The Art of Computer Programming) • It is a typesetting language. • Especially good for Mathematical documents.

  3. Components • Latex file: This is where you write your Latex commands and the document text. Use a .tex extension. • DVI file: The file generated when the .tex file is compiled. (DeVice independent) • EPS: Encapsulated Postscript used for graphics. • PDF: Portable Document Format.

  4. Latex Commands • \command_name{parameter list} • Some include • \textbf{Hello World} • \emph{Hello World} • \cite{toolan2003} • \\ • \title{Latex Guide}

  5. Beginning a document \documentclass[times,10pt,twocolumn]{article} • This gives us a document using Times new Roman in 10pt font. • The document contains two columns • It is of class article – others include book, report (used for a thesis – or final year report)

  6. Packages • Like programming languages Latex imports alot of extra functionality. • To do this: \usepackage{package_name} • The only one you are likely to need is graphicx • \usepackage{graphicx}

  7. Beginning the document • Now we are ready to begin the document properly. • \begin{document} • Like blocks of code in programming a begin directive must be followed by an end directive. • At the end so put \end{document}

  8. The Title \title{Essay Title} \author{Fergus Toolan \\ Student No: 12345678 \\ Login ID: s00bfxxx \\ Email: fergus.toolan@ucd.ie } \maketitle

  9. Comments in Latex • Like all programming languages sometimes comments are essential. • The % is the comment character • Anything appearing after % is ignored by Latex. • %----------------------- often used to divide sections for human readers.

  10. % in Latex • % is the comment character but what happens if we wish to print a % sign. • It must be escaped. • To escape a character in latex use \ (like Java) • So to print a % the latex command is \%

  11. The Abstract • the abstract is standard in all scientific papers and reports. It is a brief (< 100 words) synopsis of the paper. • To write an abstract: \begin{abstract} text goes here \end{abstract}

  12. Sections • Sections provide some form of organisation for a report. • \section{Introduction} • Subsections • \subsection{Name of Subsection}

  13. Formatting • Paragraphs. • Hitting the return key twice will begin a new paragraph EG: This is paragraph 1. This is paragraph 2.

  14. Formatting • Newlines • \\ gives a new line. However this must occur on a line with some text on it. Correct: We need a new line \\ Incorrect: We need a new line \\

  15. Formatting • Fonts: • \emph{text} emphasis i.e. italics • \textbf{text} Bold Face. • It is considered very bad practice to use underlines in Latex documents. • This is a throwback to old manually typesetting.

  16. Figures • When a figure – image, equation, algorithm etc appears it has a caption and a number. • \begin{figure} %Equation algorithm image etc.... \caption{\label{eg_fig}This is the eg figure} \end{figure}

  17. Figures The previous example will appear as... Picture or equation appears here. Figure 1: This is the eg figure.

  18. Figures • To refer to a figure in text use: As can be seen in Figure \ref{eg_fig} the values.... Hence Latex worries about the number not the person writing the document.

  19. Graphics • \includegraphics{filename.eps} • Normally inside a figure. • Encapsulated Postscript format • convert orig_file new_file • Or can be created in PSP or Fireworks.

  20. References • All scientific documents must contain references. \begin{thebibliography}[99] \bibitem{toolan2004} Toolan, F. ``A guide to Latex’’, 2004. \end{thebibliography}

  21. References • To then refer to the reference we use the following. In the guide to latex \cite{toolan2004} Toolan stated that.... It is essential to reference correctly.

  22. Compiling • To generate a PDF file use the following commands • latex file.tex • latex file.tex (must do this twice) • xdvi file.dvi (will view the dvi file.) • dvipdf file.dvi (will create the PDF file) • xpdf file.pdf (to view the PDF file)