LaTeX tutorial Syed Shazli. Most of the material taken from Monash University Online material available from Googling…

Slides:



Advertisements
Similar presentations
Document preparation for project reports Rob Pooley
Advertisements

Lecture 8 Introduction to Latex. Introduction TeX is essentially a Markup Language (like HTML, XML and RTF) TeX written by Donald Knuth in 70´s –A revolution.
LaTeX tutorial Eileen Kraemer CSCI 6950 September 30 th, 2011.
Lesson 16 Enhancing Documents
Introduction to LaTeX CPS470 Software Engineering Fall 1998.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Word 2003 Lab 3 Creating Reports and Tables.
LaTeX 2e Basics CSE470 Fall 2000 Software Engineering B.J. Czerny Updated by J. Brown, A. Subramanian.
LaTeX 2e Basics CSE470 Spring 2000 Software Engineering B.J. Czerny Updated by Prasad.
School of Aeronautics and Astronautics Introduction to by Arun K. Subramaniyan
Chapter 12: Network Programming Desktop Publishing Translator models Latex Documentation Preparation Postscript programming language WYSIWIG Editors.
LaTeX Tutorial. What is LaTeX? TeX is a typesetting system designed in 1978 to automate the production of high quality print using any type of computer.
Latex A document preparation system All academic staff in Computer Science publish their work using Latex – NOT Microsoft Word. Why? Note to self – press.
1 LaTeX Introduction Wenguang Wang Department of Computer Science University of Saskatchewan February 28, 2000.
Wizards, Templates, Styles & Macros Chapter 3. Contents This presentation covers the following: – Purpose, Characteristics, Advantages and Disadvantages.
For AMS 200, 2009 Dept. of Applied Math & Statistics School of Engineering University of California Santa Cruz, CA A Very Short Introduction to LaTeX.
Welcome to the 3-day Workshop on > Presented by Saeid Abolfazli Faculty of Computer Science and IT University Malaya 23,24, and.
Adopted from: PRISM Brownbag Series June 9 th, 2009 Byungwon Woo.
Research Tools: LaTex A high quality document preparation system by Karthikeyan Umapathy.
Introduction to LaTeX PRISM Brownbag Series June 9 th, 2009 Byungwon Woo.
Introduction to… About Tex & LaTeX What is TeX? What is LaTeX? Advantages - Disadvantages.
Introduction to Latex A very quick look at typesetting documents Andrei Gurtov (based on Troy D. Milner and Simon Cuce slides)
Introduction to LaTeX CS157b John Eagle. TeX TeX is a computer program created by Donald E. Knuth. It is aimed at typesetting text and mathematical formulae.
Introduction to Unix – CS 21 Lecture 16. Lecture Overview LaTeX History Running and creating LaTeX documents Documents and Articles Tables Lists Fonts.
Introduction to LaTeX Thomas Gorry. What is Latex?  A typesetting system used to produce professional looking documents.  Particularly good at handling.
LaTeX Tutorial Fiona Shearer May 11th, 2004 Disclaimer added
LATEXLATEX IPA – batch. LATEXLATEX  A document preparation system - pronounced as lay-tek  It is a markup and programming language created by.
LaTeX A Short Intro to Marco D. Santambrogio Politecnico di Milano Sala DEIB 2 Sept 2015 Ver. 2/9/15.
Standard Grade Computing General Purpose Packages WORD-PROCESSING WORD-PROCESSING Chapter 2.
McGraw-Hill Career Education© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved. 2-1 Office PowerPoint 2007 Lab 2 Modifying and Refining a Presentation.
CC510 - LaTeX 1 Lecturer - 김한규 (Hangyu Kim) 1CC510 – 2011.
Intro to LaTeX WING meeting 12 Jan What’s LaTeX? >An alternative to using MS Word for writing reports and papers >Our target today: HYP Thesis.
1 Lecture 4 A Brief Introduction to LaTeX Introduction to Information Technology Dr. Ken Tsang 曾镜涛
June LaTeX " A typesetting package for formatting and creating documents. Created by L. Lamport based on TeX designed by D. Knuth. " Alphanumeric.
1 LaTeX For Dummies Mulugeta Gebregziabher Division of Biostatistics and Epidemiology MUSC April 4, 2011.
Text, not Word Processing Gordon J. Pace March 2006 First steps.
Visualizing and Presenting1Söhn (SS 2008) Visualizing and Presenting in Research and Teaching Introduction to LaTeX Jan-Philipp Söhn Adapted from David.
Creating documents 09/18/13 Introduction to Latex.
McGraw-Hill Career Education© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved. Office Word 2007 Lab 3 Creating Reports and Tables.
SIGNewGrad: Intro to LaTeX
C151 Multiuser Operating Systems Introduction to LaTeX.
CSE470 Software Engineering Fall Tools - Overview LaTeX – Tool to create documents RCS – Revision Control System, to maintain multiple versions.
Page Layout You can quickly and easily format the entire document to give it a professional and modern look by applying a document theme. A document theme.
Lecture 3- Microsoft Word COE 201- Computer Proficiency.
Chapter 5 More About LaTex. Packages A package, which takes the form of a file with a sty extension, can be used to alter formatting parameters, create.
R 賴威昇 Introduction 2. Why using LaTeX ? 3. LaTeX usage: ◦ Backbone ◦ Equation ◦ Figure ◦ Table ◦ BibTex 4. Compile 5. Conclusion.
Sébastien Le Roux. not What I am not going to talk about The explanations are in my HowTo ! Check my web IPCMS Basic tutorial to programming.
Academic Computing Services 2007 Microsoft Word 2010 Publishing Long Documents This Guide will teach you how to work with long documents such as dissertations.
Vereniging voor Technische Physica workshop 2016.
Department of Mathematics, Jazan University, Jazan.
LaTex -Computer scientist named Donald Knuth developed the program called Tex, in 1978.(mainly focused on formulae) -Later a mathematician and computer.
Application software Word processing 1. Application software  Some types:  Document production:  Word-processing, desktop publishing, web page authoring.
LaTeX Tutorial. What is LaTeX? TeX is a typesetting system designed in 1978 to automate the production of high quality print using any type of computer.
LATEX By GerardoVela 3/27/2015.
Lecture 1 Introduction to Latex
Lesson 16 Enhancing Documents
Vereniging voor Technische Physica workshop 2016.
Lesson 16 Enhancing Documents
By Rajyalakshmi Divi IIT Bombay
LaTeX Tutorial.
LaTeX is not... rubber a Bill Gates product WYSIWYG (see) VooDoo
Introduction to LaTeX David Squire
Basic usage and packages of TEX
A Very Short Introduction to LaTeX
Engineering Librarian
Outline Basic English Information Inquiry Reading Technical Materials
Word Processing Software Photo credit: © 2007 JupiterImagesCorporation.
A high quality document preparation system
Making Math Look Pretty – or How to Use LaTeX
LaTeX A typesetting package for formatting and creating documents. Created by L. Lamport based on TeX designed by D. Knuth. Alphanumeric source files are.
Presentation transcript:

