how to get started in l a t ex
play

How to get started in L A T EX Document Structure Formatting and - PowerPoint PPT Presentation

Introduction Some very basics How to get started in L A T EX Document Structure Formatting and Page Layout Florence Bouvet Tables Department of Economics Importing Images and Sonoma State University creating Figures Mathematics


  1. Introduction Some very basics How to get started in L A T EX Document Structure Formatting and Page Layout Florence Bouvet Tables Department of Economics Importing Images and Sonoma State University creating Figures Mathematics Presentation March 26, 2009 with Beamer Some References 1 / 29

  2. Introduction Introduction Some very basics Document Structure Formatting and Page L A T EX is a document preparation system for high-quality Layout typesetting. Tables Importing L A T EX is not a word processor! Instead, L A T EX encourages Images and authors not to worry too much about the appearance of their creating Figures documents, but to concentrate on getting the right content. Mathematics Presentation with Beamer Some References 2 / 29

  3. Advantages Introduction Some very basics Document On the other hand, there are certain advantages to the markup Structure language approach: Formatting and Page ❼ The document looks professional. The layout, fonts, Layout Tables tables, etc. is consistent throughout. Importing ❼ Mathematical formulae can be easily typeset. Images and creating ❼ Indexes, footnotes, references, etc., are generated easily. Figures Mathematics ❼ It encourages correctly structured documents. Presentation with Beamer ❼ It is available (and transportable) across many platforms Some (Windows, Mac, Unix and Linux are all supported). References 3 / 29

  4. Disadvantages Introduction Some very basics Document Structure ❼ One can’t see the final result straight away. PDF is the Formatting and Page final result. Layout Tables ❼ One needs to know the necessary commands for LaTeX Importing markup. Images and creating ❼ It can sometimes be difficult to obtain a certain ’look’. Figures Mathematics ❼ It might be less convenient to add comments to one’s Presentation coauthors. with Beamer Some References 4 / 29

  5. Some very Basics Introduction Some very basics Document Structure Formatting What you need to get started: and Page Layout ❼ MikTex (http://www.miktex.org/): it’s free! Tables Importing ❼ an Editor, such as WinEdt. (http://www.winedt.com/): Images and creating ✩ 40 for an individual educational license. Figures ❼ an example of a TeX file to follow. Mathematics Presentation with Beamer Some References 5 / 29

  6. Document Structure Introduction L A T EX practically forces you to declare structure within your Some very documents. Let’s take the example of the structure of an basics article. Document Structure Preamble This is everything from the start of the Latex file to Formatting the \ begin { document } command. and Page Layout It contains commands and packages that affect the entire Tables document. Importing Here is for example what I wrote to start this introduction to Images and creating L A T EX. Figures Mathematics Presentation \ documentclass[12pt, letterpaper] { article } with Beamer produce \ setlength {\ topmargin }{ -0.8in } Some References \ setlength {\ textwidth }{ 6.6in } \ usepackage { hyperref } \ usepackage { indentfirst } \ renewcommand {\ baselinestretch }{ 1.24 } 6 / 29

  7. The class is given by the \ documentclass { ... } command. Valid LaTeX document classes include: Introduction ❼ article Some very basics ❼ report Document Structure ❼ letter Formatting ❼ book and Page Layout ❼ slides Tables Top Matter At the beginning of most documents will be Importing Images and information about the document itself, such as the title and creating Figures date, and also information about the authors, such as name, Mathematics address, email etc. Presentation with Beamer Some \ title { How to get started in L A T EX } References \ author { Florence Bouvet } \ date { today } \ maketitle 7 / 29

  8. Main body and Sectioning Commands The commands for inserting sections are quite intuitive. Introduction Some very basics Command Level Document \ part { a title without number } -1 Structure \ chapter { a title without number } 0 Formatting and Page \ section { a title without number } 1 Layout Tables \ subsection { a title without number } 2 Importing \ subsubsection { a title without number } 3 Images and creating \ paragraph { a title without number } 4 Figures \ subparagraph { a title without number } 5 Mathematics Presentation with Beamer ❼ Numbering will be done automatically. Some References ❼ L A T EX has a command that makes it easy to manage references (for sections, tables, figures). 8 / 29

  9. Introduction Some very For example, at the end of the introduction: basics Document Structure ”The remainder of the paper is organized as follows. Formatting The Beveridge curve is derived in and Page Section \ ref { model } . Section \ ref { conclusion } concludes.” Layout And later in the paper : Tables \ section { Derivation of the Beveridge curve } Importing Images and \ label { model } creating Figures \ section { National and regional Beveridge curves in Europe } \ label { figures } Mathematics Presentation with Beamer Some References 9 / 29

  10. Introduction Bibliography Bibtex allows you to store all your references in Some very an external, flat-file database. A Bibtex database is stored as a basics .bib file. The structure of the file is also quite simple. An Document Structure example of a Bibtex entry: Formatting and Page @book { goossens93, Layout author = ”Michel Goossens and Frank Mittlebach Tables and Alexander Samarin”, Importing Images and title = ”The Latex Companion”, creating year = ”1993”, Figures publisher = ”Addison-Wesley”, Mathematics address = ”Reading, Massachusetts” Presentation with Beamer } Some References 10 / 29

  11. Getting your Latex document to use your .bib file . At the end Introduction of your Latex file (that is, after the content, but before Some very basics \ end { document } ), you need to place the following commands: Document Structure \ bibliographystyle { plain } Formatting and Page \ bibliography { sample } Layout Tables If you want your citation to have a different style, you should Importing Images and use the Natbib package. In fact, it can supersede Latex’s own creating citation commands, as Natbib allows the user to easily switch Figures Mathematics between Harvard or numeric. Presentation The first job is to add the following to your preamble in order with Beamer to get Latex to use the Natbib package: Some References \ usepackage { natbib } 11 / 29

  12. Introduction Also, you need to change the bibliography style file to be used. Some very Let’s say we want to use AER style. We need to edit the basics appropriate line at the bottom of the file so that it reads: Document Structure \ bibliographystyle { aer } . Formatting Once done, it is basically a matter of altering the existing \ cite and Page Layout commands to display the type of citation you want: Tables Importing Images and Citation command Natbib output creating Figures \ citet { goossens93 } Goossens et al. (1993) \ citep { goossens93 } (Goossens et al., 1993) Mathematics \ citet* { goossens93 } Goossens, Mittlebach, and Samarin (1993) Presentation with Beamer \ citep* { goossens93 } (Goossens, Mittlebach, and Samarin, 1993) Some References 12 / 29

  13. Formatting Introduction Text Formatting If you use an editor such as WinEdt, it’s Some very basics quite easy to find accents (in the “international” tool folder), Document maths symbols, Greek letters, etc... Structure Getting the right font size is also quite easy: Formatting and Page Layout Command Output \ tiny Tables Size \ scriptsize Size Importing \ footnotesize Size Images and Size creating \ small Figures Size \ normalsize Mathematics Size \ large Size Presentation \ Large with Beamer Size \ LARGE Some References Size \ huge Size \ HUGE 13 / 29

  14. Introduction List Structure Lists often appear in documents, especially Some very academic, as their purpose is often to present information in a basics clear and concise fashion. List structures in Latex are simply Document Structure environments which essentially come in three flavors: itemize, Formatting enumerate and description. and Page Layout All lists follow the basic format: Tables Importing Images and \ begin { list type } creating Figures \ item The first item Mathematics \ item The second item Presentation \ item The third item, etc . . . with Beamer \ end { list type } Some References 14 / 29

  15. Introduction Some very basics Document Structure Footnotes The footnote facility is easy to use. The command Formatting you need is: \ footnote { text } . Do not leave a space between and Page Layout the command the word where you wish the footnote marker to Tables appear, otherwise Latex will process that space and will leave Importing Images and the output not looking as intended. creating Figures Mathematics Presentation with Beamer Some References 15 / 29

Recommend


More recommend