[Tex/LaTex] Drawing a venn diagram with two nodes using Tikz

horizontal alignmenttext manipulationtikz-pgfvenn-diagrams

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

Best Answer

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