I spent the weekend working on Venn diagrams in LaTeX using TikZ to use when teaching categorical logic. I thought it was a much better use of my time than mowing the lawn, and one never knows when a good Venn diagram will be needed.
The Initial Diagram
First, add the following to the preamble:


The next step is to define the three circles in the body of the document. This only needs to to be done once; they can be called repeatedly in the same document. I named them in a way that I could remember which was the subject term, middle term, and predicate term:


Once the circles have been defined, they can be drawn and labeled. I prefer to use a heavier line than the default, that can be called as an option to tikzpicture.


This produces the following:
Shading
Universal Negations
Shading is simple with TikZ, and, in most cases, relatively intuitive. To shade an entire circle, use the “\fill” command. For example, “\fill \sub” fills the entire subject circle. To fill the intersection of the subject and predicate circles, we need to tell TikZ to ignore everything that is outside the predicate circle, then fill the subject circle. This is done with the “\clip” command. This code shades the intersection of S and P:


Universal Affirmations
Shading everything that is one circle, but not in another is a bit trickier. It involves using something called the “even odd rule” in TikZ. Since I don’t quite understand how the rule works, this involved a bit of trialanderror on my part. If there is a more efficient way, then please leave a comment. This code shades the portion of the subject circle that is not in the predicate circle:


To shade S without M:


M without S:


M without P:


P without M:


Finally, to shade P without S:


Particulars
I and O sentences require an ``x'' to be placed in some region of the diagram. To do that, just draw a node at the desired location. Here are the locations of the seven sections in the diagram:


Examples
Here are some examples to show how full arguments are diagrammed.
Celarent (EAE1)
Celarent is a classic firstfigure argument that uses both a universal negation and a universal affirmation.


This produces the following:
Disamis (IAI3)
Disamis is a good example of a universal affirmation with a particular affirmation.
It was made with this code:


Scaling
TikZ graphics can be scaled easily with an option to the tikzpicture environment. This doubles the size of the picture:


This reduces the size by half:


Unfortunately, this won’t scale the text at the nodes, which will make the labels look ridiculously out of proportion. This can be fixed by adding an option to also scale the nodes. So, this produces a doublesize image with proper labels:

