Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized...

30
Introduction to typesetting with L A T E X Tips and Tools for Writing a Bachelor/Master Thesis Hein Meling [email protected] November 4th 2015 Hein Meling (Univ. of Stavanger) L A T E X introduction Nov. 2015 1 / 18

Transcript of Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized...

Page 1: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Introduction to typesetting with LATEXTips and Tools for Writing a Bachelor/Master Thesis

Hein Meling

[email protected]

November 4th 2015

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 1 / 18

Page 2: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Outline

MotivationEditors and ToolsSome Simple ExamplesDIY: Installation and Get Started

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 2 / 18

Page 3: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation

Formatting your bachelor/master thesis nicely matters!

But, I already know how to use Word.Why are you making me learn another (set of) tools??Are you sure you really know how to use Word?Properly?

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 3 / 18

Page 4: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation

Formatting your bachelor/master thesis nicely matters!But, I already know how to use Word.Why are you making me learn another (set of) tools??

Are you sure you really know how to use Word?Properly?

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 3 / 18

Page 5: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation

Formatting your bachelor/master thesis nicely matters!But, I already know how to use Word.Why are you making me learn another (set of) tools??Are you sure you really know how to use Word?

Properly?

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 3 / 18

Page 6: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation

Formatting your bachelor/master thesis nicely matters!But, I already know how to use Word.Why are you making me learn another (set of) tools??Are you sure you really know how to use Word?Properly?

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 3 / 18

Page 7: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation: What’s wrong with Word?

Word allows you to do too much too easily.

Temptation to hack it together is greater.Too easy to change text styles, e.g. the font and font size.Difficult to use styles consistently; too easy to change in just oneplace.Can become unstable when working with large documents.Need to handle table of contents and references yourself.Too easy to copy and paste images from screenshots.Code listings should never be graphics.Figures should use vector graphics, not raster graphics.And of course, math symbols does not look so nice.

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 4 / 18

Page 8: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation: What’s wrong with Word?

Word allows you to do too much too easily.Temptation to hack it together is greater.

Too easy to change text styles, e.g. the font and font size.Difficult to use styles consistently; too easy to change in just oneplace.Can become unstable when working with large documents.Need to handle table of contents and references yourself.Too easy to copy and paste images from screenshots.Code listings should never be graphics.Figures should use vector graphics, not raster graphics.And of course, math symbols does not look so nice.

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 4 / 18

Page 9: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation: What’s wrong with Word?

Word allows you to do too much too easily.Temptation to hack it together is greater.Too easy to change text styles, e.g. the font and font size.

Difficult to use styles consistently; too easy to change in just oneplace.Can become unstable when working with large documents.Need to handle table of contents and references yourself.Too easy to copy and paste images from screenshots.Code listings should never be graphics.Figures should use vector graphics, not raster graphics.And of course, math symbols does not look so nice.

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 4 / 18

Page 10: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation: What’s wrong with Word?

Word allows you to do too much too easily.Temptation to hack it together is greater.Too easy to change text styles, e.g. the font and font size.Difficult to use styles consistently; too easy to change in just oneplace.

Can become unstable when working with large documents.Need to handle table of contents and references yourself.Too easy to copy and paste images from screenshots.Code listings should never be graphics.Figures should use vector graphics, not raster graphics.And of course, math symbols does not look so nice.

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 4 / 18

Page 11: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation: What’s wrong with Word?

Word allows you to do too much too easily.Temptation to hack it together is greater.Too easy to change text styles, e.g. the font and font size.Difficult to use styles consistently; too easy to change in just oneplace.Can become unstable when working with large documents.

Need to handle table of contents and references yourself.Too easy to copy and paste images from screenshots.Code listings should never be graphics.Figures should use vector graphics, not raster graphics.And of course, math symbols does not look so nice.

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 4 / 18

Page 12: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation: What’s wrong with Word?

Word allows you to do too much too easily.Temptation to hack it together is greater.Too easy to change text styles, e.g. the font and font size.Difficult to use styles consistently; too easy to change in just oneplace.Can become unstable when working with large documents.Need to handle table of contents and references yourself.

Too easy to copy and paste images from screenshots.Code listings should never be graphics.Figures should use vector graphics, not raster graphics.And of course, math symbols does not look so nice.

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 4 / 18

Page 13: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation: What’s wrong with Word?

Word allows you to do too much too easily.Temptation to hack it together is greater.Too easy to change text styles, e.g. the font and font size.Difficult to use styles consistently; too easy to change in just oneplace.Can become unstable when working with large documents.Need to handle table of contents and references yourself.Too easy to copy and paste images from screenshots.

Code listings should never be graphics.Figures should use vector graphics, not raster graphics.And of course, math symbols does not look so nice.

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 4 / 18

