A Short L A TEX Introduction

Similar documents
COMP496/901: Academic Presentation and Writing Skills Using LaTeX

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

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

Typesetting in wxmaxima

Assessments for CS students:

Latex Tutorial. CIS400 Senior Design 9/5/2013

An introduction to L A TEX for students

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

Introduzione a LaTex. Fabrizio Messina

LaTeX A Tutorial. Mohsen Alimomeni, 2010

Outline. A Sneak Peek

Mikkel Madsen

Formatting with LaTeX

VERY VERY SHORT GUIDE TO LATEX

Introduction to L A T E X

Guide to using 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

Absolute L A TEX Beginner

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

A brief introduction to L A TEX

Introduction to Latex. A workshop by Dr. Ala Eshmawi

The basics of LaTeX. Cédric Buron. April 25, 2016

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

WYSIWYG Systems. CSCM10 Research Methodology Lecture 4 (11/2/16): A Taster of L A TEX WYSIWYM. Advantages/Disadvantages of WYSIWYG Systems

Introduction to LaTeX. Paul Fodor Stony Brook University

The AES Convention Paper LATEX class Adam H. Lewenberg (October 18, 2008) 1

Getting started with Latex

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

Very Short Introduction to LaTeX

Typesetting with TEX

CSCM10 Research Methodology A Taster of L A TEX

A Brief Introduction to L A TEX

Introduction to Scientific Typesetting Lesson 1: Getting Started

INSTALLING AND USING L A TEX

Introduction to L A TEX

An Introduction to LATEX

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

Helen Cameron. A Brief Overview of LATEX

LaTeX is essentially a markup language

Latex Manually Set Font Size For Tables

Math 235: Introduction to LaTeX

An Introduction to LATEX

Latex Tutorial 1 L A TEX. 1.1 Text

COMS 6100 Class note

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

LaTeX. Information Literacy II EN(IL2) Course

An Interactive Introduction to L A TEX

L A TEX for Psychological Researchers

Helen Cameron. A Brief Overview of LATEX

An introduction to LaTeX

Using L A TEX. A numbered list is just that a collection of items sorted and labeled by number.

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

David Helmbold, October 2005, Revised October 2007

Introduction to MCS 220 and L A TEX

CSCM10 Research Methodology A Taster of L A TEX

WYSIWYG Systems. CSCM10 Research Methodology A Taster of L A TEX WYSIWYM. Advantages/Disadvantages of WYSIWYG Systems.

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

An Introduction to LATEX

Basic L A TEX. what is LaTeX?

Began as TeX, in 1982 (Knuth). Purely a typesetting tool. LaTeX added macros, maintaining TeX as it s typesetting engine (Lamport).

Introduction to L A TEX for MCS-236

Introduction to LAT E X

A Very Brief Introduction to L A T E X MAT 3535

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

A Beginner s guide to L A TEX for CSCA67/MATA67. Kohilan Mohanarajan

Electronic Production Guidelines

CSCE 222 Discrete Structures for Computing. LaTeX. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

My Mathematical Thesis

Written & Oral Presentation: Computer Tools

Useful L A TEX Commands

Introduction to LATEX

A Short Introduction to L A TEX

1. The Joy of TEX. Check out this example!

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

Dec. 27 th, 2010 University of Isfahan

1. Welcome. (1) Hello. My name is Dr. Christopher Raridan (Dr. R). (3) In this tutorial I will introduce you to the amsart documentclass.

Introduction to typesetting with L A TEX

Math 291: Lecture 2. Justin A James. Minnesota State University Moorhead web.mnstate.edu/jamesju/

Introduction to LATEX

L A TEX for Psychological Researchers

Document Preparation Using L A TEX

L A TEX: Eh? What is it, what isn t it, who cares? Andy Caird. LATEX: Eh? p.1/13

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

Math 291: Lecture 2. Presented by Prof. James for Prof. Fagerstrom

Using L A TEX Tom Edgar

Introduction to LAT E X

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

L A TEX. A computer system for typesetting documents

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

An Interactive Introduction to L A TEX. Part 1: The Basics. John Lees-Miller. writel A TEX

L A TEX examples. a b c a b c b b a c b c c b a. This table was typeset with the following commands.

Introduction to L A TEX

Getting ready for L A TEX. Alexis Dimitriadis. Version: March 28, 2013

Learning L A TEX. Patrick Lam

A LAT E X Tutorial. Evangelos Milios. March 15, 2004

Lab1: Communicating science

An introduction to TeX. And other options for producing documents containing mathematics

LATEX TYPESETTING SYSTEM. CAAM 519, CHAPTER 3

The Joys of L A T E X

Writing. October 3, 2006

Transcription:

A Short L A TEX Introduction Dr Will Hossack School of Physics & Astronomy tele: 50-5261 Will.Hossack@ed.ac.uk February 2016

