I have recently been trying to format my science assignment in LaTeX. I tried to make a flowchart using Tikz, succeeding but only to find that the flowchart went slightly off the right of the page. Please do not be too critical for I picked up LaTeX quickly to do my science assignment.
Code for Tikz Diagram and Preamble:
Preamble:
\documentclass[titlepage]{report}
\title{Year 9 Science Assignment}
\author{James Balajan}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[
backend=biber,
style=alphabetic,
sorting=ynt
]{biblatex}
\addbibresource{Science.bib}
\usepackage{tikz}
\usepackage{hyperref}
\usetikzlibrary{shapes.geometric, arrows, decorations.pathreplacing, decorations.pathmorphing}
\tikzstyle{arrow} = [thick,->,>=stealth]
\tikzstyle{default} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=white!30]:
Diagram:
\begin{tikzpicture}[node distance=2cm]
\node (1) [default] {Sodium Potassium mixture comes into contact with water};
\node (2) [default, below of=1] {Electrons released, positively charged atoms remain};
\node (3) [default, below of=2] {Positvely atoms are pushed away from each other due to electrostatic forces, creating spikes, exposing new electrons to the water};
\node (4) [default, below of=3] {Other electrons leave the atoms leaving more positively charged atoms, creating more spikes};
\node (5) [default, below of=4] {The cycle of electrons escaping leaving positively charged atoms continues till it eventually builds up enough heat to ignite the hydrogen gas};
\draw [arrow] (1) -- (2);
\draw [arrow] (2) -- (3);
\draw [arrow] (3) -- (4);
\draw [arrow] (4) -- (5);
\end{tikzpicture}
\documentclass{...}
and ending with\end{document}
.