An Introduction to L A TEX

Similar documents
Basic L A TEX. what is LaTeX?

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

Introduction to LaTeX. Paul Fodor Stony Brook University

Introduction to LATEX

L A TEX From The Ground Up

Using LaTex and BibTex to Write Academic Documents. Ligang He Department of Computer Science University of Warwick

Introduction to Latex. A workshop by Dr. Ala Eshmawi

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

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

LaTeX. Information Literacy II EN(IL2) Course

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

Mikkel Madsen

An introduction to L A TEX for students

L A TEX Workshop. Don Brower

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

Introduction to L A T E X

Latex Tutorial. CIS400 Senior Design 9/5/2013

What is T E X? T E X and L A T E X Document preparation tools. Setting and casting type. What Knuth was setting. Setting and casting type

LAT E X week 2: Basics for Writing a Document

A Grasshopper s Approach to L A TEX

Dec. 27 th, 2010 University of Isfahan

A quick guide to L A TEX

LaTeX. Information Literacy II EN(IL2) Course

COMS 6100 Class note

COMP496/901: Academic Presentation and Writing Skills Using LaTeX

L A TEX for Psychological Researchers

An Introduction to L A T E X

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

Very Short Introduction to LaTeX

Excellent support for mathematical formatting. Automatically downloads/installs missing components as needed Updates somewhat frequently

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

LaTeX A Tutorial. Mohsen Alimomeni, 2010

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

Introduction to LaTeX. Christoph Pickl

Learning L A TEX. Patrick Lam

Document Preparation Word Processors

L A TEXInstallation and Introduction

CS 189 L A TEX and Linux: Displaying Text

Introduzione a LaTex. Fabrizio Messina

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

Helen Cameron. A Brief Overview of LATEX

Introduction to L A TEX

Introduction to L A TEX beamer

A brief introduction to L A TEX

Mikkel Madsen

L A TEX minicourse. dstowell, mag, sar, scannell,... September Typeset by FoilTEX

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.

L A TEX for Psychological Researchers

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

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

Introduction to LAT E X

EBESS and MESS Presents: Learn to LaTeX. Presented by Joshua Tambunan 13 February 2018

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

L A TEX 101. John Gardner and Alex Yuffa. May 2, How does L A TEX work? Exercise... 4

Introduction to L A TEX

Useful L A TEX Commands

Helen Cameron. A Brief Overview of LATEX

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

L A TEXday, morning session Discovering L A TEX

Document Preparation Using L A TEX

Part - I : Short Course Typing Text

Research Method and Report Writing Lecture 4: An Introduction to L A TEX

Assessments for CS students:

Outline. A Sneak Peek

Introduction to L A TEX

Typing Mathematics. Darrin Doud

Latex Programs for Record

Introduction to. Research Seminar System Analysis. Florian Kragulj

A L A T E X quick start

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

Introduction to LAT E X

Using L A T E X for scientific writing

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

Introduction to LATEX

GENERAL INFORMATION INSTRUCTIONS FOR MANUSCRIPT SUBMISSION

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

Getting started with Latex

Introduction to L A TEX

Lecture 1. MA2730: Analysis I. Lecture slides for MA2730 Analysis I. Study and Assessment Components. MA L A TEX: topics for Lecture 1

A Brief Introduction to L A TEX

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

Aalborg October 2014

Forschungskolleg / ACSE Exercise 1 - LaTeX

A Demonstration of the L A TEX 2ε Class File for the Oxford University Press Ltd Journal. First Author 1 and Second Author 2.

Academic Skills in Computer Science (ASiCS) II) Text Processing with Latex II.1) Introduction to Latex

Become a L A TEX Guru

How to get started in L A TEX

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

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

Using L A TEX Tom Edgar

MATLAB for the Sciences

Guide to using L A TEX

Student Learning Service: Introduction to Latex

Math 235: Introduction to LaTeX

L A TEX Workshop. An Introduction to L A TEX. Rakesh Jana Research Scholar Department of Mathematics IIT Guwhati

An Interactive Introduction to L A TEX

A Brief Introduction to LaTeX

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

David Helmbold, October 2005, Revised October 2007

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

Transcription:

An Introduction to L A TEX John Hamer John.Hamer@glasgow.ac.uk 24 January 2018