What is L A TEX L A TEX(being Layman s-tex) is a text-formatting mark-up language, 1 Edit a source file containing your text and layout instructions. 2 Process (or compile) it using the command latex to give a device independent dvi file. 3 Result can be viewed on screen or printed. 4 Option to convert to Postscript or PDF for printing 5 Converters to XML/HTML for Web (more advanced) February 2016 2 / 1

History TEX designed and implemented by Donald Knuth to format his book series The Art of Computer Programming. 1980. L A TEX simplified front-end by Leslie Lamport, originally for production of computer manuals 1985. Updated to L A TEX 2ɛ in 1993, then to L A TEX 3, but all still compatible with original. Best testament to a really well designed piece of software!, is works and has lasted. February 2016 3 / 1

Why use L A TEX Superficially L A TEX looks old, difficult, out-dated, and a bit of a dinosaur, but... 1 If formats mathematics faultlessly! 2 It has mathematically (and typographically correct fonts.) 3 It implements all the correct rules of typography. 4 It can produce truly beautifully documents. 5 It works on all computers, and is totally reproducible on all computers. 6 Is a close to bug-free as you will ever find. 7 Its Free Software in the truest sense. Its the standard for all mathematics, physics and many computer science literature including all journals and most textbooks. Think HTML but actually done properly, and you are getting the idea! February 2016 4 / 1

The very basic L A TEX document Start off by creating a simple file, say document.tex that contains this: \documentclass[a4paper,12pt]{article} \begin{document} \begin{center} \Large Text formatting here I come \end{center} Using \LaTeX\ for simple text is very easy, you do t even have to worry about getting the lines the same length! Ever paragraphs are just extra blank lines, this is really is very easy. \end{document} Now lets see what we have to do to process and print it... February 2016 5 / 1

The very basic L A TEX document II Simplest Processing: On CPLab (and command Linux) 1 pdflatex document process the file with latex which will produce a file document.pdf. 2 evince document.pdf shown PDF file on the screen. (acroread no longer works) 3 lp document.pdf prints the file to the default printer. February 2016 6 / 1

Mac or Windows Mac and Widows implementations help automate process. 1 MacOSX, use TeXShop. Has build-in editor, Typeset buttons with rapid preview, automatic build of PDF files. (can also use from xterm windows) 2 Windows, use MikTeX. Has TeXnicCenter builder, actually uses DoS commands TexShop under MacOSX is currently the most user friendlily L A TEX build with (almost) every package already installed. Also OverLeaf cloud system, free for small project. Good for personal use. (but not tried myself) February 2016 7 / 1

Italic and Bold Simplest scheme is to use \it and \bf key inside {}. and {\it you} really {\bf must} get this correct! will give you and you really must get this correct! You can also locally change font size with with \tiny, \small,\large,\large,\large key words. This is old way of changing fonts, it works well, and easiest to use, the new and correct is much more verbose. February 2016 8 / 1

Other Symbols There are full range of symbols and accents, all controlled by keywords, for example \pounds 23.45 gives 23.45 and Schr\"odinger gives Schrödinger. There is also full support for non-english languages, including oriental, Arabic, and hieroglyphics! even fantasy languages (but we have not installed all of them!!!). February 2016 9 / 1

Adding Mathematical Characters Two types of maths, In-line and Display. Inline Mathematics: Simple enclose in $ signs, so that and the particle has velocity $v=u+\alpha t$ \loots will give: and the particle has velocity v = u + αt... Note: The \alpha gives α, and since we are in maths mode then all variables are maths italic and the spacing is correct for mathematics. In maths mode you have all Greek letters and masses of other mathematical symbols available. February 2016 10 / 1

Display Maths Display maths equations appear centre, typically with equation numbers, so \begin{equation} \vec{e} = \frac{1}{4\pi\epsilon_0} \frac{q}{r^2}\hat{k} \end{equation} will give you, E = 1 4πɛ 0 q r 2 ˆk (1) Note: that superscripts and subscripts automatically scale as to. February 2016 11 / 1

Brackets and Integrals Brackets and matched with the \left and \right key and again scale, also \int behaves as you would expect. So even fairly complex equations, like, [ ] 1 z λ E z = de z = ds (2) ring 4πɛ 0 (R 2 + z 2 ) 3 2 can be set with \begin{equation} E_z = \int_{\rm ring} de_z = \left[\frac{1}{4\pi\epsilon_0} \frac{z\,\lambda} {\left(r^2 + z^2\right)^{\frac{3}{2}}}\right] \int ds \end{equation} Matching up { and } is vital, and can be character building! February 2016 12 / 1

Matrices, Arrays and Multiline Equations This is a bit tougher, but the most common is the matrix, [ ] a b M = c d (3) which can be easily set using the \matrix construct, being \begin{equation} {\bf M} = \left[ \begin{matrix}a & b\\ c & d \end{matrix}\right] \end{equation} There are many other constructs, see book, on-line references and ask you local TEX-pert. February 2016 13 / 1

