LaTeX Course (2011)

LaTeX for Psychological Researchers

In november 2011 I have given a short course on using LaTeX for psychological researchers, which included the following subjects:

  • how to obtain a LaTeX distribution
  • How to use LaTeX to write professional scientific reports
  • How to use the apa document class to produce articles in APA-style
  • How to use BibTeX and apacite to easily add references from google scholar and completely automate the reference list
  • How to use Beamer to produce presentation slides
  • How to use Sweave to incorperate R codes in your LaTeX document to keep your analyses reproducible

On this page are all the slides and examples used in the course as well as a lot of additional links to other online resources.

Materials

Lecture 1: Introduction

Lecture 2: Basics of the LaTeX language

Here is a small .tex file to play around with that contains most of the codes discussed in the slides:

Lecture 3: bibTeX, APA style and beamer

Note, very recently the apa6 package is released. This replaces the apa package (which is no longer supported) and supports the 6th version of the APA manual. For more details:

Example apacite:

Some useful links:

Lecture 4: Reproducible research using Sweave

Here is some extra material:

‘swst’ package:

This is the package I made to facilitate reporting statistics in Sweave. If a class is not yet supported please mail me or implement it yourself on GitHub.

LaTeX Distributions

I recommend the following LaTeX distributions.

LaTeX editors

LaTeX documents can be edited with any plain text editor. Some of these editors are specifically aimed at the LaTeX language while others are aimed at any programming language.

A good editor for LaTeX has at least:

  1. A customizable shortcut for compiling documents
  2. Line numbers
  3. Syntax highlighting

What editor you want depends on your needs and experience.

TeXworks

TeXworks is a very basic LaTeX editor. It does the above three things and not much else. It is a very stable editor and usually comes together with a LaTeX distribution.

It can be downloaded from:

http://www.tug.org/texworks/

Recommended for learning the basics of LaTeX. A benefit is that it also comes with the portable MikTeX distribution for editing LaTeX documents wherever you are. Another benefit of TeXworks is that it can be used on Windows, Mac and Linux.

TeXnicCenter

A solid LaTeX editor that comes with a menu with a lot of shortcuts to command. Works somewhat similar to WYSIWYG editors like MS word, LibreOffice or OpenOffice.org in that you can select text and press a button to apply something to that text (the proper code is added into the document).

It is only available on Windows, and can be downloaded from:

http://www.texniccenter.org/

The default options seem to have compatibility problems with Adobe Reader 10, to solve these see this link:

http://www.agmonim.com/2010/12/texniccenter-and-adobe-reader-10-x/

TeXnicCenter is highly recommended for beginners in LaTeX since it has a familiar interface.

TeXmaker

A crossplatform LaTeX editor similar to TeXnicCenter. Has less options but a cleaner interface. Is very clear in reporting errors. It can be downloaded from:

http://www.xm1math.net/texmaker/

Notepad++

A very light-weight plain text editor for Windows. You probably want to have this installed in case you ever need a plain text editor to do anything (and seriously, notepad is not a good alternative). Has LaTeX syntax highlighting and line numbers, I am not sure about a compile shortcut.

http://notepad-plus-plus.org/

Emacs + AucTeX

A very sophisticated cross platform plain text editor that is used by many programmers to do everything they want. Is considered an IDE (interactive development environment) in that it can run programs such as R (through ESS). Some even consider it a operating system

Emacs is hard to learn but well worth it if you have to work much in plain text editors. It can be downloaded from:

http://www.gnu.org/s/emacs/

Contact me for more details.

Vim

Another sophisticated cross platform editor that is used by many programmers. I don’t have experience with it but I am sure it has excellent LaTeX support. It can be downloaded here:

http://www.vim.org/

Gedit

The official Gnome text editor. Use the External Tools plugin to create command line shortcuts for LaTeX.

http://projects.gnome.org/gedit/

LyX

Do you like LaTeX but miss seeing your end result as you would in a WYSIWYG editor? Then maybe LyX is for you! It can be used to edit LaTeX documents in a WYSIWYG editor. Has native Sweave support as well.

Templates

Additional Links

Free books:

The stackoverflow site dedicated to TeX, has an active community of helpfull people waiting to answer your questions:

Comments are closed.