I need to draw a graph in a document built with \documentclass{book}.
To do this I'm using the tikz package, but when I run the .tex file the nodes are all one above the other, no matter the distance I set.
This is the code I'm using:
\begin{tikzpicture}[node distance={50mm}, thick, main/.style = {draw, circle}]
\node[main] (1) {$1$};
\node[main] (2) [right of=1] {$2$};
\node[main] (3) [right of=2] {$3$};
\node[main] (4) [below of=1] {$4$};
\node[main] (5) [right of=4] {$5$};
\node[main] (6) [right of=5] {$6$};
\end{tikzpicture}
With documentclass{article} the code works fine, but I cannot use that documentclass.
Could you help me to understand why the package is not working? Do you know other solutions?
This is the code that I run:
\documentclass[a4paper, 12pt]{book}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{indentfirst}
\usepackage{fancyhdr}
\usepackage[dvips]{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{latexsym}
\usepackage{amsthm}
\usepackage{eucal}
\usepackage{eufrak}
\usepackage{tikz}
\usetikzlibrary{graphs,graphs.standard,quotes,arrows.meta}
\title{My Title}
\author{Me}
\date{}
\begin{document}
\maketitle
\input{doc1.tex}
\input{doc2.tex}
\end{document}
doc2.tex is the .tex file that contains the details of the graph I want to build.
\begin{document}and\end{document}and using\documentclass{book}\usepackage{tikz}as the preamble everything works as expected. – Skillmon Aug 28 '21 at 11:54