1

I get some obviously unwanted space here:

unwanted spaces

Does it have to do with invisible control points being used to draw the arcs?

Here's the offending code:

\begin{tabular}{|c|c|}
\hline
\begin{tikzpicture} [main/.style = {draw, circle},node distance = 2cm,on grid,auto]
 \node[main] (1) {$1$};
 \node[main] (2) [right of=1] {$2$};
 \node[main] (3) [below of =2] {$3$};
 \node[main] (4) [left of =3] {$4$};
 \draw (1) -- (2);
 \draw (2) -- (3);
 \draw (3) -- (4);
 \draw (4) -- (1);
 \draw (1) -- (3);
 \draw (2) to [out=135,in=180,looseness=2.5] (4);
\end{tikzpicture}
&
\begin{tikzpicture} [main/.style = {draw, circle},node distance = 2cm,on grid,auto]
 \node[main] (1) {$1$};
 \node[main] (2) [below right of= 1] {$2$};
 \node[main] (3) [below left of =1] {$3$};
 \node[main] (4) [below of =3] {$4$};
 \node[main] (5) [below of =2] {$5$};
 \draw (1) -- (2);
 \draw (1) -- (3);
 \draw (1) -- (4);
 \draw (1) -- (5);
 \draw (2) to [out=90,in=90,looseness=2.5] (3);
 \draw (2) to [out=-50,in=-50,looseness=2.5] (4);
 \draw (2) -- (5);
 \draw (3) -- (4);
 \draw (3) -- (5);
 \draw (4) -- (5);
\end{tikzpicture}
 \\ \hline
$K_{4}$ drawn without crossing     & Attempted drawing of $K_{5}$ without crossings \\ \hline
\end{tabular}
  • I think that part is https://tex.stackexchange.com/questions/43621/bounding-box-is-larger-than-expected-when-drawing-a-curved-path, part is the baseline of the two diagrams... – Rmano May 16 '21 at 07:00

1 Answers1

1

Considering @Rmano comment, you can get:

enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata,
                positioning}

\begin{document} \begin{tabular}{|c|c|} \hline \begin{tikzpicture}[baseline=(4), % <--- node distance = 2cm and 2cm, on grid, every node/.append style = {state} ] \clip(-2,-3) rectangle (3,2); % <--- \node (1) at (0,0) {$1$}; \node (2) [right=of 1] {$2$}; \node (3) [below=of 2] {$3$}; \node (4) [left =of 3] {$4$}; % \draw (1) -- (2) -- (3) -- (4) -- (1) -- (3) (4) to [out=135,in=135,looseness=2.5] (2); \end{tikzpicture} & \begin{tikzpicture}[baseline=(4), % <--- node distance = 2cm and 2cm, on grid, every node/.append style = {state} ] \clip(-0.5,-4) rectangle (5.1,4); % <--- \node (1) at (2,2) {$1$}; \node (2) [below right=of 1] {$2$}; \node (3) [below left =of 1] {$3$}; \node (4) [below=of 3] {$4$}; \node (5) [below=of 2] {$5$}; % \draw (1) -- (2) -- (5) -- (4) -- (3) -- (1) -- (5) -- (3) (4) -- (1) (3) to [out= 90,in= 90,looseness=2.5] (2) (2) to [out=-60,in=-30,looseness=2.5] (4); \end{tikzpicture} \ \hline $K_{4}$ drawn without crossing & Attempted drawing of $K_{5}$ without crossings \ \hline \end{tabular} \end{document}

Zarko
  • 296,517