L A T E X FOSSEE. Department of Aerospace Engineering IIT Bombay. FOSSEE (IIT Bombay) LAT E X 1 / 58

Similar documents
Workshop on LATEX 2ε. Asst. Prof. Dr. Kemal Bagzibagli Department of Economics. 20 May 2015

LATEX TYPESETTING SYSTEM. CAAM 519, CHAPTER 3

An Introduction to. Rado Ivanov CIS400 Senior Design Tutorial September 18, 2014

Latex Tutorial. CIS400 Senior Design 9/5/2013

L A TEX Overview. Jiayi Liu. January 31, Colorado School of Mines

Introduction to LaTex 2ε. Based on The Not So Short Introduction to LaTeX 2ε by Tobias Oetiker et al., April 2001

L A TEX Tutorial. 1 Introduction. 2 Running L A TEX. J. E. Rice. May 2010

عمادة البحث العلمي جامعة الملك سعود

L A TEX for Psychological Researchers

Learning L A TEX. Patrick Lam

LATEX Workshop. Yi Liu Chen SUNY Geneseo PRISM Math Club. February 6, Wordmark Reversed Geneseo Wordmark Style Guide 4

Lecture 1: Short summary of LaTeX basics

LYX with Beamer and Sweave

Getting Started with L A T E X for a Technical Document or Thesis

Introduction to L A TEX

Outline. Installing LaTeX. Opening TeXShop. Intro to LaTeX. Intro to LaTeX interface Working with text Tabbing and tables Figures Math and equations

LATEX Seminar Week 2 Jonathan Blair & Evan Ott. Document classes, basic math formatting, basic pictures, tables and matrices

An Introduction to. Andrew G. West, Jian Chang CIS400 Senior Design Tutorial September 15, 2009

Manuscript Title. with Forced Linebreak. Ann Author a) and Second Author b) Authors institution and/or address This line break forced with \\

Intro to LaTeX Workshop

L A TEX for Psychological Researchers

Intro to LATEX I. Aaron Erlich POLS/CSSS 510, Why LATEX? Programming Document Structure Floats Tables Lists Math

Introduction to L A TEX

Formatting with LaTeX

Guide to using L A TEX

Abstract A quick intro by examples to the document preparation language L A TEX.

Become a L A TEX Guru

Introduction to L A TEX beamer

Part - I : Short Course Typing Text

LATEX. Leslie Lamport. Digital Equipment Corporation. Illustrations by Duane Bibby. v ADDISON-WESLEY

Written & Oral Presentation: Computer Tools

Introduction to LaTeX. Paul Fodor Stony Brook University

Introduction to LATEX

Tools for Scientific Writing with LAT E X. Johan Carlson

L A TEX. COMPSCI 111 / 111G Mastering Cyberspace: An introduction to practical computing. LaTeX. Development. Why?

L A TEX Primer. Randall R. Holmes. August 17, 2018

L A TEX incollaboration

Math 235: Introduction to LaTeX

Latex Manually Set Font Size For Tables

How to get started in L A TEX

David Helmbold, October 2005, Revised October 2007

Tools for Scientific Writing with LAT E X. Johan Carlson

An Introduction to LATEX

Introduction to LaTeX. M&S Talk Series August 16 th, 2016 AH Sheikh

What is LaTeX. Is a document markup language and document preparation system for the TeX typesetting program

Introduction to Math in LaTeX

Meeting One. Aaron Ecay. February 2, 2011

Introduction to Latex. A workshop by Dr. Ala Eshmawi

Researcher Development Unit: Introduction to Latex

Typesetting in wxmaxima

An Introduction to LATEX

The Name of the Game. An Introduction to LATEX. Why L A TEX? The Name of the Game

Lecture 3-Introduction to Latex (II)

An Introduction to L A TEX

Introduction to LAT E X

An Interactive Introduction to L A TEX. Part 2: Structured Documents & More. Dr John D. Lees-Miller. writel A TEX.

