Absolute L A TEX Beginner

Similar documents
1 Obtaining LyX and L A TEX

How To Get Your Word Document. Ready For Your Editor

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

COMP496/901: Academic Presentation and Writing Skills Using LaTeX

Guide to using L A TEX

Latex Tutorial. CIS400 Senior Design 9/5/2013

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

Mikkel Madsen

Introduction to Scientific Typesetting Lesson 1: Getting Started

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

Math 235: Introduction to LaTeX

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

Introduction to L A TEX

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

Guide on Using UnimasThesis

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

Introduzione a LaTex. Fabrizio Messina

Introduction to LAT E X

Pimp your thesis: a minimal introduction to L A T E X.

Introduction to L A TEX

A Short L A TEX Introduction

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

Introduction to LAT E X

Square cells: an array cooking lesson

Getting Started with L A TEX

Getting to Grips with L A T E X. Andrew Roberts

Printing Envelopes in Microsoft Word

Introduction to LATEX

On the Web sun.com/aboutsun/comm_invest STAROFFICE 8 DRAW

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

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.

Kindle Formatting Guide

Introduction to Scientific Typesetting Lesson 5: The Structure of a Document

Helen Cameron. A Brief Overview of LATEX

Getting started with Latex

Lab1: Communicating science

L A TEX Gotchas - Common Pitfalls and Debugging

HOW TO UTILIZE MICROSOFT WORD TO CREATE A CLICKABLE ADOBE PORTABLE DOCUMENT FORMAT (PDF)

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

Lecture 1: Short summary of LaTeX basics

Copyright. For more information, please read the Disclosures and Disclaimers section at the end of this ebook. First PDF Edition, February 2013

L A TEX for psychological researchers

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

CHAPTER 1 COPYRIGHTED MATERIAL. Finding Your Way in the Inventor Interface

Make an ebook in an Afternoon

Imagery International website manual

Before you begin, make sure you have the images for these exercises saved in the location where you intend to create the Nuklear Family Website.

LaTeX. Information Literacy II EN(IL2) Course

TekTalk Word 2007 Notes

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

How To Upload Your Newsletter

Teach Yourself Microsoft Word Topic 12 - Multipage Document Features Part 1

Moving from FrameMaker to Blaze: Best Practices

How to Make a Book Interior File

A Short Guide To Preparing Your Files for ebookit.com s Free epub Conversion Service

PowerPoint Basics: Create a Photo Slide Show

Taskbar: Working with Several Windows at Once

The smarter, faster guide to Microsoft Outlook

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

Part II: Creating Visio Drawings

Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields.

Using Tab Stops in Microsoft Word

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

Using Mail Merge in Microsoft Word 2003

L A TEX for Philosophers

A Step-by-Step Guide to getting started with Hot Potatoes

Basic L A TEX. what is LaTeX?

Unit 21 - Creating a Navigation Bar in Macromedia Fireworks

Document Formatting with Word

This book is about using Visual Basic for Applications (VBA), which is a

Burning CDs in Windows XP

Word: Print Address Labels Using Mail Merge

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

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

T E X and L A T E X Document preparation tools

Introduction to Latex. A workshop by Dr. Ala Eshmawi

Introduction to L A TEX

Course Exercises for the Content Management System. Grazyna Whalley, Laurence Cornford June 2014 AP-CMS2.0. University of Sheffield

Chapter 5: Character and Paragraph Formatting in MS Word

Using Dreamweaver CS6

Paul Gartside. March 2, 2013

TeXnicCenter v1 Beta Frank Van Puyvlde ICT for Research K.U.Leuven

Karlen Communications Track Changes and Comments in Word. Karen McCall, M.Ed.

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

Animation and style sheets

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

The Quickstart Guide to Preparing Your USM Thesis with L A T E X

CSCM10 Research Methodology A Taster of L A TEX

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

My Mathematical Thesis

1 Installation (briefly)

Adding content to your Blackboard 9.1 class

Formatting with LaTeX

OPEN THE HOTLINE CLIENT

Introduction, Notepad++, File Structure, 9 Tags, Hyperlinks 1

Using Mail Merge in Microsoft Word XP/2002

Acadia Psychology Thesis Template Guide

CSS Crash Course for Fearless Bloggers by Gill Andrews

How to Prepare a Digital Edition PDF Book With Microsoft Word

How to Export Your Book as epub and Mobi file formats with Microsoft Word and Calibre

Transcription:

Latest version of this document at http://liantze.googlepages.com/latextypesetting#beginner Absolute L A TEX Beginner Lim Lian Tze liantze@gmail.com Abstract Most people use the ubiquitous Word TM for preparing text documents in the WYSIWYG tradition. L A TEX is a document typesetting system that produces professional-looking documents while letting the author focus on the overall document structure. With L A TEX, you concentrate more on what you want to write, not how you want to format it 1. Read this article for your first encounter with the typesetting platform of choice in the scientific publishing community... 1 Interested in L A TEX? So you ve heard about LATEX. Perhaps you ve heard about how easy it is to produce beautiful, professional-looking documents with LATEX, or how difficult it is to learn, or a dozen other varying opinions about it. In short, you ve read a couple of (or more) articles passionately singing the praises of LATEX or cursing it. Chances are you re wondering: should I or shouldn t I learn more about this LATEX? Well wonder no more, because it isn t that difficult to quickly try out LATEX to see if it s worth your time. So let s roll up our sleeves and typeset our first LATEX document! 1 Well, yes, someone has to worry about it, but it shouldn t be you: you, the author, should concentrate on writing and organising the content, not making it look good. The someone who should worry about that should provide a LATEX formatting style file to you, not continually harassing you about it. 1

