# Cut off graphs using dot2texi with TikZ

I am creating concept maps using dot2texi and TiKz. However, with more complex maps the current style sometimes causes the map to be cut off. This despite the fact that in theory there is actually enough space left. I read the dot2texi and the TikZ manual, but I am still in the dark about how this can be automatically adjusted. This is very important to me: I don't want to adjust the graphs manually. For they are the result of an org-mode source block: cf. here

Here is an example of a map that is cut off on the right hand side:

And here is the relevant LaTeX source code as created by Org-mode LaTeX export:

\documentclass[11pt]{article}
\usepackage{dot2texi}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows}
\usepackage[a4paper,margin=0.8in,landscape]{geometry}
\begin{document}

\section{Chapter 3}

\begin{center}

\begin{dot2tex}[scale=0.8, tikz, options={-t raw --tikzedgelabel --nodeoptions='every node/.style={text width=2cm, text centered, rounded corners, fill=black!10}' --edgeoptions="every node/.style={fill=white, inner sep=1pt}"}]

digraph G {

node [shape=box];

"Chapter 3" -> "general jurisdiction" [label="has", lblstyle="pos=0.35"];
"Chapter 3" -> "special jurisdiction" [label="has", lblstyle="pos=0.35"];
"Chapter 3" -> "particular issues" [label="has", lblstyle="pos=0.35"];

"special jurisdiction" -> "tort" [label="is", lblstyle="pos=0.35"];
"special jurisdiction" -> "contract" [label="is", lblstyle="pos=0.35"];
"special jurisdiction" -> "exclusive jurisdiction" [label="is", lblstyle="pos=0.35"];
"special jurisdiction" -> "submission" [label="is", lblstyle="pos=0.35"];

"special jurisdiction" -> "multiple defendants" [label="is", lblstyle="pos=0.35"];

"special jurisdiction" -> "presence" [label="is", lblstyle="pos=0.35"];

"presence" -> "branch, ageny or other establishment" [label="can be", lblstyle="pos=0.35"];

"contract" -> "general contract" [label="is", lblstyle="pos=0.35"];
"contract" -> "special contracts" [label="is", lblstyle="pos=0.35"];

"special contracts" -> "consumer contracts" [label="can be", lblstyle="pos=0.35"];
"special contracts" -> "employment contract" [label="can be", lblstyle="pos=0.35"];

"submission" -> "regular submission" [label="can be", lblstyle="pos=0.35"];
"submission" -> "choice of court agreements" [label="can be", lblstyle="pos=0.35"];

"particular issues" -> "anti-suit injunctions" [label="can be", lblstyle="pos=0.35"];
"particular issues" -> "forum non conveniens" [label="can be", lblstyle="pos=0.35"];
"particular issues" -> "freezing injunctions" [label="can be", lblstyle="pos=0.35"];

"particular issues" -> "reform of Brussels regulation" [label="can be", lblstyle="pos=0.35"];

}

\end{dot2tex}
\end{center}
\end{document}


EDIT

The example concept map I used seems to be misleading as it suggests that every concept map will or should look like a top-down tree. This may be the case, but need to. Here is a more complex example, which shows that there can be several connections between nodes on different levels/branches. This new example is cut off, too. For demonstration purposes I merely changed the paper size to A3 and then took a screenshot:

• Please, remove all unnecessary packages? Compiling with pdfLaTeX gives empty page ... – Zarko Jul 21 '16 at 9:36
• @Zarko: I removed some packages that may be unnecessary. Unfortunately, you are correct. There are only two "empty" packages, because the dotfile is not converted. Before posting my question, it worked. I have to look into the issue. Thanks so far! – Singulaere Entitaet Jul 21 '16 at 9:50
• You still haw twice 7inputenc and fontenc. I also daubt that for diagram is titlesec necessary. For test purposes you can add option showframe to geometry package. It seems that sibling distance in second level of tree is to big. – Zarko Jul 21 '16 at 9:56
• @Zarko: the unedited MWE works, but you have to use pdflatexwith the option -shell-escape as dot2texi has to run graphviz. Notice that I removed the sibling distance=2cm and level distance=2cm from the options. Decreasing or increasing these values seems to have no visual effect, neither positive nor negative. I do see why the cut off happens. dot2texi keeps a constant distance between the nodes on the second level. As the node special jurisdiction gets very broad on the third level, the node particular issues is moved to the far right, to keep in line with 2nd level. – Singulaere Entitaet Jul 21 '16 at 19:28
• It would be beneficial, if dot2texi would allow that nodes on the same level are not aligned horizontally. special jurisdiction could move down and make room for particular issues`. Concept maps don't have to look like clean trees, so this would be ok. – Singulaere Entitaet Jul 21 '16 at 19:30