0

Is there an easy and efficient way to put multiple venn-diagrams in a single line? Either force the compiler to ignore the line break or shift all of the coordinates in the second one? I'm open to any solution.

\documentclass{article}
\usepackage{tikz}
\def \setA{ (0,0) circle (1cm) node {$A$}}
\def \setB{ (1.5,0) circle (1cm) node {$B$}}
\def \myrectangle{ (-2, -1.5) rectangle (3.5, 1.5) }

\begin{document}
\begin{center}
\begin{tikzpicture}[scale=0.6]
\draw \myrectangle node[below left]{$U$};
\fill[gray] (0,0) circle (1cm);
\fill[gray] (1.5,0) circle (1cm);
\draw \setA;
\draw \setB;
\end{tikzpicture}

\begin{tikzpicture}[scale=0.6]
\draw \myrectangle node[below left]{$U$};
\begin{scope}
\clip \setA ;
\fill[gray] \setB ;
\end{scope}
\draw \setA;
\draw \setB;
\end{tikzpicture}
\end{center}

\end{document}
  • 1
    by default they would be side by side, just as by default letters are side by side. But like letters if you put a paragraph break in between then paragraphs are stacked vertically. – David Carlisle May 29 '17 at 13:32
  • How can I remove the paragraph break? – Seth Killian May 29 '17 at 13:35
  • you added it, so just don't do that. Remove the blank line. tikz is not involved at all here compare xx with x x and x<blank line>x the x touch, or have a word space or are stacked vertically depending what you put between them – David Carlisle May 29 '17 at 13:39
  • Oh wow, I didn't realize that adding a blank line make a difference. Thanks for your help. I'm new to LaTeX and still figuring some of the finer points out. – Seth Killian May 29 '17 at 13:41
  • https://tex.stackexchange.com/questions/372185/set-of-venn-diagrams#comment919632_372185 – David Carlisle May 29 '17 at 14:03
  • See https://tex.stackexchange.com/q/82664/15925 – Andrew Swann May 29 '17 at 14:52

0 Answers0