Document Type and Sections There are three standard document types 1 article short document with sections and subsections (the most useful). 2 report long document with chapters, sections and subsections. 3 book extension of report with different page layout. Most useful is article class, declared at the top \documentclass[a4paper,12pt]{article} means an article document, but using 12pt font and a4paper. The default is 10pt font on US Letter paper, which is rather small font, on paper we don t have!! February 2016 14 / 1

Sections and Subsection Assume article, then you have 1 \section{title of Section} start of section. 2 \subsection{title of a Subsection} start of a subsection, 3 \subsubsection{title of a Subsubsection} start of a subsubsection. Size of fonts and numbering is all automatic. You can add/remove sections and the numbering will automatically change. February 2016 15 / 1

Sections and Subsection II There is also * variants which do not have numbers, \section*{un-numbered section} will format a section but without a number heading. \subsection*{un-numbered subsection} will format a subsection but without a number heading. Number and title can also be automatically included in a Table of Contents, which it really get right! February 2016 16 / 1

Floating Bodies There are object that will not appear immediately but at the next convenient place. Typically figures, tables and footnotes. Footnotes: There are easy, just do,.. which you can easily\footnote{with pages of manipulation! will add a superscipt in the text and a footnote (in reduced font) at the foot of the page. Figures: are a bit harder, work through: \begin{figure}[htb] <body of figure, often a PDF file> \caption{this is a figure.} \label{fig:importantfigure} \end{figure} which will add the figure as soon as possible, with specified caption and label. February 2016 17 / 1

Floating Bodies Now the good bit, you can then refer to the figure by... as shown in figure~\ref{fig:importantfigure}... and it will get all the cross reference right even if you re-order the figures... February 2016 18 / 1

Where Floating Bodies go... Floating figures etc format using typographic rules, which are normally correct, 1 Make figure smaller, large figures are difficult to place. 2 Relocate definition, move declaration forward of back input file. 3 Accept your lot accept that L A TEX has done the best possible. If you use labels, footnotes you may have to run latex 2 or sometimes 3 times to sort out all cross-references. Note: You can also use \label{name} for equations, section, subsection etc, so you can refer to them be name. When you modify document, all the cross-references are still correct! February 2016 19 / 1

Adding extra features... Add extra packages to standard L A TEX by using the \usepackage, which must go before \begin{document}, so will add packages \usepackage{fullpage,hyperref} \usepackage[pdftex]{graphicx} 1 fullpage local package to fill a A4 page with sensible margins. 2 graphicx add including graphical files, using [pdftex] 3 hyperref add including of http hyperref with work in PDF documents. There are many thousands of possible extensions. February 2016 20 / 1

Adding PDF Files The simplest recipe is: \begin{center} \includegraphics[height=60mm]{mypostsscriptfigure.pdf} \end{center} which will centre MyPostsScriptFigure.pdf scaled to 60 mm high. (can alternatively use width = 100mm so scale to 100 mm wide.) You can also add Postscript files, but best advice is to use all PDF (make it much simpler) February 2016 21 / 1

Adding Postscript Files II Utilities that work easily are: 1 xfig to draw diagrams. 2 gnuplot to plot graphs. 3 maple for graphs and function plots. May have to produce eps files and then convert; or use \usepackage{epstopdf} which does the conversion on-the-fly. (newest distributions only). Many PC utilities do NOT produce legal PDF files. February 2016 22 / 1

Adding hyperrefs Adding external hyperrefs is very easy, \href{http://en.wikipedia.org/wiki/latex}{see here} will add the link to the Wikipedia entry for L A TEX. When you make a PDF file, it will have a clickable link that will open your Web browser. It does work fine in the CPLab with pdflatex. February 2016 23 / 1

Using macros L A TEX has powerful macro scheme, its simplest use is for symbol substitution. If you are doing a lot of electromagnetism, we can define two local macros, \ve and \ce by so that would be formatted by \newcommand{\ve}{\underline{\vec{\bf E}}} \newcommand{\ce}{\frac{1}{4\pi\epsilon_0}} E = 1 4πɛ 0 q r 2 ˆk (4) \begin{equation} \ve = \ce \frac{q}{r^2} \hat{k} \end{equation} Macro can also take parameters, also can include if statements and perform calculations... so a programming language. February 2016 24 / 1

Breaking up your input It is also very useful to breakup your input into a series of source files chained together with \input commands, \documentclass[a4paper,12pt}{article} \usepackage{fullpage,epsfig} \begin{document} \input title \input abstract \input theory \input results \input excuses \end{document} where the actual text is is title.tex, abstract.tex etc. Very useful feature when you have a large document written by several people. February 2016 25 / 1

Summary L A TEX is good for: 1 Highly mathematical document (nothing else comes close). 2 Large, complex documents with many sections, and potentially many authors. 3 Technical books (or thesis) with complex structure. 4 Documents that must be totally cross-platform. 5 Documents with optional sections/formats. But not so good for simple letters, forms etc. February 2016 26 / 1