Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 7 down vote accepted

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).

share|improve this answer
    
Thanks, exactly what I was looking for. –  A T Nov 14 '12 at 3:36

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

share|improve this answer
    
Thanks, I'm sure this will be useful at a later juncture. –  A T Nov 14 '12 at 3:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.