You likely want to customize your paper in some way or other. At the very least, you’ll need to double-space it to submit it to a journal or conference. But you also might want to use a different font, use some fancy math or logic symbols, add a custom header or footer, or change the margins of your paper. In this document, I’ll tell you enough that you’ll be able to do each of those things to some degree or other (LaTeX is complicated; I don’t claim to be comprehensive here).
Note: I am going to talk about using various packages in this document. I am pretty sure that most of these are included in a standard TeX distribution. If you don’t have one of these packages, either use your package manager (TeX Live Utility for the Mac; I think that MikTeX might actually download packages you need on the fly, i.e., if you specify a package in the prologue that you do not have installed, MikTeX will install it without you doing anything), or search for the package at CTAN and follow the directions to install it.
There are three main options for double-spacing your paper.
The first is to use the setspace package. Anytime you ‘use the X package’, for any package X, you do so by adding it in your prologue via a \usepackage{} command, perhaps with some additional arguments, and perhaps with some additions to the body of the document. To use the setspace package you need to do two things:
\usepackage{setspace} to your prologue.\doublespace at the start of your document (likely after \maketitle).If you want to single-space the bibliography, you can just add \singlespace before the \makebibliography command. Anything you want single-spaced can be made single-spaced by adding this command (and just add the \doublespace command when you want to switch back).
I like the setspace package. One thing it does not do is double-space your footnotes. I like that, but some journals do not. To double-space everything, you’ll want to use the second of the three spacing options.
The second option is to redefine the default spacing between baselines (the bottom of letters like ‘b’). You do this by adding the following line to your prologue:
\renewcommand{\baselinestretch}{2}
If you prefer 1.5 spacing, simply put a 1.5 in for the 2. Since this redefines the baseline for the document, it will change the spacing for footnotes as well as the main text.
The third option is a bit more powerful than the first two. It makes more global changes than just double-spacing things, but these are changes you might like (specifically, it converts footnotes to endnotes, changes the spacing of the document, alters the indentation of block quotes, and uses smaller fonts for the title, headers, etc.). Gregory Wheeler has put together a package specifically for philosophy papers. To use it, just go to his LaTeX for Philosophers page and download the philosophy.sty package. If you are on a Mac, put this in the user/Library/texmf/tex/latex directory you manually created; if you are on a PC, I gather that you ought to put it in the latex folder within MikTeX, where this will likely be C:\Program Files\MiKTeX 2.5\tex\latex, though the version number might differ.
Once you have downloaded philosophy.sty and put it in a directory where LaTeX can find it during compiling, you need to specify that the package be used. This will require a change to your prologue and a change near your bibliography.
Put the following in your prologue:
\usepackage{endnotes,philosophy}
This tells LaTeX to use two packages: the philosophy package you want to use and the endnotes package that the philosophy package relies on.
To get the endnotes to print, you need to explicitly put a \noteshere command where you want the notes. This will likely be just before or just after your bibliography. Add this command in and your paper will be double-spaced. It will also have what you might think is a more traditional look.
At some point you will likely want to use a new font. LaTeX is quite old, and it is made to interact with only a small set of fonts. The easiest way to use a new font is to use XƎTeX. (For our purposes, we can think of XƎTeX as a super-set of the LaTeX commands—if you compile your paper using XƎTeX, you can use all the LaTeX commands and packages, but you can also use some packages that go beyond LaTeX. Relevant here are the packages that let you use fonts easily.) If you use XƎTeX, your final pdf file can use any font you have on your computer.
To use XƎTeX you need to do three things.
First, you need to insert the following at the very start of your prologue (even before the documentclass{article} command):
%!TEX TS-program = xelatex %!TEX encoding = UTF-8 Unicode
Then you need to stick the following in your prologue somewhere:
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{Hoefler Text}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}
\setmonofont[Scale=MatchLowercase]{Andale Mono}
If you are using a serif font in your document, just change Hoefler Text to any font you want to use—you could even use Times New Roman if you need to. (If you are using a sans-serif, change the Gill Sans to whatever you like.)
Now write your paper like normal. When you are ready to compile it, do not compile it with LaTeX. Instead, compile it with XƎTeX (this will clearly be an option wherever you ordinarily select to compile with LaTeX).
The major text editors have an XƎTeX document template that will include all these basic bits for you. In fact, I pulled the prologue elements above directly from the XƎTeX template in TeXShop.
The default LaTeX margins seem huge at first. They are larger than 1 inch in order to make the document easier to read. But you might want to change the margins because you think they are too big or because you need specific margins for a dissertation or thesis. Changing the margins is easy. There is (or should be) a line in your prologue that says \usepackage{geometry}. This package can take margin sizes as arguments. So to get 1 inch margins all around, just write
\usepackage[right=1in,left=1in,top=1in,bottom=1in]{geometry}
And if you want larger or smaller margins on either side, just change that number.
One of the beauty of LaTeX is the way it typesets formulae. If you write logical notation, LaTeX is wonderful.
Each symbol is called by a command, and each command has a specific mode. Just as you type a command to make some text italic, you type a command to get LaTeX to print a symbol. For example, the code for the existential quantifier (the backwards ‘E’) is \exists. And the universal quantifier is called by the \forall command.
Modes. Most of the commands you want for logic can only be used in math mode. To put a bit of text in math mode, surround it with either (a) dollar signs or (b) backslashes and parentheses. So you would write either $logic stuff$ or \(logic stuff\). To write ‘there is an x’ in symbolic notation, I would type \(\exists (x)\). (The space is necessary. It tells LaTeX that the command is finished. If you typed \(\existsx\), LaTeX would think you meant some other command, the \existsx command.) I have always used the dollar signs, but you can use the backslash parentheses method as well.
All text in math mode is italicized, though not all symbols are. So if you don’t want your ‘x’ italicized in the above example, you would want to type \(\exists\)(x) (the dollar sign terminates the command, so you do not want an extra space here).
Ordinarily, you write in text mode. There are some symbols you can use in text mode. The most common are the accents on letters (like the little hat on the ‘u’ in Noûs) and, for me at least, the little section symbol. You get the section symbol by typing \S in text mode (so \S 2 for example—don’t forget the space). You get the accents by typing the right command followed by the letters it ranges over in brackets (so No\^{u}s, for example). Strictly, the braces are not necessary, but they don’t hurt, and I like to use them because they help me see what is going on.
Combining math and text. Sometimes you might want to write out a premise or claim using a combination of symbols and text. Any text within the scope of the math mode will be italicized (and some letters will look kind of funny). So you should make sure the words are outside of the scope of the math mode. The most elegant way to do this is to just wrap the words in a \mathrm{} or \text{} command. For example, you might write \(\exists (x)\ \mathrm{some\ text}\ \therefore\ y.\) (more on those extra backslashes in a moment). The (less elegant) alternative is to end the math mode before your text and then start a new math mode before your next symbol. I can see some situations where this might be a good option, but I think the \mathrm{} is better in most instances.
Spacing in math mode. Spaces are collapsed in math mode. If you leave a dozen spaces between two characters, they will be eliminated and your characters will appear side by side. This will happen even when you are inside a \mathrm{} command. To avoid having all your words and symbols run together, you merely need to stick a backslash at the end of every word you want followed by a space. Hence the extra backslashes in my example in the last paragraph.
There are a number of useful resources for learning or entering these commands. Gregory Wheeler put together a shortish pdf document that lists all the symbols you will probably need. You can find that here. There is a very long, comprehensive guide to symbols at CTAN here.
Perhaps more helpful than those guides is your text editor. If you are using TeXShop, just click Window -> LaTeX Panel in the menu bar and you will get a floating window listing all the symbols you might want (plus all the environments you might want, like ‘itemize’, ‘quote’, etc.). Just click the symbol you want and TeXShop will put it in the document, though it will not add the dollar signs for math mode-only symbols. I am pretty sure that TeXnicCenter has something similar. But from a first-pass, I don’t seen any such option in TeXworks. If there isn’t such a helpful menu, Wheeler’s short guide is easy enough to use, and you will learn the codes you use often pretty quickly. (There is also a free iPhone app called LaTeX Help that lists all the basic symbols.)
Some symbols are only available to you if you use the right package. I follow TeXShop’s lead and always include the \usepackage{amssymb} command in my prologue, as this allows me to use all the basic math symbols. And there are some symbols you might want to use that aren’t defined in a package. At his LaTeX for for Philosophers page, Gregory Wheeler has a list of symbols of interest to logicians. These aren’t part of any package, but he describes what you need to put in the prologue of your paper to be able to use the particular symbol you want.
The LaTeX list environment is very helpful for writing philosophical papers. Using it will allow you to write nice numbered premise arguments and inset definitions.
There are three kinds of lists: itemized lists, enumerated lists, and description lists. They are similar in structure, but they produce different sorts of lists.
An itemized list is a bulleted list. It is unordered. To create an itemized list you simply write
\begin{itemize}
\item Your first item.
\item Your second item.
\item Etc.
\end{itemize}
(Your text editor likely has a command or a button for inserting each sort of list.)
An enumerated list is a numbered list. This is the sort of list you would use for an argument. To write a list like this, you replace itemize above with enumerate:
\begin{enumerate}
\item First item.
\item Second item.
\item Third item.
\end{enumerate}
This will give you the classic:
- First item.
- Second item.
- Third item.
There are a couple of ways you might want to customize such a list. You might want to use different numbers (use (1*), (2*), etc.), you might want to start counting at a higher number, and you might want to use the therefore sign instead of the last number.
Changing numbers. To change the numbers your argument uses, you need to do two things. First, you need to insert the \usepackage{enumerate} command somewhere in your prologue. Second, after the \begin{enumerate} command put the counter you want to use in square braces. For example, if I want to enumerate with (1*), etc., I would write
\begin{enumerate}[(1*).]
\item First item.
\item Second item.
\item Third item.
\end{enumerate}
Note that all and only the characters you put in those square braces will show up in your list (though it will count up from 1). So if you want parentheses around the number, add them; and if you want a period after the number, add it.
Changing starting number. Changing the starting number is pretty straightforward. You merely need to insert the \setcounter{enumi}{desired number - 1} command just after the \begin{enumerate} command, setting the number in the curly braces after {enumi} to one less than the first number you want in your list. So if I need to pick up my argument with premise five I would write
\begin{enumerate}
\setcounter{enumi}{4}
\item Fifth item.
\item Sixth item.
\end{enumerate}
Ending with a conclusion. You are using LaTeX. You might as well make use of the symbols at your disposal. So to wrap your argument up with the little three dot ‘therefore’ sign instead of the next number in the list, just do the following:
\begin{enumerate}
\item First item.
\item Second item.
\item[\(\therefore\)] Conclusion.
\end{enumerate}
The square brackets directly after an \item command override the item counter with whatever you put there. In this case, I have set the counter for the final list item to be the symbol called by the math mode \therefore command. To make this work, you have to use it in math mode. (Note that if you needed to, you could change the counter of any premise to anything you like.)
Often in LaTeX, there is more than one way to achieve your goal. Kevin Klement suggested to me that there is a better way of manipulating your numbered lists. I can’t decide if it is a better way or not. I think each has advantages. I’ll describe this other method here. This method has one clear advantage: you can easily resume the numbering of a list that has been interrupted by text.
This method relies on the enumitem package. For a normal numbered list, you just use the same \begin{enumerate} ... \item ... \end{enumerate} commands like above. But here is an example to show how the more complicated features work, starting with a bit of the prologue:
... start prologue
\usepackage{enumitem}
... end prologue
\begin{enumerate}[start=4, label=(\arabic**).]
\item Fourth item.
\item Fifth item.
\end{enumerate}
Some text explaining something or other.
\begin{enumerate}[resume, label=(\arabic**).]
\item Sixth item.
\item Seventh item.
\end{enumerate}
The forgoing illustrates three key features of the enumitem package for numbered list management. The \begin{enumerate} command is followed by an optional list of arguments in square brackets. Those arguments dictate what the list will look like. A start=# argument dictates the starting number for the list (note that if you put ‘4’ here the list starts with ‘4’, unlike the method above. Second, the label= argument dictates what the counter looks like. \arabic* gives you standard numbers, alph* gives you lowercase letters, \Alph* gives you uppercase letters, and \roman* and \Roman* give you lower and uppercase roman numerals, respectively. (Note that even if you are counting with letters, if you want to start counting at ‘d’ you write start=4.) Third, if you want the current list to continue where the last list left off, you can write resume instead of start=#. This is nice—if you add or remove elements from the earlier list or lists, you don’t have to manually update all your other lists. But do note that you need to specify the counter style every time, as in my example.
The description list is a way of providing an explicit definition. You write a description list using the following commands:
\begin{description}
\item[Thesis] My thesis.
\end{description}
The term you are defining goes in the square braces after the \item command. (And if you want to add elements to your list, add them with more \item commands.) In the current example, the output will be a block indented paragraph that looks like this:
Thesis: My thesis.
The description list is, obviously, a great way to highlight theses you want to make clear and then refer back to.
The default LaTeX paper header and footer is kind of bland. It just includes the page number, centered in the footer. Not bad, but not great, either. To customize this, use the fancy header package. This is likely installed by default; if not, use TeX Live Utility or let MikTeX install it for you. You can find the full documentation here, but here are the basics you need to know to use it right away.
First, put the following in your prologue:
\usepackage{fancyhdr}
\usepackage{lastpage}
\pagestyle{fancy}
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{}\rfoot{}
\renewcommand{\headrulewidth}{0.0pt}
Whatever you put in the scope of \lhead{} will appear in the header on the left side. \chead{} and \rhead{} put text in the center and right side of the header, respectively. And the \lfoot{}, etc. commands do the same for the footer.
The lastpage package is optional. If you use it, then you can put a ‘page m of n’ kind of page number in the header or footer. To do this, just put \thepage\ of \pageref{LastPage} wherever you want that to appear. (Note that you need to compile the paper twice with LaTeX to get this to work right—the first time, LaTeX counts the pages; the second time, it enters the number in the right place.)
Second, you want to add a \thispagestyle{empty} command right after your \maketitle command. This gives you a blank first page. If you wanted, you could change the ‘empty’ out for a ‘fancy’, and your fancy header would show up on page one. But if you have anything in the header, that will show up above your title. And that just looks weird.
There are lots of great packages you can use to customize your LaTeX document. Peter Smith’s LaTeX for Logicians is a great resource once you have the basics I have detailed here down.
Over the course of time, I plan on detailing the packages I use and things I learn about LaTeX on my blog devoted to matters technical PhilTeX. Since I don’t learn something new about LaTeX every day, the posting is light. But if you’ve found this guide helpful, I think you’ll find the content over there helpful as well.
An update on PhilTeX: PhilTeX is now a group blog. There are a handful of contributors posting informative and helpful posts each week. This is much better than when it was just me writing for it!
Additionally, there is now a PhilTeX Forums page. Anyone can go there and ask a question and, hopefully, get a helpful answer. And everyone is invited to participate in both asking and answering questions, as they like. Discussions there need not be limited to LaTeX; we can discuss all matters technical there.
If you have any questions, take a look around over there or email me at tanksley [at] virginia [dot] edu.