1.1 Installation To start with, you will need a LATEX distribution on your computer. LATEX is free software; this means it can be used, copied, studied, modified and redistributed with minimal restrictions. It is also free-of-charge. If you are using a GNU/Linux machine, chances are that a LATEX distribution is already included with your GNU/Linux installation. If you are on a Windows platform, I would recommend the ProTEXt distribution for its easy installation procedures. You might want to refer to our LATEX installation guide at http://liantze.googlepages.com/latextypesetting# latexwin for the instructions. 1.2 Editor Tools Preparing a LATEX document is as simple as creating a plain text file with specialised markups. This means any plain text editor can be used to edit the file: Notepad, vi, emacs. But just as some people prefer more convenient IDEs to Notepad for editing C++ source code, there are editor environments that streamlines the creation of LATEX documents. I ll be using screenshots of TeXnicCenter, a tool for the Windows platform (included in ProTEXt), to illustrate the flow of preparing LATEX documents in this article. For those who prefer a plain text editor and the command-line, I will also show the commands to issue where necessary. 2 In the Beginning there was the Document We ll first create a LATEX article document with a minimal structure. It ll have a title and author name, 2 sections and 1 subsection. Using TeXnicCenter or your text editor of choice, create a new file and type in the contents of Listing 1. Listing 1: A Minimal L A TEX Article 1 \documentclass[a4paper,11pt]{article} 2 3 \title{my First Document} 4 \author{john Doe} 5 6 \begin{document} 7 8 \maketitle 2

9 \tableofcontents 10 11 \section{introduction} 12 This is the introduction. 13 14 \section{main Text} 15 My first \LaTeX{} document! Isn't it exciting? 16 17 \subsection{more Details to Come} 18 This is just the beginning. There are lots of things you can achieve with \LaTeX{}, and I hope to write about them as much as I can. So much to do, so little time\ldots 19 20 Watch this space. 21 22 \end{document} Save the file once you re done typing. Give it a name like first.tex. It s a good idea to treat your LATEX documents as projects: I usually create individual folders (Fig. 1) to hold a LATEX source file (the.tex) and related files, such as bibliography lists and graphics. If you are using TeXnicCenter, I also recommend that you create a new project with first.tex as the main file. To do this, first make sure first.tex is open and active in TeXnicCenter. Then select from the menu Project Create with active le as main le (Fig. 2). Select English as the language to use, and click OK. The Navigator pane should now be visible on the left of your screen, showing the internal structure of first.tex. 2.1 Building the PDF Output We are now ready to build the PDF output from the LATEX file just created. If you re using TeXnicCenter, select the LaTeX => PDF output profile (Fig. 3 red circle 1). Then click on the Build and view output button (Fig. 3 red circle 2). If you made no typos in first.tex, and if you have a PDF viewer installed, you should see the output first.pdf displayed after a short 2 while. You may notice, though, that the table of contents doesn t seem to 2 and agonising? No, surely it s not that bad! 3

Figure 1: Saving your first L A TEX document in TeXnicCenter be complete. Click on again, and you should see the final PDF output something similar to Fig. 4. (If, at this point, TeXnicCenter reports an error about not being able to write to output file and you are using Acrobat Reader as your default PDF viewer, please follow the instructions in section 3.1, step 12 of our installation guide 3 before trying again.) On the other hand, if you prefer to use the command-line to build your output (especially if you re using GNU/Linux), fire up a console, change to the path where first.tex is stored, and issue the following command: pdflatex first.tex You may then view the result, first.pdf in a PDF viewer. Again, you may notice that the table of contents is incomplete. Re-run pdflatex, and refresh the PDF file in your PDF viewer. You should then see something similar to Fig. 4. 3 http://liantze.googlepages.com/latextypesetting#latexwin 4

Figure 2: Creating a projecyt Figure 3: Building L A TEX PDF output with TeXnicCenter There! There s your LATEX PDF output in all its glory. Now that you ve achieved your mission of giving LATEX a try, it s mission accomplished; but if you re interested in knowing which bits did what, read on... 2.2 Wow. Tell Me How That Worked. 2.2.1 We Do It with Special Mark-ups... What you have done was to define the structure of a document using special mark-ups. One type of mark-up is the command, which looks like this: \cmdname{argument} Some commands take multiple arguments, while others don t need any. For example: \ldots{} produces the ellipses (... ) symbol, \LaTeX{} produces the LATEX symbol, 5