ShortCourseOfL A T E X Lecture I

PRISM Introduction to L A TEX

A L A TEX-Package for IEEE PES Transactions

Introduction to LAT E X

Math 291: Lecture 5. Dr. Fagerstrom. Minnesota State University Moorhead web.mnstate.edu/fagerstrom

A Brief Introduction to LaTeX

L A T E X Workshop. Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian Institute of Technology

A Short Introduction to L A TEX

GENERAL INFORMATION INSTRUCTIONS FOR MANUSCRIPT SUBMISSION

L A TEX Workshop. Don Brower

Getting started General Tables Figures Math Wrap up. UCLA Department of Statistics Statistical Consulting Center. LaTeX Bootcamp

COMP496/901: Academic Presentation and Writing Skills Using LaTeX

George Grätzer. Practical L A TEX

Outline. A Sneak Peek

Introduction to L A TEX

Learning LaTeX: The Basics

An introduction. C.D. Emmery & M.M. van Zaanen. October 22, Tilburg University

Assessments for CS students:

LaTeX. Information Literacy II EN(IL2) Course

An introduction to L A TEX for students

Mikkel Madsen

A Document Preparation System. User's Guide and Reference Manual. Leslie Lamport

CS 189 L A TEX and Linux: Document Layout and Organization

THIS IS AN INTRODUCTION TO. LaTeX. Introduction to Latex. University of Minnesota, November 7, 2016

Introduzione a LaTex. Fabrizio Messina

COMS 6100 Class note

LaTeX A Tutorial. Mohsen Alimomeni, 2010

Manuscript Title: with Forced Linebreak

L A TEX: Online module 2

(Yet Another) Introduction to L A TEX 2ε (V3)

L A TEX From The Ground Up

NCSU Linguistics Eric Wilbanks & Jeff Mielke. November 21, An open-source typesetting language used for document mark-up

Introduction to L A TEX

VERY VERY SHORT GUIDE TO LATEX

1 Obtaining LyX and L A TEX

L A TEXcourse. Carmen Alonso Montes. 30th May-2nd June, 2016

How to L A TEX. George Wong, David Mykytyn. 6 October 2016

Workshop: A Simple Introduction to L A TEX

My Mathematical Thesis

Lecture 2: Tables, Figures and Formulæ

My LaTeX Document. July 7, Introduction 2

Introduction to Beamer

Introduction to L A TEX

Basic L A TEX. what is LaTeX?

Transcription:

L A T E X FOSSEE Department of Aerospace Engineering IIT Bombay FOSSEE (IIT Bombay) LAT E X 1 / 58

Outline Introduction 1 Introduction 2 Adding Structure 3 Typesetting Text 4 Figures, Tables & Floats 5 Typesetting Math 6 Bibliography 7 Presentations - Beamer 8 Miscellaneous FOSSEE (IIT Bombay) LAT E X 2 / 58

L A T E X - Introduction Introduction Typesetting program What is typesetting? Excellently Typeset Documents - specially Math Anything from one page articles to huge books Pronounced Lah-tech or Lay-tech FOSSEE (IIT Bombay) LAT E X 3 / 58

Why L A T E X? Introduction Excellent visual quality! Handles the typesetting; Lets you focus on content Makes writing math extremely simple It is a standard widely used in Scientific community Ñ x r(x)f 1k (x, t) 1 2ÑÑ : BB T P(x, t) = m k f 1k (x, t) + 2 K å j=1 f 1j (x, t)m j P k j FOSSEE (IIT Bombay) LAT E X 4 / 58

Course Outline Introduction Look at the sample document - sample.pdf Title, Author, Date Abstract Sections & Subsections Appendix References/Bibliography Tables Figures Math The document will be produced by the end of the course. First Hour - Basic Structure Second Hour - Text, Tables, Figures, References Third Hour - Math, Bibliography, Presentations FOSSEE (IIT Bombay) LAT E X 5 / 58

