Truth Tables in LaTeX

Typesetting truth tables has never been easy. LaTeX is the gold standard for displaying logic and mathematics, but tables are awkward to edit at best. Tables are much simpler in Microsoft Word, but displaying formulas is a horrible experience.1 Here is my current workflow.

The text that I’m using this semester is Introduction to Formal Logic with Philosophical Applications by Russell Marcus. Instead of arrows and the ampersand, it uses the horseshoe, triple bar, and dot. So, I add the following lines to my LaTeX preamble to simplify entering the symbols.2

\newcommand{\lneg}{\mathord{\sim}}
\renewcommand{\land}{\bullet}
\newcommand{\lif}{\supset}
\newcommand{\liff}{\equiv}


Then, I enter the truth table in either Excel or Numbers. For example, this would be a simple one line table determining the truth value of a formula for a given valuation:

Copy the cells that you want included in the truth table. Go to Tables Generator, and select “LaTeX Tables” from the top menu bar. Below the top menu bar is a drop-down menu bar. Click on “File” then “Paste table data…” and paste the table data. Table Generator will generate a nicely formatted LaTeX table:

\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{llllllll}
P & Q & R & P & \lif & (\lneg Q & \land & R) \\
1 & 1 & 1 & 1 & 0 & 0 & 0 & 1
\end{tabular}
\end{table}


I delete the first four lines and the last line, leaving just the table data and the lines declaring the tabular environment:

\begin{tabular}{cccccccc}
P & Q & R & P & \lif & (\lneg Q & \land & R) \\
1 & 1 & 1 & 1 & 0 & 0 & 0 & 1
\end{tabular}


At this point, typesetting will fail because the symbols need to be in math mode. So, I’ve found two options. The first is to put all the commands for the symbols in math mode:

\begin{tabular}{cccccccc}
P & Q & R & P & $$\lif$$ & ($$\lneg$$ Q & $$\land$$ & R) \\
1 & 1 & 1 & 1 & 0 & 0 & 0 & 1
\end{tabular}


The second option is to change “tabular” to “array” and put the entire table into math mode:

$\begin{array}{cccccccc} P & Q & R & P & \lif & (\lneg Q & \land & R) \\ 1 & 1 & 1 & 1 & 0 & 0 & 0 & 1 \end{array}$


Arrays are centered on the page. If you would prefer them printed at the left margin, add “fleqn” to the document class options: \documentclass[fleqn]{article} Since the array is in math mode, the letters will be italicized. I use the newtxmath font package, and it has a “frenchmath” option that sets the math font to non-italic. Other math fonts may have a similar option.

Finally, whichever option is used, we need to add two lines. Adding a vertical line character to the table or array formatting options will place a vertical line between the valuation section and the rest of the truth table. Adding the booktabs package to the preamble will allow us to separate the sentence from the rest of the truth table.

This gives us the final version,

$\begin{array}{ccc|ccccc} P & Q & R & P & \lif & (\lneg Q & \land & R) \\ \midrule 1 & 1 & 1 & 1 & 0 & 0 & 0 & 1 \end{array}$


which produces this:

1. Apple’s Pages now allows users to add formulas with LaTeX. It’s looking like a good solution for those who like more traditional word processors.
2. The AMS LaTeX packages already include a command called “\lor” for entering the vee or wedge.

Study Guide for Exam 2

Here are some topics to study for the second exam in Introduction to Philosophy, Fall 2017. Students are responsible for knowing everything covered in lectures and readings, but the items on the following list will make up the bulk of the exam.

Material will be added to the list as it is discussed in class.

1. Philosophical behaviorism
2. The identity theory
3. The multiple realizability thesis
4. Functionalism
5. Objections to functionalism (missing qualia and inverted spectrum)
6. Computationalism
7. Turing test
8. The Chinese Room argument
9. Problems for materialism
10. Locke’s theory of personal identity
11. Objections to Locke from Reid and Butler
12. Problem with duplication and brain transplants
13. Epicurean hedonism
14. Act utilitarianism
15. The utilitarian calculus
16. Strengths of act utilitarianism
17. Weaknesses of act utilitarianism
18. Preference utilitarianism
19. Ways of measuring preferences
20. Rule utilitarianism
21. General objections to utilitarianism
22. Hume on morality
23. Hypothetical vs. categorical imperatives
24. Two formulations of the categorical imperative
25. Perfect and imperfect duties
26. Objections to deontology
27. Aristotle’s analysis of the soul
28. The ultimate good
29. Four options for happiness
30. The function argument
31. Aristotle’s analysis of virtue
32. Four types of moral personality
33. Key concepts in virtue theory
1. Imprecision
2. Importance of experience
3. Freedom
4. Friendship
5. Practical wisdom
6. Virtue
7. Eudaimonia
8. Teleology
34. Objections to virtue theory
35. Nietzsche
1. Meaning of “God is dead”
2. Master and slave morality
3. Ressentiment
4. Will to Power
5. Overman
36. Argument for cultural relativism
37. Consequences of relativism
38. Punishment
1. Utilitarian justifications
2. Deontological justifications
3. Virtue justifications
39. Euthanasia
1. Doctrine of Double Effect
2. Involuntary, non-voluntary, voluntary
3. Active and passive
40. Abortion
1. General attitudes of utilitarians, deontologists, and virtue ethicests