My First Document John Doe February 3, 2007 Contents 1 Introduction 1 2 Main Text 1 2.1 More Details to Come.................. 1 1 Introduction This is the introduction. 2 Main Text My first L A TEX document! Isn t it exciting? 2.1 More Details to Come This is just the beginning. There are lots of things you can achieve with L A TEX, and I hope to write about them as much as I can. So much to do, so little time... Watch this space. 1 Figure 4: PDF Output from first.tex (text and paper size not to scale) \section{introduction} signals that you are beginning a new section titled Introduction. You can pass options to some commands, too: \cmdname[opt1, opt2]{argument} So if someone tells you to Use the \footnote command with TODO as the argument, and 4 as the option, this is what you d write: 6

\footnote[4]{todo} There is another type of special mark-up called environments. When you use one of these, you have to specify where it begins and ends. For example, when some text is surrounded by the center environment, it will be centre-justified: \begin{center}...some contents... \end{center} 2.2.2... and Now, Back to Our Document. A LATEX document, like the one that you just created, is made up of a document preamble and the document body. The document body is where you write your actual content, and is surrounded by \begin{document} and \end{document}. (Bingo, that s a LATEX environment.) Everything before that (i.e. lines 1 4 in Listing 1, in blue colour) is the preamble. 2.2.3 The Preamble It s where you define various settings (if any) for your overall document. What settings, you ask? Well, we started off with the document class declaration, the paper size and default font size, as described a little earlier. All LATEX documents start with a \documentclass{class } declaration. (Yep, that s a LATEX command.) We declared our first document to be an article, of which the highest division is the section: \documentclass[a4paper,11pt]{article} Other common document classes include report and book, both of which provide chapter as the highest division. We also passed the a4paper and 11pt options to the article class, so that the output would be typeset using 11-point size fonts and on A4-sized papers. We also set the title and author of the document: \title{my First Document} \author{john Doe} The preamble is also where extra packages are loaded to provide extra or special functionalities. Let s say you want to include JPEG, PNG and/or PDF graphics in your document. Ask a LATEX expert how this can be done, 7

and the first thing (s)he will probably tell you is to load the graphicx package. LATEXpackages are loaded with the \usepackage command, like so: \usepackage{graphicx} 2.2.4 The Document Body The document body is where your actual content goes. There are a few nifty commands that will automatically generate some contents for you. For instance, if you ve specified details such as the title and order of your document, the \maketitle command will... well, does what it says: make the title. ;-) Another useful command is \tableofcontents, which generates the table of contents. If you make changes to your document and the page numbers change, simply compile it again with pdflatex, and the TOC will be updated automatically. Just keep in mind that sometimes you may need to run pdflatex twice before the changes take effect. As you may have noticed, you can divide and organise your document contents with sectioning commands like \section and \subsection. LATEX and friends automatically number the sectioning headings, as well as creating entries for them in the table of contents. In fact, if you load the hyperref package and run pdflatex (try it!), you ll get a PDF document with bookmarks made out of your section headings! The default sectioning commands are (in order of hierarchy): \part (only available in report and book document classes) \chapter (only available in report and book document classes) \section \subsection \subsubsection There is no \subsubsubsection. According to LATEX wisdom, you don t need it: deep hierarchies are baaaaad. If you think do, you probably need to reorganise your content. If you absolutely insist, you can settle for \paragraph, which will not be numbered, nor will it make it into the table of contents. 8

Another thing to notice is the use of blank lines to indicate paragraph breaks. In LATEX, new lines alone won t get you new paragraphs, and multiple blank lines won t get you any wider gaps between your paragraphs. In the same way, multiple space characters and tabs will just render as a single space. In other words, the two code snippets below will both come out the same way in the PDF. 1 This is just the beginning. There are lots of things you can achieve with \LaTeX{}, and I hope to write about them as much as I can. So much to do, so little time\ldots 2 3 Watch this space. 1 This is just the beginning. There are lots 2 of things you can achieve with \LaTeX{}, and I hope to write about them as much as I can. 3 So much to do, so little time\ldots 4 5 6 Watch this space. If you think that s weird, remember that the philosophy behind LATEX is that you should care about your contents and organisation ( I think I d better break this paragraph here ) more than how they are laid out exactly ( I think I want 8pt inter-paragraph spacing after all ). In addition, LATEX takes the whole spacing business very seriously. It uses a lot of calculations to decide how much space to put between the letters, the words, the paragraphs... so that the end result is aesthetically pleasing to the reader s eye. In other words, it s not going to flinch at the extra space characters and blank lines in your input. 3 That s It! Go Forth and L A TEX! That was a very cursory introduction to LATEX: I have barely scratched the surface of what LATEX is truly capable of. But I hope you had at least a first feel about using LATEX. Don t be afraid to continue to explore further on your own, with the help of a world-wide LATEX community. To get you started, here are some useful links (amongst myriads oth- 9

ers): Getting to Grips with LATEX(online tutorial by Andrew Roberts): http://www.andy-roberts.net/misc/latex/index.html LaTeX Wikibook: http://en.wikibooks.org/wiki/latex My own LATEX bag-of-links: http://liantze.googlepages.com/latextypesetting Online LATEX Previewer (uses Flash): http://www.sciencesoft.at/flashlatex.jsp?lang=en Have Fun with L A TEX! 10