L A T E X as a Mark-up Introduction L A T E X is a document based mark-up Mark-up a system of annotating text, adding extra information to specify structure and presentation of text Document based markup you don t have to worry about each element individually Allows you to focus on content, rather than appearance. FOSSEE (IIT Bombay) LAT E X 6 / 58

Introduction Typesetting a minimal document Write the sample code into the file draft.tex See hg rev0 of draft To compile, (in terminal) $ pdflatex draft.tex This produces the output file draft.pdf Note: latex vs. pdflatex FOSSEE (IIT Bombay) LAT E X 7 / 58

Introduction Commands & Environments L A T E X is case sensitive Commands begin with a \ Environments have a \begin and \end Any content after the \end{document} is ignored FOSSEE (IIT Bombay) LAT E X 8 / 58

Introduction Comments & Special Characters Anything that follows a % symbol till end of the line is a comment Special characters (~ # $ ^ & _ { }) are escaped by a \ \ symbol is inserted using \textbackslash command FOSSEE (IIT Bombay) LAT E X 9 / 58

Spacing Introduction \\ inserts a new line in the output An empty line marks the beginning of a new paragraph Multiple spaces (or empty lines) are equivalent to a single space (or empty line) FOSSEE (IIT Bombay) LAT E X 10 / 58

Outline Adding Structure 1 Introduction 2 Adding Structure 3 Typesetting Text 4 Figures, Tables & Floats 5 Typesetting Math 6 Bibliography 7 Presentations - Beamer 8 Miscellaneous FOSSEE (IIT Bombay) LAT E X 11 / 58

documentclass Adding Structure Used to select the class of our document Some available classes - article, proc, report, book, slides, letter. For example: \documentclass[12pt,a4paper,draft]{report} The parameters within [ ] are optional. 12pt sets the font size of main font and others are relatively, adjusted. 10pt is the default. a4paper specify paper size draft marks hyphenation and justification problems in typesetting with a square in the margin FOSSEE (IIT Bombay) LAT E X 12 / 58

Top Matter Adding Structure Let s add the title, author s name and the date. Add title, author and date. Compile. Nothing changes. See hg rev1 of draft. FOSSEE (IIT Bombay) LAT E X 13 / 58

Top Matter... Adding Structure \maketitle command inserts the top-matter. Add the command to the document & compile again. If no date is specified, today s date is automatically inserted. See hg rev2 of draft. FOSSEE (IIT Bombay) LAT E X 14 / 58

Abstract Adding Structure abstract environment inserts abstract. Place it at the location where you want your abstract. See rev3 of hg FOSSEE (IIT Bombay) LAT E X 15 / 58

Sectioning Adding Structure See rev4 of hg \section, \subsection \subsubsection Auto numbered sections! * to prevent numbering of a section FOSSEE (IIT Bombay) LAT E X 16 / 58

Sectioning... Adding Structure Longer documents, use report or book class Chapter can be added using \chapter \documentclass{report} \chapter{one} subsections do not get numbering Change secnumdepth \setcounter{secnumdepth}{3} See rev5 of hg FOSSEE (IIT Bombay) LAT E X 17 / 58

Appendices Adding Structure \appendix command indicates the beginning of Appendices. Any content after \appendix, will be added to the appendix Use sectioning commands to add sections See rev7 of hg FOSSEE (IIT Bombay) LAT E X 18 / 58

Adding Structure Table of Contents [TOC] Our document is short, but let s learn to add a TOC Add \tableofcontents where you want TOC to appear Compile Only headings appear. No page numbers A.toc file is generated Re-compile Any numbered section/block automatically appears See rev8 of hg FOSSEE (IIT Bombay) LAT E X 19 / 58

TOC... Adding Structure Un-numbered sections are added to TOC using \addcontentsline For instance, \addcontentsline{toc}{section}{intro} See rev9 of hg FOSSEE (IIT Bombay) LAT E X 20 / 58

Bibliography Adding Structure We shall look at Bibliographies, later in the course. FOSSEE (IIT Bombay) LAT E X 21 / 58

Outline Typesetting Text 1 Introduction 2 Adding Structure 3 Typesetting Text 4 Figures, Tables & Floats 5 Typesetting Math 6 Bibliography 7 Presentations - Beamer 8 Miscellaneous FOSSEE (IIT Bombay) LAT E X 22 / 58

Quotation Marks Typesetting Text Use ` (accent) for left quote Use (apostrophe) for right quote For double quotes, use them twice See rev11 of hg FOSSEE (IIT Bombay) LAT E X 23 / 58

Typesetting Text Fonts - Emphasis, Fixed width,... \emph gives emphasized or italic text flushleft to have text left aligned flushright, center See rev12 of hg FOSSEE (IIT Bombay) LAT E X 24 / 58

Typesetting Text Fonts - Emphasis, Fixed width,... \texttt gives fixed width font \textbf bold face font -- en dash ( ); --- em dash ( ). See rev13 of hg FOSSEE (IIT Bombay) LAT E X 25 / 58

Lists Typesetting Text enumerate environment is used for numbered lists itemize environment gives un-numbered lists Each item in the list is specified using \item Nested lists are also easily handled, as expected See rev14 of hg FOSSEE (IIT Bombay) LAT E X 26 / 58

Footnotes Typesetting Text \footnote command adds a footnote See rev15 of hg FOSSEE (IIT Bombay) LAT E X 27 / 58

Typesetting Text Labels and References \label{labelname} is used to label an element \ref{labelname} is used to refer to that element Compile twice See rev15 of hg FOSSEE (IIT Bombay) LAT E X 28 / 58

Including code Typesetting Text Instead of using \texttt we could use \verbatim listings is a powerful package \usepackage{listings} needs to be added Tell L A T E X the language to be used, using \lstset See rev16 of hg FOSSEE (IIT Bombay) LAT E X 29 / 58

Including code Typesetting Text Use \lstlisting for a block of code \lstinline for inline code See rev16 of hg FOSSEE (IIT Bombay) LAT E X 30 / 58

Outline Figures, Tables & Floats 1 Introduction 2 Adding Structure 3 Typesetting Text 4 Figures, Tables & Floats 5 Typesetting Math 6 Bibliography 7 Presentations - Beamer 8 Miscellaneous FOSSEE (IIT Bombay) LAT E X 31 / 58

Figures Figures, Tables & Floats The graphicx package allows us to insert graphics \usepackage{graphicx} To add a graphic, use \includegraphics command Use relative path to the image See rev17 of hg FOSSEE (IIT Bombay) LAT E X 32 / 58

Figures, Tables & Floats includgraphics It takes following optional arguments scale specifies the factor by which to scale the image height, width If only one of them is specified, aspect ratio is maintained keepaspectratio boolean value to keep aspect ratio or not angle specify by what angle the image should be rotated FOSSEE (IIT Bombay) LAT E X 33 / 58

Floats Figures, Tables & Floats Graphics (& Tables) are special because they cannot be broken across pages They are floated to the next page, if they don t fit in the current page Enclose graphic within figure environment to make it float Figure environment takes additional parameter for location of float Table : Permission Specifiers Specifier Permission t Top of page b Bottom of page p Separate page for floats h here (the same place where command appears in source)! override L A T E X s internal parameters for good position FOSSEE (IIT Bombay) LAT E X 34 / 58

Figures, Tables & Floats Captions and References Figure environment allows us add a caption To place the image in the center we enclose it in the center environment We can label images too label should be added after the caption command Figures are auto numbered See rev17 of hg FOSSEE (IIT Bombay) LAT E X 35 / 58

Tables Figures, Tables & Floats tabular is used to typeset a table It is enclosed in a table environment to make it a float table environment also gives captions, auto numbering FOSSEE (IIT Bombay) LAT E X 36 / 58

tabular Figures, Tables & Floats tabular takes formatting of each column as argument Table : tabular environment l left justified column content r right justified column content c centered column content produces a vertical line also takes an optional parameter for specifying position of table t for top, b for bottom, c for center each column of table is separated by & each row is separated by newline \\ \hline give a horizontal line between two rows Also see longtable, especially relevant for htlatex See rev18 of hg FOSSEE (IIT Bombay) LAT E X 37 / 58

Figures, Tables & Floats List of Tables, Figures \listoftables to add a list of tables \listoffigures to add a list of figures FOSSEE (IIT Bombay) LAT E X 38 / 58

Outline Typesetting Math 1 Introduction 2 Adding Structure 3 Typesetting Text 4 Figures, Tables & Floats 5 Typesetting Math 6 Bibliography 7 Presentations - Beamer 8 Miscellaneous FOSSEE (IIT Bombay) LAT E X 39 / 58

Math in L A T E X Typesetting Math Math is enclosed in a pair of $ signs or \( \) Used for typesetting inline Math. \usepackage{amsmath} Let s now move on to matrices. FOSSEE (IIT Bombay) LAT E X 40 / 58

Matrices Typesetting Math See rev19 of hg \bmatrix is used to typeset the matrix A It works similar to the tabular environment & for demarcating columns \\ for demarcating rows Other matrix environments matrix none pmatrix ( Bmatrix { vmatrix Vmatrix FOSSEE (IIT Bombay) LAT E X 41 / 58

Typesetting Math Superscripts & Subscripts ^ for superscripts _ for subscripts Enclose multiple characters in { } FOSSEE (IIT Bombay) LAT E X 42 / 58

Typesetting Math Summation & integration \sum command gives the summation symbol The upper and lower limits are specified using the ^ and _ symbols. Similarly the integral symbol is obtained using \int command. FOSSEE (IIT Bombay) LAT E X 43 / 58

displayed math Typesetting Math Display equations are the other type of displaying math L A T E X or amsmath has a number of environments for displaying equations, with minor differences. In general, enclose math in \[ and \] to get displayed math. \begin{equation*} is equivalent to this. Use \begin{equation} to get numbered equations. See rev20 of hg FOSSEE (IIT Bombay) LAT E X 44 / 58

Typesetting Math Groups of equations The equation environment allows typesetting of just 1 equation. eqnarray allows typesetting of multiple equations It is similar to the table environment The parts of the equation that need to be aligned are indicated using & symbol. Each equation is separated by a \newline command See rev21, 22 of hg FOSSEE (IIT Bombay) LAT E X 45 / 58

Fractions & Surds Typesetting Math Fractions are typeset using \frac command \frac{numerator}{denominator} is typeset as Surds are typeset using \sqrt[n] command numerator denominator FOSSEE (IIT Bombay) LAT E X 46 / 58

Typesetting Math Shortcuts/aliases/newcommands We often need shortcuts \def \newcommand \renewcommand : to be used judiciously! Overwrites: those sharing your tex file won t be warned :-) \newcommand{\yourownshortcut}[1]{\frac{d^{#1}}{dt^{#1}}} $\yourownshortcut{5}$ gives d 5 Exercise: use \def and \newcommand and look up optional arguments dt 5 FOSSEE (IIT Bombay) LAT E X 47 / 58

Typesetting Math Shortcuts/aliases/newcommands We often need shortcuts \def \newcommand \renewcommand : to be used judiciously! Overwrites: those sharing your tex file won t be warned :-) \newcommand{\yourownshortcut}[1]{\frac{d^{#1}}{dt^{#1}}} $\yourownshortcut{5}$ gives d 5 Exercise: use \def and \newcommand and look up optional arguments dt 5 FOSSEE (IIT Bombay) LAT E X 47 / 58

Typesetting Math Greek characters & Spacing Typesetting Greek characters is simple \alpha, \beta, \gamma,... \Alpha, \Beta, \Gamma... To get additional spacing in Math environments Abbrev. Spelled out Example \, \thinspace A B \: \medspace A B \; \thickspace A B \quad A B \qquad A B \! \negthinspace A!B \negmedspace AB \negthickspace AB FOSSEE (IIT Bombay) LAT E X 48 / 58

Outline Bibliography 1 Introduction 2 Adding Structure 3 Typesetting Text 4 Figures, Tables & Floats 5 Typesetting Math 6 Bibliography 7 Presentations - Beamer 8 Miscellaneous FOSSEE (IIT Bombay) LAT E X 49 / 58

Bibliography Bibliography thebibliography environment provides a clean and simple way to add a bibliography to L A T E Xdocuments. \begin{thebibliography}{10} (Argument 10 (for example) is the maximum width of the label that references will have (for certain bibliography styles). Each item of the Bibliography is similar to an item in a list. \bibitem[label]{name} followed by the actual reference info. label replaces auto enumeration numbers \cite{name} is used to cite the bibitem You will need to compile twice. See rev23 of hg FOSSEE (IIT Bombay) LAT E X 50 / 58

Bibtex Bibliography Rather than reproducing bibitems at the end of each report/paper, shift to bibtex bib file allows systematic storing of references bst file to help with reference formatting bibtex creates bbl file to include as bibitems (for manual tweaking) pdflatex bibtex pdflatex 2 FOSSEE (IIT Bombay) LAT E X 51 / 58

Outline Presentations - Beamer 1 Introduction 2 Adding Structure 3 Typesetting Text 4 Figures, Tables & Floats 5 Typesetting Math 6 Bibliography 7 Presentations - Beamer 8 Miscellaneous FOSSEE (IIT Bombay) LAT E X 52 / 58

Beamer Presentations - Beamer Use beamer since your report s L A T E X would be re-usable. It is recommended to start with one of the beamer templates. Let s look at speaker introduction template. \documentclass{beamer} tells L A T E X to start a beamer presentation. A beamer document is very similar to any other L A T E X document except that content is divided into slides. FOSSEE (IIT Bombay) LAT E X 53 / 58

Beamer... Presentations - Beamer \usetheme command is used to specify the theme of the presentation. \usecolortheme command is used to specify the color theme. The content of a slide is enclosed within \begin{frame}{title}{subtitle} and \end{frame} If the slide contains verbatim lstlisting environments, the \begin{frame} should be passed an additional argument [fragile] Overlays can be achieved using the \pause command. To achieve more with beamer, it is highly recommended that you look at the beameruserguide Can change mode from presentation to printout to disable themes/section-headings and pauses (ideal for printing out). FOSSEE (IIT Bombay) LAT E X 54 / 58

Outline Miscellaneous 1 Introduction 2 Adding Structure 3 Typesetting Text 4 Figures, Tables & Floats 5 Typesetting Math 6 Bibliography 7 Presentations - Beamer 8 Miscellaneous FOSSEE (IIT Bombay) LAT E X 55 / 58

Miscellaneous Relevant shell variables Bash shell variables that help keep your personal cls files, figures in your common directory: do not maintain multiple copies of same file! TEXINPUTS (with double // for across all subdirectories ) BIBINPUTS (for bib file, to avoid duplication) Alternatively, use shell variable ln (for link, instead of cp: copy) FOSSEE (IIT Bombay) LAT E X 56 / 58

Miscellaneous More control over floats Spirit behind latex: let latex decide locations and no manual tweaking Sometimes need to tweak: floats are quite disobedient Explore minipage environment, subfigure and caption packages Use longtable for a table that extends across pages FOSSEE (IIT Bombay) LAT E X 57 / 58

Miscellaneous These slides were made using beamer. FOSSEE project employees contributed to the content. Thank You! FOSSEE (IIT Bombay) LAT E X 58 / 58