Fall 2017 Textbooks

Here are the textbooks for my Fall 2017 courses:

Introduction to Philosophy

1. Adler, Jonathan E., and Catherine Z. Elgin. 2007. Philosophical Inquiry: Classic and Contemporary Readings. Indianapolis, IN: Hackett Publishing.

Critical Thinking

None required to purchase.

History of Ancient Philosophy

1. Reeve, C. D. C., and Patrick L. Miller. 2006. Introductory Readings in Ancient Greek and Roman Philosophy. Indianapolis, IN: Hackett Pub. Co.
2. Shields, Christopher. 2011. Ancient Philosophy: A Contemporary Introduction. 2nd ed. Routledge Contemporary Introductions to Philosophy. London: Routledge.

Aesthetics

1. Cahn, Steven M., and Aaron Meskin. 2007. Aesthetics: A Comprehensive Anthology. Oxford: Blackwell.
2. Graham, Gordon. 2005. Philosophy of the Arts: An Introduction to Aesthetics. London: Routledge.

Church History

1. Gonzalez, Justo L. 2010. The Story of Christianity: Volume 1: The Early Church to the Dawn of the Reformation. Vol. 1. Grand Rapids, MI: Zondervan.

Ancient Philosophy Study Guide

1. What is the reason for separating Plato’s dialogues into Socratic (early) and Platonic (middle) dialogues?
2. Why is Socrates’ method primarily negative? Is there anything that Socrates does (at least implicitly) claim to know?
3. Explain why the Meno is considered a transitional dialogue.
4. Explain Meno’s Paradox. How does Plato respond?
5. Although Socrates claims ignorance, he seems to hold some surprising philosophical positions. Explain.
6. Why did Socrates not plead for his life?
7. What are the characteristics of the Forms, according to Plato. Why does Plato think that the Forms are the keys to providing Socratic definitions?
8. Compare and contrast the stories of the Sun, Line, and Cave in the Republic.
9. Explain the problem of reconciling Plato’s Cave with the overall project in the Republic.
10. Explain the various accounts of knowledge in the Theaetetus and the objections to those accounts.

Therefore I beg you, reader, not to rejoice too greatly if you have read much, but if you have understood much. Nor that you have understood much, but that you have been able to retain it. Otherwise it is of little profit either to read or to understand.”n

Hugh of Saint Victor, d. Feb. 11, 1141

Explain Everything

An Apple education representative recommended the iOS app “Explain Everything.” I imported a Keynote presentation, talked through it, then posted the result to YouTube. It didn’t take any time at all. Explain Everything looks like it will be a great tool for anyone teaching in a distance learning context.

Using Keynote in Class

I have been using Keynote for iOS for lecture presentations in classes this semester. The process has been so easy, that this is the first semester that I have consistently used slide presentations during lectures. Most of my presentations were initially prepared on the Mac, then imported into Keynote for iOS on the iPad. Keynote for iOS seems to be fairly adept at importing transitions and effects. My only complaint is that the default font used in my preferred theme is different in the iOS version than in the desktop version of Keynote.

I use the Remote app on the iPhone as a presentation controller. I was a bit apprehensive at first. I have a Bluetooth presentation controller that I preferred to use in the past. I like having the hardware buttons for moving through the slides. That way, I could simply feel the button, change the slide, and never have to look at the controller. I find that I can do the same thing with the Remote app, however. Slide changes occur when the presenter swipes a finger across the screen, exactly like navigating through screens on an iOS device. I found that it is very natural to hold the phone in one hand, and swipe the screen with the index finger of that same hand to change the slide. A swipe in the other direction moves to the previous slide. There is no need to look at the phone to change slides. It is easy, natural, and I have yet to drop the phone after a semester’s worth of lectures. I can glance at the phone to see the next slide in the queue, a handy feature that my usual remote lacks.

When I first started using the Remote app with Keynote for iOS, the two worked seamlessly. Both the iPad and iPhone were on the same wi-fi network, so the iPhone immediately saw the presentation that was running on the iPad. At some point, though, the two stopped connecting to each other. This began at the same time that I updated devices to iOS. Unfortunately, I don’t know if it is related to iOS or if it is a result of changes in the University’s network. I have found that connecting the iPad to the iPhone using the personal hotspot works flawlessly. That does require a few extra steps before the presentation can begin.

Even so, I am extremely pleased with Keynote for iOS and the companion Remote app. I simply carry in the iPad and the adapter cable, plug it in to the projector cable, and begin the presentation. No boot-up time and not heavy laptop. It’s quick, easy, and it just works, assuming you pay AT&T for the privilege of using your phone as a personal hotspot.