LaTeX tutorial Syed Shazli

Most of the material taken from Monash University Online material available from Googling…

Preface LaTeX is a typesetting system (not a word processor). It is most suited to producing scientific and mathematical documents of high typographical quality.

Why not MS Word?

Advantages and Disadvantages (1) Advantages of LaTeX over WYSIWYG:  professionally crafted layouts are available  the typesetting of mathematical formulae is supported in a convenient way  users need only to learn a few simple commands, which specify the logical structure of a document.

Advantages and Disadvantages (2) Advantages of LaTeX over WYSIWYG:  complex structures such as footnotes, references, table of contents, and bibliographies can be generated easily  for many typographical tasks not directly supported by basic LaTeX, there exist free add-on packages  LaTeX is highly portable and free

Advantages and Disadvantages (3) LaTeX also has some disadvantages:  What you see is not what you get. Is this really a disadvantage? Why are you thinking about layout instead of content?  The design of a whole new layout is difficult and takes a lot of time. Templates help you here

LaTeX Input Files The input for LaTeX is a plain ASCII text file. You can create it with any text editor. It contains  the text of the document  commands which tell LaTeX how to typeset the text. Spaces Special Characters LaTeX Commands Comments

Spaces Whitespace characters (e.g. blank, tab, single linebreak) are treated uniformly as “space” by LaTeX.  Several consecutive whitespace characters are treated as one “space”. An empty line between two lines of text defines the end of a paragraph.  Several empty lines are treated in the same way as one empty line. It does not matter whether you enter one of several spaces after a word. An empty line starts a new paragraph. It does not matter whether you enter one or several spaces after a word. An empty line starts a new paragraph.

