latex crash course

Post on 17-May-2015

976 Views

Category:

Education

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Reproducible research with LATEX + R(for PhD students)

Tomislav Hengl

ISRIC — World Soil Information, Wageningen University

In Wageningen, 26 September 2013

Outline I

Important pointsDisclaimerThe programmeReproducible research is beautiful!Software in useWeb-services of interest

What is TEX?TEX philosophyWhat is LATEX?

LATEX versus MS WordComparisonLiterature

In Wageningen, 26 September 2013

What you need to know about me

I I am not really familiar with TEX programming (I neverdeveloped any LATEX package).

I LATEX has a steep learning curve.

I I also still use Google docs and MS Word (e.g.to write shortdocuments).

I LATEX comes (as any GNU) without any warranty.

In Wageningen, 26 September 2013

The course programme (1)

Block 1 (2 hours)

I Introduction to TEX (philosophy, history).

I Installation of software and first steps.

I Common LATEX commands (graphics, tables, BibTEX, math).

I Generate your first document with LATEX.

In Wageningen, 26 September 2013

The course programme (2)

Block 2 (2 hours)

I Collaborative writing using LATEX— the DropBox approach.

I Collaborative writing using LATEXon-line LATEXeditors(ShareLaTeX, LaTeXLab)

I Finding the right template for a PhD thesis

I Writing a PhD thesis with LATEX(tips and tricks).

In Wageningen, 26 September 2013

The course programme (3)

Block 3 (2 hours)

I Reproducible research — why? how? where?

I Combining R and LATEXcode -> Sweave.

I Preparing presentations using the Beamer package.

I Converting LATEXdocs to MS Word and HTML.

In Wageningen, 26 September 2013

What is reproducible research?1

Ideally, each paper submitted for publication that contains sometype of statistical analysis or summaries of results should allow forchecking / validation.Anybody should be able to reproduce your results. . . of course —this is one of the main principles of science! But most of thearticles you find (>95%) do not satisfy the reproducibility principle!Science is still largely based on trust and authorities.

1https://en.wikipedia.org/wiki/Reproducibility

In Wageningen, 26 September 2013

Kligl & Bates (2011)

In Wageningen, 26 September 2013

Reproducible research is beautiful!

In Wageningen, 26 September 2013

Another example: JSS

In Wageningen, 26 September 2013

See also: UG4A

In Wageningen, 26 September 2013

Another leitmotif of this course: collaboration

I The best papers are the ones written through creative teamwork — creative brainstorming and discussion!

I But how to collaborate on LATEXdocuments?

I And how to monitor progress? (or “who do I turn ontrack-changes in LATEX?!”)

In Wageningen, 26 September 2013

Software

You should have installed these already!

I MikTEX (LATEX engine);

I WinEdt (TEX editor);I (recommended) a number of WinEdt plugins:

I JabRef — references editor;I BibTEX menu — WinEdt menu for references;I MathType — Equation editor;I R-Sweave — full WinEdt–R integration;

I optional: Scientific Word — the commercial programme forproducing LATEX documents under Windows; word2tex — ashareware programme that converts MS WORD documents toLATEX.

In Wageningen, 26 September 2013

Websites (on-line services)

You can make an account and test things out

I On-line TEXeditor: https://www.sharelatex.com;

I Shared documents: http://DropBox.com;

I Annotation of PDF docs: http://a.nnotate.com;

I On-line equation editors;

In Wageningen, 26 September 2013

TEX history I

I In 1978, Donald Knuth (one of the most famous and wellrespected computer scientists) embarked on a project tocreate a typesetting system, called TEX (pronounced ‘tech’),after being disappointed with the quality of his acclaimed TheArt of Programming series.

I TEXis an abbreviation of τεχνη (TEXNH — techne), Greekfor both “art” and “craft”, which is also the root word of‘technical’2.

I Around 10 years later, he froze the language after originallyanticipating spending a single year!

In Wageningen, 26 September 2013

TEX history III In the mid-80s Leslie Lamport created a set of macros that

abstracted away many of the complexities (this allowed for asimpler approach for creating documents, where content andstyle were separate). This extension became LATEX(pronounced ‘lay-tech’);

I MiKTEX (pronounced ‘mick-tech’) is an up-to-dateimplementation of TEX and related programs for Windows.

2https://en.wikipedia.org/wiki/TeX

In Wageningen, 26 September 2013

LATEXis not latex!

