I am trying to fit a UML diagram in a page, but it overflowing to the right. I've tried hfill, flushright, flushleft but none of this work. Here is the code:
\documentclass[twoside,openright,titlepage,numbers=noenddot,headinclude, footinclude=true,cleardoublepage=empty,abstractoff,BCOR=5mm,paper=a4,fontsize=11pt,ngerman,american]{scrreprt}
\usepackage{classicthesis}
\usepackage{tikz-uml}
\usetikzlibrary{positioning}
\begin{document}
See next page\clearpage
\begin{figure}[ht]
\begin{tikzpicture}
\umlclass{Accuracy}{}{}
\umlclass[right=5mm of Accuracy]{DepParsing}{}{}
\umlnest{DepParsing}{Accuracy}
\umlclass[right=5mm of DepParsing]{LabeledSentence}{}{}
\umlassoc{DepParsing}{LabeledSentence}
\umlclass[right=5mm of LabeledSentence]{Tokens}{}{}
\umlclass[above right=3cm and 2mm of LabeledSentence.north]{TrainSentence}{}{}
\umlclass[above=5mm of LabeledSentence,left=5mm of TrainSentence]{TestSentence}{
+ words:Vector[Str]\\
+ tags:Vector[Str]\\
+ tree:Vector[Str]
}{
+ size:Int
}
\umlVHVinherit{LabeledSentence}{TestSentence}
\umlVHVinherit{LabeledSentence}{TrainSentence}
\umlclass[x=0,y=0,left=5mm of TestSentence]{Node}{
+lex:Str\\
+pos:Int\\
+posTag:Str\\
+dep:Int\\
+left:Vector[Node]\\
+right:Vector[Node]
}{}
\umlassoc[mult=1..*,pos=0.5,recursive=-190|190|3cm]{Node}{Node}
\umlassoc[mult2=1,mult1=*]{Node}{TestSentence}
\umlassoc{LabeledSentence}{Tokens}
\umlclass[below=5mm of DepParsing]{SVMAdapter}{}{}
\umlassoc{SVMAdapter}{DepParsing}
\umlclass[left=5mm of SVMAdapter]{SVMProblem}{}{}
\umlnest{SVMAdapter}{SVMProblem}
\end{tikzpicture}
\end{figure}
\end{document}
Here is the output:
What can I do?
NOTE: I am using ClassicThesis
Best regards

positioningTikZ-library, but after adding that I don't get the result in your screenshot, the diagram is much further to the left, and within the page. It's still slightly wider than the textblock, so you get an overfull hbox warning, but not as bad as what you show. – Torbjørn T. Dec 07 '16 at 10:01tikz-uml.stydo you have? I have the one with “fixes made in March 2016”. – egreg Dec 07 '16 at 10:09classicthesisor something? Anyway, the general solution to the problem of too wide diagrams is to make the diagram narrower, for example by restructuring it. If that's not an option you could try centering it around the textblock, using\makeboxoradjustboxas discussed in http://tex.stackexchange.com/a/39436/586 – Torbjørn T. Dec 07 '16 at 10:09\makebox[\textwidth][c]{<insert tikzpicture here>}or theadjustboxenvironment, as in the link I posted? Is that what you wanted to do? – Torbjørn T. Dec 07 '16 at 10:32\makebox, it works. If you want, post it as an answer and I'll accept it. – Alejandro Alcalde Dec 07 '16 at 10:35