What, how, where? L A TEX is a fine typesetting system. You write your document (paper, report, essay, thesis, poster, book, letter,... ) in the L A TEX format using a text editor. The L A TEX program converts this into PDF. Use the L A TEX format to describe the structure of your document: title, sections and subsections, lists, etc. L A TEX has extensive built-in knowledge on how best to lay things out on the page. It hyphenates words, justifies lines of text, adjusts spacing between paragraphs, etc. Online: www.sharelatex.com (basic version free, but requires registering) MSWindows users can download MikTeX (www.miktex.org). GNU Linux users have TEX Live (http://www.tug.org/texlive). MacOS users have MacTEX (http://www.tug.org/mactex). All are free.

Why? Why not just use MSWord? MSWord is much easier to learn, and some publishers and co-authors insist on MSWord documents. Some publishers and co-authors insist on L A TEX. L A TEX produces better looking output. Longer documents are easier to write in L A TEX: you can move tables and figures around and cross references keep up, L A TEX has great bibliography tools, section numbering just happens. L A TEX is one of the best systems in existence for typesetting mathematics. L A TEX is built on top of TEX one of the most stable and reliable programs every written.

Getting started Run miktex-portable.cmd. Find the the MikTEX icon in the notification area of the Windows Taskbar, and right-click to open TEXworks. Type in the following sample document: \documentclass{article} \begin{document} Hello! This is my first \LaTeX{} document. \end{document} Pay careful attention to the backslash and curly brace characters! Then, press the green arrow.

Things you need to know L A TEX attaches a special meaning to certain characters, in particular: $ used to delimit mathematical formula 1 \ starts a L A TEX command. & separates columns in a table. { and } delimit arguments to a L A TEX command. % start of a comment: L A TEX ignores the rest of the line. a non-breaking space. " use and for double-quotes., ˆ used in mathematical formula. Usually, preceeding the character with a backslash (\) removes the special meaning (but for \ use \textbackslash). 1 Chosen as a joke by Donald Knuth, the author of TEX: typesetters charged more for mathematics!

Document structure A L A TEX document is organised in two parts: a prelude that specifies the type of document, loads any optional packages and other setup actions; and a body that contains the text of the document. The end of the prelude is marked by a \begin{document} line. \documentclass{article}...optional packages and setup actions appear here \begin{document}...the text of the document appears here \end{document} The document must end with a line \end{document}. Anything after this line is ignored.

Sectioning Edit your document to include some sections; e.g. \documentclass{article} \usepackage{lipsum} \title{my First Document} \author{i forgot to put my name here} \date{\today} \begin{document} \maketitle \section{introduction} \lipsum[1-2] \section{background} \lipsum[3-5] \section{conclusions} \lipsum[6] \end{document}

Lists Use the \begin{itemize}, \item and \end{itemize} commands to make a bullet list: \begin{itemize} \item A bullet list. \item Each item starts with \textbackslash item. \end{itemize} \begin{enumerate} \item A numbered list. \item \LaTeX{} does all the numbering. \end{enumerate}

Emphasis, bolding The text style commands take a single argument, enclosed in curly braces immediately after the command name. The \emph command puts text in italics. \textbf puts its argument in bold font. There is also \textsc (Small Caps), \textsl (slanted), \texttt (teletype) and \textnormal. E.g. This paragraph illustrates the use of \emph{emphasis}, \textbf{bold}, \textsl{slanted} and \texttt{fixed width}. Some combinations are \emph{\textbf{available}}, but not \textsc{\emph{all}}.

Changing font size L A TEX generally takes care of the font size for you. If you really need to, the commands to change the text size (in order) are: \tiny, \scriptsize, \footnotesize, \small, \normalsize, \large, \Large, \LARGE, \huge and \Huge. These commands differ from the text style commands by being modal; i.e. they don t take an argument, and text size is changed for all following text in the current block. {\LARGE A curly brace starts a block.} Font size is normal now.

Cross referencing E.g. Sections, figures, formula, etc. can be given mnemonic names ( labels ) that you can use to refer to elsewhere in your document. Define the label using \label{your mnemonic name} Add a reference to the label using \ref{your mnemonic name} \section{introduction}\label{sec:intro}... as discussed in Section~\ref{sec:intro}.

Figures and tables These are floating blocks that may appear in a different place from the surrounding text. Some journals want floats at the end, otherwise there are rules regarding how many floats can appear on one page. Figures and tables require a caption and a label. Figure numbers are generated by L A TEX. \begin{figure} \centering (The actual figure will go here) \caption{my fabulous figure} \label{fig:fabulous} \end{figure}

Image figures L A TEX can include bitmap image files (PNG, JPG, etc.), or vector graphics images (e.g. PDF). Images are kept in separate files, and do not appear directly in the L A TEX source. \documentclass{article} \usepackage{graphicx} \begin{figure} \centering \includegraphics{name-of-my-figure-file.png} \caption{my fabulous figure} \label{fig:fabulous} \end{figure}

Image manipulation You can specify the size you would like the image to be scaled. This is usually done relative to the page size: \includegraphics[width=.8\textwidth] {name-of-my-figure-file.png} Not a general image processing system, but you can rotate, crop the image, etc.

Mathematics The square root of two is typeset $\sqrt{2}$. Try: $\sqrt{a^2 + b^2}$ $\int \zeta^{2}(x) \, dx$ $\lim_{x \to a} \frac{f(x) - f(a)}{x - a}$ and compare with \[ \lim_{x \to a} \frac{f(x) - f(a)}{x - a} \]

Tabular layout Use the tabular environment for tables \begin{tabular}{lr} Name & Email \\ John & john.hamer@glasgow.ac.uk \\... \end{tabular} The {lr} means two columns, the first left-aligned and the second right-aligned. Can add horizontal rules to separate the column headers: \begin{tabular}{lr} \hline \textbf{name} & \textbf{email} \\ \hline John & john.hamer@glasgow.ac.uk \\...\\ \hline \end{tabular}

Spanning columns \multicolumn is used to place text over several columns, or to change the alignment of a particular cell. \begin{tabular}{llr} \multicolumn{2}{c}{\textbf{name}} & \multicolumn{1}{c}{\textbf{email}} \\ \multicolumn{1}{c}{\emph{first}} & \multicolumn{1}{c}{\emph{last}} \\ \hline John & Hamer & john.hamer@glasgow.ac.uk \\... \end{tabular}

Bibliography L A TEX is typically used in combination with a system called BibTEX. BibTEX extracts and formats entries from a database of books and articles. Entries in the database look like: @article{greenwade:tugboat:14.3, author = "George D. Greenwade", title = "The {C}omprehensive {T}ex {A}rchive { year = 1993, journal = {TUGBoat}, volume = 14, number = 3, pages = "342--351" }

The L A TEX side Every BibTEX reference requires a sort name you can refer to in your L A TEX source. E.g. In \cite{greenwade:tugboat:14.3},.... You need to tell L A TEX which referencing style to use; e.g. \bibliographystyle{alpha} And where you d like your bibliography to appear (along with the file containing your references): \bibliography{my-ref-file-name} Run L A TEX once, so it knows which references you have used. Then (separately) run BibTEX, then run L A TEX again.

Formatting a thesis Several L A TEX styles exist; e.g. https://github.com/impleri/glasgow-thesis Download glasgow-thesis.sty Change the document class to report, and load glasgow-thesis: \documentclass[a4paper,12pt]{report} \usepackage{glasgow-thesis} Set the additional required fields for the title page; e.g. \qualifications{m.a, University of Glasgow \\ B.A., University of Glasgow} \degree{doctor of Philosophy} \school{engineering} \college{sciences}

Formatting a thesis (cont.) Change page numbering to roman for the title page and abstract: \pagenumbering{roman} \maketitle \begin{abstract} \lipsum[1-3] \end{abstract} \tableofcontents \clearpage \setcounter{page}{0} \pagenumbering{arabic}

Formatting a thesis (cont.) Since this is now a report (rather than an article), the major sectioning unit is the chapter: \chapter{introduction} \lipsum[4-12] \chapter{background} \lipsum[13-21] \chapter{conclusions} \lipsum[22-25]

Resources www.miktex.org L A TEX for MSWindows www.sharelatex.com L A TEX online https://tobi.oetiker.ch/lshort/lshort.pdf https://www.tug.org/twg/mactex/tutorials/ ltxprimer-1.0.pdf For more on mathematics, see http://tex.loria.fr/general/mil.pdf BibTEX: http://en.wikibooks.org/wiki/latex/ Bibliography_Management The Comprehensive TEX Archive Network, www.ctan.org