6=

In Wageningen, 26 September 2013

TEX philosophy

Donald Knuth designed TEXwith two main goals in mind:

1. (perfectionism) to allow anybody to produce high-qualitybooks using a reasonably minimal amount of effort, and

2. (continuity) to provide a system that would give exactly thesame results on all computers, now and in the future.

The creator “offers monetary awards to people who find and reporta bug in TEX. The award per bug started at $2.56 (one‘hexadecimal dollar’) and doubled every year until it was frozen atits current value of $327.68. . . recipients have been known toframe their check as proof that they found a bug in TEXrather thancashing it.”

In Wageningen, 26 September 2013

What is LATEX?

I essentially a markup language;

I analogous to HTML with CSS;

I programming environment with many contributed packagesand styles;

I renders the content into a document (PDF);

I the code must be error-free from the beginning till the end!otherwise you do not see any PDF.

In Wageningen, 26 September 2013

Who is it for?

I Anybody writing anything maths related will not find a richerand better quality system.

I Anybody planning to write research articles, PhD or MScthesis and make professional and stable overheads;

I If you are in academia, you really ought to be using it!

I Even WikiPedia uses LATEX for rendering any formulas thatappear on their site.

I See also: “LATEX isn’t for everyone but it could be for you” byAndy Roberts.

In Wageningen, 26 September 2013

Why TEX?

I . . . portability, lightness, security;

I it is easier than XML (and has less bugs);

I it is for free

I it is one of the most sophisticated digital typographicalsystems in the world (MS Word is not a press software!);

I You can get LATEX to do just about anything you can think of!(it’s just a question of time / effort)

In Wageningen, 26 September 2013

TEX saves time

I focus on content, let LATEX bother about the layout;

I the software takes care of the actual typesetting, structuring,numbering, referencing and cross-referencing, indexing andpage formatting;

I compile documents in PDF (export to HTML, RTF);

I hyphenation, typesetting, fine-tuned control;

In Wageningen, 26 September 2013

LATEX versus MS Word

MS Word

I WYSIWYG world;

I XML;

I nonstandard styles;

I not-suited for large(collaborative)documents;

I compatibility problems(MS Word 97, 2000, XP,2003, 2007);

LATEX

I code world;

I TEX language;

I standard styles;

I suited for largecollaborative documents;

I the syntax staid the sameever since the beginning!

. . .and the winner is. . .

In Wageningen, 26 September 2013

MS Word

MS Word does in fact have a similar Styles feature (but peopledon’t often know it exists).Microsoft has a software to prepare documents for press —Microsoft Office Publisher, but even this can not be compared withe.g.Adobe InDesign (do you have money to use this software?)

In Wageningen, 26 September 2013

TEX versus MS Word3

3http://www.pinteric.com/miktex.html

In Wageningen, 26 September 2013

TEX versus MS Word

Andy Roberts’ Laws on Word:

1. Likelihood of a crash is directly proportional to the importanceof a document.

2. Likelihood of a crash is inversely proportional to the time leftbefore its deadline.

3. Likelihood of a crash is directly proportional to the durationsince you last saved.

4. Likelihood of you throwing your computer out of the windowis directly proportional to the number of times Clippy pops up.

5. That’s enough laws for now. . .

See also: “LATEX vs.MS Word”

In Wageningen, 26 September 2013

Literature

Lamport, L., 1994. LATEX: A Document Preparation System.Addison-Wesley, 291 p.

Oetiker, T. 2008. The (Not So) Short Introduction to LATEX2e.self-published, 155 p.

Talbot, N.L.C. 2013. Using LaTeX to Write a PhD Thesis,Dickimaw LATEXSeries

LATEX on wikibooks.http://en.wikibooks.org/wiki/LaTeX

In Wageningen, 26 September 2013

Layout galleries

I The TEX showcase;

I Page and chapter headings by Vincent Zoonekynd;

I LATEX font catalogue;

I Text Processing using LATEX by University of Cambridge

I Copernicus publications (HESS);

In Wageningen, 26 September 2013

LATEX to HTML/KML

I convert your LATEX document to HTML (install TtH);

I install some KML editor (or use WinEdt);

I Put the slides as HTML in the description field;

I to get some idea what you can do with KML, look at theKML interactive sampler and/or Google Earth Outreach;

I You can also convert from LATEX document to Wiki (e.g.usingthis Python script);

In Wageningen, 26 September 2013

top related