Spaces It does not matter whether you enter one of several spaces after a word. An empty line starts a new paragraph. It does not matter whether you enter one or several spaces after a word. An empty line starts a new paragraph.

Special Characters The following symbols are reserved characters, that  have a special meaning in LaTeX $ & % # _ { } ~ ^ \ Some of these characters can be used in your documents by adding a prefix backslash (escape character): $ & % # _ { } \$ \& \% \# \_ \{ \} The other symbols (and many more!) can be printed with special commands in mathematical formulae.

LaTeX Commands (1) LaTeX commands are case sensitive and take one of two formats:  They start with a backslash \ and have a name consisting only of letters.  They consist of a backslash and exactly one special character.

LaTeX Commands (2) I read that Knuth divides people working with TeX into TeXnicians and TeXperts. Today is March 25th, I read that Knuth divides people working with \TeX{} into \TeX{}nicians and \TeX perts. Today is \today.

LaTeX Commands (3) Some commands take a parameter which has to be given between curly braces { } after the command name. Some commands support optional parameters which are added after the command name in square brackets [ ]. The next example uses some LaTeX commands.

LaTeX Commands (4) This is emphasized text. Please start a new line right here! Thank you! This is \emph{emphasized} text. Please start a new line right here!\linebreak Thank you!

Comments When LaTeX encounters a % character while processing an input file, it ignores the rest of the present line. This is useful for adding notes to the input file, which will not show up in the printed version. This text is processed. This text is processed. % A comment isn’t

Input File Structure (1) When LaTeX2e processes an input file it expects it to follow a certain structure. Every input file starts with the command: \documentclass{...}  This specifies what sort of document you intend to write (article, letter, book, cssethesis, etc.) After that, you can include global style commands or you can load packages which add new features to the LaTeX system. To load a package you use the command: \usepackage{...}

Input File Structure (2) When all the setup work is done, you start the body of the text with the command: \begin{document} Now you enter the text mixed with some useful LaTeX commands. At the end of the document you use the \end{document} command, which tells LaTeX to finish. Anything which follows this command will be ignored by LaTeX

Parts of a LaTeX Document: \documentclass First line of all LaTeX documents specifies the {type} of the document and the [stylesheet] used. {article} {report} {book} {letter} Basic Classes \documentclass[ieee]{article}

A Simple LaTeX Document \documentclass{article} \begin{document} This is some sample text. \end{document}

A more realistic LaTeX file \documentclass[a4paper,11pt]{article} \usepackage{latexsym} \author{S.~Shazli} \title{Dependable Nanocomputing Lab} \begin{document} \maketitle \tableofcontents \section{Introduction} Here begins my first article \ldots \section{Conclusions} \ldots{} and here it ends. \end{document}

Sections \section{Section Title} \subsection{Title} \subsubsection{Title}

Font size \tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \huge \Huge

Page Styles LaTeX supports three predefined header/footer combinations. These are known as page styles. The style parameter of the \pagestyle{style} command defines which one to use:  plain prints the page numbers on the bottom of the page in the middle of the footer (default page style)  headings prints the current chapter heading and the page number on each page. Footer is empty  empty - both header and footer empty More elaborate headers and footers can be created using the fancyheadings package

To find the square of the hypotenuse, add a squared to b squared to find c squared, e.g.. It’s as easy as that! Typesetting Mathematics LaTeX has a special mode for typesetting mathematics, called “math mode”. Within a paragraph, math mode is entered between $ characters, or by using the \begin{math} and \end{math} commands To find the square of the hypotenuse, add a squared to b squared to find c squared, e.g. $a^2 + b^2 = c^2$. It’s as easy as that!

Typesetting Mathematics Greek Symbols \alpha, \beta, \gamma Superscript, Subscript x^yx_yx_y^z Calculus \int_0^\infty\int{\int} \frac{\partial u}{\partial x}

