# adjustbox with equation and tikzpicture

I want to write an equation on top of a tikzpicture within an adjustbox, but I'm getting this (I just wrote one equation):

the MWE follows:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{outlines}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{blindtext}
\usepackage[margin=0.8in]{geometry}
\usepackage{tikz}
\def\firstcircle{(90:1.75cm) circle (2.5cm)}
\def\secondcircle{(210:1.75cm) circle (2.5cm)}
\def\thirdcircle{(330:1.75cm) circle (2.5cm)}

\begin{document}

\begin{minipage}{\linewidth}\begin{outline}\1[$\blacktriangleright$]\emph{\textbf{aTitle}}:
\1[] \blindtext:

$A \cup (B\cap C) = (A\cup B) \cap (A\cup C)$

\begin{tikzpicture}
\begin{scope}
\clip \secondcircle;
\thirdcircle;
\end{scope}
\begin{scope}
\clip \firstcircle;
\thirdcircle;
\end{scope}
\draw \firstcircle node[text=black,above] {$A$};
\draw \secondcircle node [text=black,below left] {$B$};
\draw \thirdcircle node [text=black,below right] {$C$};
\end{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\clip \secondcircle;
\thirdcircle;
\end{scope}
\begin{scope}
\clip \firstcircle;
\thirdcircle;
\end{scope}
\draw \firstcircle node[text=black,above] {$A$};
\draw \secondcircle node [text=black,below left] {$B$};
\draw \thirdcircle node [text=black,below right] {$C$};
\end{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\clip \secondcircle;
\thirdcircle;
\end{scope}
\begin{scope}
\clip \firstcircle;
\thirdcircle;
\end{scope}
\draw \firstcircle node[text=black,above] {$A$};
\draw \secondcircle node [text=black,below left] {$B$};
\draw \thirdcircle node [text=black,below right] {$C$};
\end{tikzpicture}
\end{outline}\end{minipage}

\end{document}


You can place the equation below the first A circle, for example, as follows:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{outlines}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{blindtext}
\usepackage[margin=0.8in]{geometry}
\usepackage{tikz}
\usetikzlibrary{positioning}
\def\firstcircle{(90:1.75cm) circle (2.5cm)}
\def\secondcircle{(210:1.75cm) circle (2.5cm)}
\def\thirdcircle{(330:1.75cm) circle (2.5cm)}

\begin{document}

\begin{minipage}{\linewidth}
\begin{outline}\1[$\blacktriangleright$]\emph{\textbf{a Title}}:
\1[] \blindtext:
%
\begin{center}
\begin{tikzpicture}
\begin{scope}
\clip \secondcircle;
\thirdcircle;
\end{scope}
\begin{scope}
\clip \firstcircle;
\thirdcircle;
\end{scope}
\draw \firstcircle node(A)[text=black,above] {$A$};
\draw \secondcircle node [text=black,below left] {$B$};
\draw \thirdcircle node [text=black,below right] {$C$};
\node [below=of A] {$A \cup (B\cap C) = (A\cup B) \cap (A\cup C)$};
\end{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\clip \secondcircle;
\thirdcircle;
\end{scope}
\begin{scope}
\clip \firstcircle;
\thirdcircle;
\end{scope}
\draw \firstcircle node[text=black,above] {$A$};
\draw \secondcircle node [text=black,below left] {$B$};
\draw \thirdcircle node [text=black,below right] {$C$};
\end{tikzpicture}
\begin{tikzpicture}
\begin{scope}
\clip \secondcircle;
\thirdcircle;
\end{scope}
\begin{scope}
\clip \firstcircle;
\thirdcircle;
\end{scope}
\draw \firstcircle node[text=black,above] {$A$};
\draw \secondcircle node [text=black,below left] {$B$};
\draw \thirdcircle node [text=black,below right] {$C$};
\end{tikzpicture}
\end{center}
\end{outline}
\end{minipage}

\end{document}


• Ok. I hadn't thought of looking into doing it within tikz, and I didn't know it was so expressive. Cool. Thanks – cladelpino May 30 '17 at 23:39
• For anyone looking, note: \usetikzlibrary{positioning} – cladelpino May 30 '17 at 23:44
• And what about positioning it relative to the circle ? I'm finding it hard to do – cladelpino May 31 '17 at 0:08
• Easiest is to specify the dimension in below=<dimension> of A also above, left, right or a combination of these, below right, below left, above right, etc... – AboAmmar May 31 '17 at 0:37

Simple solution:

\begin{adjustbox}{width=5cm}
\begin{tikzpicture}
\node at (90:3) {$A \cup (B\cap C) = (A\cup B) \cap (A\cup C)$};
\node[draw,circle,minimum size=3cm,inner sep=0pt] (c1) at (90:1) {};
\node at (110:2) {$A$};
\node[draw,circle,minimum size=3cm,inner sep=0pt] (c2) at (210:1) {};
\node at (210:2) {$B$};
\node[draw,circle,minimum size=3cm,inner sep=0pt] (c3) at (330:1) {};
\node at (330:2) {$C$};
\end{tikzpicture}

• Also \node[above] (current bounding box.north) {...}; – John Kormylo May 31 '17 at 3:33
• see tex.stackexchange.com/questions/372229/…, maybe can help. And don't resize images and equations, better is scale tikz images or even better redraw it to desired size. – Zarko May 31 '17 at 5:00