0

I have the following example. How do I the get the tikzpicture to center correctly both horizontally and vertically.

\documentclass[10pt,a4paper]{report}
\usepackage{tikz}
\usepackage{tabularx}
\usetikzlibrary{graphs, graphdrawing, graphs.standard}
\usegdlibrary{circular}

\begin{document}
\begin{center}
\begin{tabularx}{\textwidth}{|X|X|X|}
\hline
\begin{tikzpicture}[simple necklace layout] 
\graph[nodes={circle, n=4, inner sep=0pt, minimum size=2mm, fill, as=, grow'=up}] {
    subgraph I_n[V={0,1,2,3}];
    0 -- 2,
    1 -- 2,
    0 -- 3,
    1 -- 3,
};
\end{tikzpicture}

&

\begin{tikzpicture}[simple necklace layout] 
\graph[nodes={circle, n=4, inner sep=0pt, minimum size=2mm, fill, as=, grow'=up}] {
    subgraph I_n[V={0,1,2,3}];
    0 -- 1,
    1 -- 2,
    0 -- 3,
    2 -- 3,
};
\end{tikzpicture}

&

\begin{tikzpicture}[simple necklace layout] 
\graph[nodes={circle, n=4, inner sep=0pt, minimum size=2mm, fill, as=, grow'=up}] {
    subgraph I_n[V={0,1,2,3}];
    0 -- 1,
    0 -- 2,
    1 -- 3,
    2 -- 3,
};
\end{tikzpicture}

\\
\hline
\end{tabularx}
\end{center}
\end{document}

enter image description here

vi pa
  • 3,394
eugkenny
  • 1
  • 1
  • \tikz [simple necklace layout] ?? -- how is it defined – js bibra May 26 '20 at 13:14
  • 1
    @jsbibra simple necklace layout is actually defined in the graph drawing library circular see pgfmanual § 33 – BambOo May 26 '20 at 14:04
  • This question however feels like a duplicate of this one https://tex.stackexchange.com/q/108442/141947 – BambOo May 26 '20 at 14:05
  • Unfortunately not - applying the proposed solution will not even compile - there must be some interference between with the tikz graph drawing libraries. – eugkenny May 26 '20 at 18:47

0 Answers0