Typesetting Mathematics x = \frac{-b \pm \sqrt{b^2-4ac} } {2a}

Typesetting Mathematics In a research paper or thesis, you will often want to number equations and refer to them in the text This is done using the equation environment, and the commands \label and \ref (note that \label and \ref are used with figures and tables too) … it is clear that  From Equation 1 it follows that... \ldots it is clear that \begin{equation} \epsilon > 0. \label{eq:eps} \end{equation} From Equation~\ref{eq:eps} it follows that \ldots

Typesetting Mathematics Matrices are produced using the \textbf{array} environment. Example: The \emph{characteristic polynomial} $\chi(\lambda)$ of the $3 \times 3$~matrix \[ \left( \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right)\] is given by the formula \[ \chi(\lambda) = \left| \begin{array}{ccc} \lambda - a & -b & -c \\ -d & \lambda - e & -f \\ -g & -h & \lambda - i \end{array} \right|.\]

Including Graphics LaTeX2e includes a standard package for including PostScript graphics in your document. Load it using \usepackage{graphics} A figure can be included using, for example, \begin{figure}[ht] \begin{center} \includegraphics[width=140mm]{mypic.ps} \end{center} \caption{An example of a figure.} \label{fig:example} \end{figure}

Figures and Tables Figures & Tables cannot be broken between pages They are “floated” \begin{figure} \includegraphics{sample} \caption{A sample figure.} \end{figure}

Columns  \begin{tabular}{|…|…|}  \end{tabular} Rows  & - Split text into columns  \\ - End a row  \hline - Draw line under row  e.g & 34.00\\ \hline Two Columns l = automatically adjust size, left justify r = automatically adjust size, right justify p = set size e.g p{4.7cm} c = centre text Tabular

Example of table \begin{tabular}{|l|r|c|} \hline Date & Price & Size \\ \hline Yesterday & 5 & Big \\ \hline Today & 3 & Small \\ \hline \end{tabular}

Cross-referencing \label{marker} \ref{marker} \pageref{marker} Example: \section{Introduction} \label{intro} … As mentioned in section \ref{intro} in page pageref{intro}

Bibliographies Articles can be referred to in the text using the \cite command The details of the cited articles are stored in BibTeX format, in a “.bib” file. BibTeX resolves the citations in the LaTeX file and generates the required bibliography

Bibliographies By far the most commonly used feature is color (e.g. [1,2,3]), usually computed in a colour space thought to be “perceptually accurate” (e.g. HSV [3] or CIE [4]. By far the most commonly used feature is color (e.g.\ \cite{NBE1993,JaV1996,SmC1996a}), usually computed in a color space thought to be ``perceptually accurate'' (e.g. HSV \cite{SmC1996a} or CIE \cite{STL1997}).

Bibliographies Example BibTeX entries from a.bib author ={N. Ahmed and K. Rao}, title ={Orthogonal transforms for digital signal processing}, publisher ={Springer-Verlag}, year ={1975}, address ={New York}, author ={James Austin and A. Phantom and Also Phantom}, title ={High Speed Invariant Recognition Using Adaptive Neural Networks}, booktitle ={IEE 3rd International Conference on Image Processing and its Applications}, year ={1989}, pages ={28--32}, abstract ={A method is described which...}, }

Running LaTeX The simplest way to run LaTeX on a source document is to do so at the UNIX command line: These will be: >latex test.tex test.aux # the auxiliary file that LaTeX will use in subsequent passes to resolve references to figures, tables, citations etc. test.log # a log file that contains information about the LaTeX run test.dvi # the DeVice Independent output file. This is the typeset document, ready for conversion to postscript or other printable formats

Running LaTeX We can view the document we have created using a DVI viewer. The most common one under UNIX is xdvi. Type >xdvi test to see the typeset document It is important to realise that LaTeX sometimes needs to be run several times to resolve all references.

Your Latex FileYour Bibtex File Latex compile x3 Bibtex compile x2 Latex compile x3 Your Postscript File dvips compile x1 Device independent output.dvi (a text file) Creating Latex Files

Output Formats.dvi Device Independent.ps Post Script.pdfPDF.rtfRich Text Format.htmlHTML.xmlXML 1

Further reading Google