a brief introduction to latex - wellington perl mongerswellington.pm.org/archive/200611/abitl.pdfthe...

21
A Brief Introduction to L A T E X Matthew Hunt [email protected] Perl Mongers Wellington November 14, 2006 Matthew Hunt (Perl Monger) A Brief Introduction to L A T E X November 14, 2006 1 / 14

Upload: dangtuyen

Post on 14-May-2018

314 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

A Brief Introduction to LATEX

Matthew Hunt

[email protected] Mongers

Wellington

November 14, 2006

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 1 / 14

Page 2: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

What is it, and why should you care?

LATEX is:

A typesetting system (an extension of TEX written by DonaldKnuth)

Available for a wide variety of systems

A simple way to create documents

Ugly (or so some people will have you believe)

LATEX is not:

HTML, XML, or PDF (but you could use it to produce any of those— with varying degrees of difficulty)

Ugly (really!)

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 2 / 14

Page 3: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

What is it, and why should you care?

LATEX is:

A typesetting system (an extension of TEX written by DonaldKnuth)

Available for a wide variety of systems

A simple way to create documents

Ugly (or so some people will have you believe)

LATEX is not:

HTML, XML, or PDF (but you could use it to produce any of those— with varying degrees of difficulty)

Ugly (really!)

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 2 / 14

Page 4: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

What is it, and why should you care?

LATEX is:

A typesetting system (an extension of TEX written by DonaldKnuth)

Available for a wide variety of systems

A simple way to create documents

Ugly (or so some people will have you believe)

LATEX is not:

HTML, XML, or PDF (but you could use it to produce any of those— with varying degrees of difficulty)

Ugly (really!)

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 2 / 14

Page 5: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

What is it, and why should you care?

LATEX is:

A typesetting system (an extension of TEX written by DonaldKnuth)

Available for a wide variety of systems

A simple way to create documents

Ugly (or so some people will have you believe)

LATEX is not:

HTML, XML, or PDF (but you could use it to produce any of those— with varying degrees of difficulty)

Ugly (really!)

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 2 / 14

Page 6: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

What is it, and why should you care?

LATEX is:

A typesetting system (an extension of TEX written by DonaldKnuth)

Available for a wide variety of systems

A simple way to create documents

Ugly (or so some people will have you believe)

LATEX is not:

HTML, XML, or PDF (but you could use it to produce any of those— with varying degrees of difficulty)

Ugly (really!)

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 2 / 14

Page 7: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

What is it, and why should you care?

LATEX is:

A typesetting system (an extension of TEX written by DonaldKnuth)

Available for a wide variety of systems

A simple way to create documents

Ugly (or so some people will have you believe)

LATEX is not:

HTML, XML, or PDF (but you could use it to produce any of those— with varying degrees of difficulty)

Ugly (really!)

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 2 / 14

Page 8: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

What is it, and why should you care?

LATEX is:

A typesetting system (an extension of TEX written by DonaldKnuth)

Available for a wide variety of systems

A simple way to create documents

Ugly (or so some people will have you believe)

LATEX is not:

HTML, XML, or PDF (but you could use it to produce any of those— with varying degrees of difficulty)

Ugly (really!)

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 2 / 14

Page 9: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

What is it, and why should you care?

LATEX is:

A typesetting system (an extension of TEX written by DonaldKnuth)

Available for a wide variety of systems

A simple way to create documents

Ugly (or so some people will have you believe)

LATEX is not:

HTML, XML, or PDF (but you could use it to produce any of those— with varying degrees of difficulty)

Ugly (really!)

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 2 / 14

Page 10: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

Installing LATEX

Basically you’re on your own:

Installation is outside the scope of this talk

Generally it will be provided as a package forproper operating systems, e.g.,apt-get install tetex-binapt-get install tetex-extra

For others try texlive:http://www.tug.org/texlive/

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 3 / 14

Page 11: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

But LATEX documents are ugly!

Knuth’s Computer Modern fonts aredistinctive, free and an acquired taste

Fortunately it’s really easy to choosesomething else

For example, add this to your file\usepackage[T1]{fontenc}\usepackage{pxfonts}

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 4 / 14

Page 12: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

A basic LATEX document

Example\documentclass[a4paper,12pt]{letter}\usepackage[T1]{fontenc}\usepackage{pxfonts}\begin{document}\address{1 Long Street\\Longwhitecloudland}\signature{Mr Angry Worduser}\begin{letter}{Mr Bill Gates\\ Seattle}\opening{Dear Bill}Word makes me very angry.\closing{Yours irately,}\end{letter}\end{document}

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 5 / 14

Page 13: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

A basic LATEX document

Example\documentclass[a4paper,12pt]{article}\title{Report on important stuff}\author{Matthew Hunt}\date{\today}\begin{document}\maketitle\tableofcontents\section{Why this stuff is important}This stuff is important because:\begin{enumerate}\item It is\end{enumerate}\end{document}

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 6 / 14

Page 14: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

LATEX and Perl

From here it’s a short leap to:

Mail merge

Generating printed reports from yourprograms

Use your imagination

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 7 / 14

Page 15: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

Mapping imagination

-�����:

������

XXXXXXXyCCCCCO

��������

Example\setlength{\unitlength}{0.75mm}\begin{picture}60,40\put30,20{\vector1,0{30}}\put30,20{\vector4,1{20}}\put30,20{\vector1,2{10}}\thicklines\put30,20{\vector−4,1{30}}\put30,20{\vector−1,4{5}}\thinlines\put30,20{\vector−1,−1{5}}\put30,20{\vector−1,−4{5}}\end{picture}\end{figure}

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 8 / 14

Page 16: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

More LATEX

LATEX can do a lot:

But CTAN lets you add even morehttp://ctan.org/

It’s like CPAN, but they thought of it first

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 9 / 14

Page 17: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

The End

Once you get used to the syntax, LATEX is a fineenvironment for creating good lookingdocuments, PDF reports, letters, slideshows likethis one, etc.

And you do get used to the syntax.

But. . .

“Please don’t ask me how it works,or I’ll start to whimper.”

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 10 / 14

Page 18: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

More information

Useful sites with pointers to other sites (there’s a lot of information outthere):

The TEX User’s Group http://www.tug.org/

Cambridge University’s TEX pageshttp://www.eng.cam.ac.uk/help/tpl/textprocessing/

MacTEX — A fully packaged TEX and LATEX distribution forMacOSX http://www.tug.org/mactex/

The Comprehensive TEX Archive Network http://ctan.org/

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 11 / 14

Page 19: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

More information

Some useful guides (generally typeset in LATEX and providing fullsource — a good place to look for ideas on how to do neat tricks):

The Not So Short Introduction To LATEX 2εhttp://www.tug.org/tex-archive/info/lshort/

LATEX Primer from the Indian TEX User Group http://www.eng.cam.ac.uk/help/tpl/textprocessing/ltxprimer-1.0.pdf

Making Friends with LATEXhttp://tug.ctan.org/tex-archive/info/MFwL/

The LATEX Wikibook http://en.wikibooks.org/wiki/LaTeX

LATEX for Beginnershttp://www-lmmb.ncifcrf.gov/~toms/latexforbeginners.html

And many, many others

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 12 / 14

Page 20: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

More information

Perl Stuff:

Template::Latex – Latex support for the Template Toolkithttp://search.cpan.org/~andrewf/Template-Latex-2.17/

LaTeX::Parser - Perl extension to parse LaTeX fileshttp://search.cpan.org/~svenh/LaTeX-Parser-0.01/

LATEX::TOM — LaTeX :: TeX Object Model, a perl modulehttp://br.endernet.org/~akrowne/elaine/latex_tom/

ltxtemplate — A Perl script to create LATEX templateshttp://theoval.cmp.uea.ac.uk/~nlct/latex/apps/ltxtemplate/

ltxtemplate-man.html

latex2html — A Perl script that converts LATEX documents to HTMLhttp://www.latex2html.org/

Search CPAN for “latex” and “tex” to find more good stuff

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 13 / 14

Page 21: A Brief Introduction to LaTeX - Wellington Perl Mongerswellington.pm.org/archive/200611/abitl.pdfThe LATEX Wikibook ... Latex – Latex support ... A Brief Introduction to LaTeX Author:

More information

GUIs – if you ever tire of editing LATEX by hand in v i:

LyX — The Document Processor http://www.lyx.org/

Kile — an integrated LATEX environmenthttp://kile.sourceforge.net/

Matthew Hunt (Perl Monger) A Brief Introduction to LATEX November 14, 2006 14 / 14