I have tried some of the solutions to similar questions, but none of them included minipages, which seems to be the problem (I`m fairly new to LaTeX)
So, here's the coding:
% Definition of circles
\def\firstcircle{(0,0) circle (1.5cm)}
\def\secondcircle{(0:2cm) circle (1.5cm)}
\colorlet{circle edge}{black!50}
\colorlet{circle area}{grey!20}
\tikzset{filled/.style={fill=circle area, draw=circle edge, thick},
outline/.style={draw=circle edge, thick}}
\setlength{\parskip}{5mm}
% Set A or B
\begin{tikzpicture}
\begin{minipage}[t][2cm][t]{.48\textwidth}
\draw[filled] \firstcircle node {$A$}
\secondcircle node {$B$};
\node[anchor=south] at (current bounding box.north) {$M$};
\end{minipage}
\end{tikzpicture}
% Set A and B
\begin{tikzpicture}
\begin{minipage}[t][2cm][t]{.48\textwidth}
\begin{scope}
\clip \firstcircle;
\fill[filled] \secondcircle;
\end{scope}
\draw[outline] \firstcircle node {$A$};
\draw[outline] \secondcircle node {$B$};
\node[anchor=south] at (current bounding box.north) {$M$};
\node[anchor=west] at (current bounding box.east) {$A \cap B$}
\end{minipage}
\end{tikzpicture}
Also, if you know how to put the "B" in the center of the circle on the right I`d appreciate your help! Thank you.




minipageinside TikZ pictures – May 07 '19 at 02:17