8

How do I create a Venn Diagram with entities no larger than below, but with text scaled to fit; and circles in alignment horizontally?

\documentclass[a4paper, 14pt]{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
  \tikzset{venn circle/.style={draw,circle,minimum width=3cm,fill=#1,opacity=0.4}}

  \node [venn circle] (A) at (0,0) {first order logic};
  \node [venn circle] (B) at (30:2cm) {logic programming};
  \node[below] at (barycentric cs:A=1/2,B=1/2){definite clause logic};
\end{tikzpicture}  

\end{document}

venn

2 Answers 2

9

Text node size (text width) is independent of node size (minimum width, ...), you also have options to change font size. Using all of them:

\documentclass[a4paper, 14pt]{standalone}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[font=\tiny]
  \tikzset{venn circle/.style={draw,circle,minimum width=3cm,
            fill=#1,text width=1cm,align=center,opacity=0.4}%
   }

  \node [venn circle] (A) at (0,0) {first order logic};
  \node [venn circle] (B) at (30:2cm) {logic programming};
  \node[below,text width=1cm,align=center,anchor=center] at (barycentric cs:A=1/2,B=1/2){definite clause logic};
\end{tikzpicture}  

\end{document}

enter image description here

If you need both circles horizontally aligned, change at (30:cm) to at (0:2cm).

0
6

For the sake of completeness there is also the venndiagram package by Nicola Talbot, allowing to draw nice Venn diagrams.

\documentclass{standalone}
\usepackage{venndiagram}
\begin{document}

\begin{venndiagram2sets}
\fillACapB
\end{venndiagram2sets}

\begin{venndiagram3sets}
\fillACapCNotB
\end{venndiagram3sets}
\end{document}

enter image description here

1
  • Thanks, I'm sure this will be useful at a later juncture.
    – A T
    Nov 14, 2012 at 3:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .