# [OS X TeX] set difference using TikZ and beamer

Art Werschulz agw at comcast.net
Fri Mar 20 13:22:13 EDT 2009

Hi.

I'm trying to do a slide that contains a Venn diagram and some
commentary.  I found Til's Venn diagram example at
http://www.texample.net/tikz/examples/venn-diagram
and I'm trying to somewhat blindly modify same.

Here's the code for such a page:

<snip>
\doocumentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds}

\usepackage{comment}

\begin{document}
\pagestyle{empty}

\begin{frame}
\frametitle{Constructing $C$}
\begin{center}
\begin{tikzpicture}
\newcommand\circleA{(0,0) circle (1.5cm)}
\newcommand\circleB{(2cm,0) circle (1.5cm)}
\begin{scope}[even odd rule]% first circle without the second
\clip \circleB (-2,-2) rectangle (2,2);
\fill[yellow] \circleA;
\end{scope}
\begin{scope}[even odd rule]% second circle without the first
\clip \circleA (-2,-2) rectangle (4,4);
\fill[yellow] \circleB;
\end{scope}
\draw \circleA node {$L(A)$};
\draw \circleB node {$L(B)$};
\end{tikzpicture}
\end{center}
$L(C) = \big(L(A)\cap\overline{L(B)}\big) \cup \big(L(B)\cap\overline{L(A)} \big).$
\begin{itemize}
\item We used proofs by construction to show that regular
languages are closed under union, intersection, and complement.
\item We can use those constructions to construct a~FA that
accepts~$L(C)$.
\end{itemize}
\end{frame}

\end{document}
</snip>

Unfortunately, the diagram starts way too low on the page.  As a
result, the last two lines of text don't appear on the slide.

Any ideas on how to fix?  Thanks.

Art Werschulz (8-{)}   "Metaphors be with you."  -- bumper sticker
GCS/M (GAT): d? -p+ c++ l u+(-) e--- m* s n+ h f g+ w+ t++ r- y?
Internet: agw STRUDEL comcast.net