Page 14: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation: What’s wrong with Word?

Word allows you to do too much too easily.Temptation to hack it together is greater.Too easy to change text styles, e.g. the font and font size.Difficult to use styles consistently; too easy to change in just oneplace.Can become unstable when working with large documents.Need to handle table of contents and references yourself.Too easy to copy and paste images from screenshots.Code listings should never be graphics.

Figures should use vector graphics, not raster graphics.And of course, math symbols does not look so nice.

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 4 / 18

Page 15: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation: What’s wrong with Word?

Word allows you to do too much too easily.Temptation to hack it together is greater.Too easy to change text styles, e.g. the font and font size.Difficult to use styles consistently; too easy to change in just oneplace.Can become unstable when working with large documents.Need to handle table of contents and references yourself.Too easy to copy and paste images from screenshots.Code listings should never be graphics.Figures should use vector graphics, not raster graphics.

And of course, math symbols does not look so nice.

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 4 / 18

Page 16: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Motivation: What’s wrong with Word?

Word allows you to do too much too easily.Temptation to hack it together is greater.Too easy to change text styles, e.g. the font and font size.Difficult to use styles consistently; too easy to change in just oneplace.Can become unstable when working with large documents.Need to handle table of contents and references yourself.Too easy to copy and paste images from screenshots.Code listings should never be graphics.Figures should use vector graphics, not raster graphics.And of course, math symbols does not look so nice.

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 4 / 18

Page 17: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 5 / 18

Page 18: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Two Examples of bad ThesisFormatting!

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 6 / 18

Page 19: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 7 / 18

Page 20: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

One Example of Good ThesisFormatting!

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 8 / 18

Page 21: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

TEX and LATEX: Two famous computer scientists

Donald KnuthInvented TEXThe art of computer programmingTuring Award winner 1974

Leslie LamportInvented LATEX which is a macro layer above TEXAlso famous for inventing the Paxos consensus protocolTuring Award winner 2013

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 9 / 18

Page 22: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Editors

All real editors have support for LATEXTextMate (mac), Emacs, Kile (linux), vim, Notepad++ (win)

Typical features:Syntax highlighting, autocompletion, compile and view document

Specialized editors (some come bundled with tex distro):TeXShop (mac), Texmaker, TeXstudio (Ryen recommends)

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 10 / 18

Page 23: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Editors II

WYSIWYG editors: LyXWeb-based collaborative editors (backed by git):

https://www.sharelatex.comhttps://www.overleaf.com

For a full list see:https://en.wikipedia.org/wiki/Comparison_of_TeX_editors

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 11 / 18

Page 24: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Collaboration Tools

git and https://github.com

Dropbox shared folderTemplates: https://github.com/uis-no/

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 12 / 18

Page 25: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Useful command line tools to know

latex

pdflatex

bibtex

(If you use an editor you probably don’t need these.)

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 13 / 18

Page 26: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Bibliography Tools

BibDesk (mac), Mendeley, PapersManaging your references is important; start earlyEasy to download .bib entries from online databases

IEEE xploreACM DLhttp://dblp.uni-trier.de

For a full list see: https://en.wikipedia.org/wiki/Comparison_of_reference_management_software

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 14 / 18

Page 27: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Online Resources

We will use this:http://www.latex-tutorial.com

This is a useful resource it you have questions:http://tex.stackexchange.com

The Elements of Style:https://www.goodreads.com/ebooks/download/33514?doc=4283

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 15 / 18

Page 28: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 16 / 18

Page 29: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

Do’s and Don’ts!

Avoid footnotes (almost) at all cost.Avoid different spacing between paragraphs.Avoid citations to too many web pages.Use the same font style and size for body text.Don’t overdo bold and italic; only when introducing concept/idea.Math should look like: y = ax + b

Regular text in math mode:

t′i,j =

ti − PreT ime if Pi−1,c = 0 ∧ Pi,c 6= 0 ∧ Cj ∈ A

ti − PostT ime if Pi−1,c 6= 0 ∧ Pi,c = 0 ∧ Cj ∈ A

ti otherwise(1)

Use justified text; it looks better!In general, be consistent!

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 17 / 18

Page 30: Introduction to typesetting with LATEXmeling/papers/LaTeX-Workshop-November2015.pdf · Specialized editors (some come bundled with tex distro): TeXShop (mac), Texmaker, ... Introduction

DIY: Installation and Getting Started

LATEX distributions:TeX Live: https://www.tug.org/texlive/

MacTeX: https://www.tug.org/mactex/

MikTeX: http://miktex.org/

Hein Meling (Univ. of Stavanger) LATEX introduction Nov. 2015 18 / 18