# image/graph looks bad in template

I have some problem with a graph packet in LaTeX. http://www.texample.net/tikz/examples/drawing-graphs/ is the package I'm using.

It worked fine for me to compile the example from the webbpage but the graph looks very bad when I copied it to my thesis document. I am using the template idamasterthesis.cls in my document with can be downloaded from https://www.ida.liu.se/edu/templates/latex/idamallar-latest.tar

MVE:

\documentclass[cropmarks, frame, english]{idamasterthesis}

\usepackage{flafter}
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{graphdrawing}
\usetikzlibrary{graphs}

\abstract{%
\S\ This is the abstract.
}

\begin{document}

%\layout

\makeintropages

\chapter{Introduction}

\begin{figure}
\begin{tikzpicture}[>=stealth, every node/.style={circle, draw, minimum          size=0.75cm}]
\graph [tree layout, grow=down, fresh nodes, level distance=0.5in, sibling     distance=0.5in]
{
A -> {
B -> { A -> {C}, C -> {D} ,D },
C -> { A, B -> {C  ,D} },
D -> { C }
}
};

\end{tikzpicture}
\caption{this is the text for the img}
\end{figure}

\end{document}


This is the picture of how the graph looks in my thesis:

Please note that the graph libary needs to be compiled by lualatex!

• Please give us a MWE of your code showing your problem. – AboAmmar Apr 15 '15 at 21:17
• Sorry, but what is "MWE"? – Niclas Jonsson Apr 15 '15 at 21:18
• Minimal working example (MWE) – egreg Apr 15 '15 at 21:20
• A Minimal Working Example (MWE) is a small peace of code which produces the error or unexpected behavior – AboAmmar Apr 15 '15 at 21:20
• Ok, I got it! I made an edit. – Niclas Jonsson Apr 15 '15 at 21:27

You missed the \usegdlibrary{trees}.
For the inputenc error, if you only need English, you can remove lines 88 and 130 of the class file and make sure you change all non-English letters, like ö, in the class file also. For a more elegant solution to this, you can use the etoolbox package, which provides commands like \pretocmd with which you can temporarily change some parts of the class file without actually changing any thing in the class file.
\pretocmd{<command>}{<code>}{<success>}{<failure>}