I'm trying to draw a simple diagram in TikZ. I used a code example from the documentation (code below). As you can see on the graphic:
there is a problem with arrows that are not touching the destination nodes. The propblem is especially visible on loop arrows. Even if I draw the simplest diagram, the arrows are always spaced from nodes. In my .tex document I use many packages so this distance may probably result in some other setting from other package.
Is there a way (parameter) I can control the arrow distance from the destination node? How can I change the below code to have the tip of the arrow touch the destination node? The "shorten" param seems to control the distance from the origin node.
\begin{tikzpicture}[->,>=stealth',shorten <=1pt,auto,node distance=2.8cm,semithick]
\tikzstyle{every state}=[fill=red,draw=none,text=white]
\node[initial,state] (A) {$q_a$};
\node[state] (B) [above right of=A] {$q_b$};
\node[state] (D) [below right of=A] {$q_d$};
\node[state] (C) [below right of=B] {$q_c$};
\node[state] (E) [below of=D] {$q_e$};
\path (A) edge node {0,1,L} (B)
edge node {1,1,R} (C)
(B) edge [loop above] node {1,1,L} (B)
edge node {0,1,L} (C)
(C) edge node {0,1,L} (D)
edge [bend left] node {1,0,R} (E)
(D) edge [loop below] node {1,1,R} (D)
edge node {0,1,R} (A)
(E) edge [bend left] node {1,0,R} (A);
\node [right=1cm,text width=8cm,font=\footnotesize] at (C)
{
The current candidate for the busy beaver for five states. It is
presumed that this Turing machine writes a maximum number of
$1$'s before halting among all Turing machines with five states
and the tape alphabet $\{0, 1\}$. Proving this conjecture is an
open research problem.
};
\end{tikzpicture}
Preamble:
\pdfoutput=1
\pdfcompresslevel=9
\pdfinfo
{
/Author (xxx)
/Title (xxx)
/Subject (xxx)
/Keywords (xxx)
}
\documentclass[a4paper,onecolumn,oneside,11pt,wide,floatssmall]{mwrep}
\usepackage{mathtools}
\usepackage{tikz}
\usepackage{pgf}
\usetikzlibrary{arrows,automata}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{bookman}
\usepackage[absolute]{textpos}
\usepackage{geometry}
\usepackage{t1enc}
\usepackage[pdftex, bookmarks=true]{hyperref}
\def\url#1{{ \tt #1}}
\usepackage{listings}
\usepackage[utf8]{inputenc}
\textwidth\paperwidth
\advance\textwidth -55mm
\oddsidemargin-0.9in
\advance\oddsidemargin 33mm
\evensidemargin-0.9in
\advance\evensidemargin 33mm
\topmargin -1in
\advance\topmargin 25mm
\setlength\textheight{48\baselineskip}
\addtolength\textheight{\topskip}
\marginparwidth15mm
\clubpenalty=10000
\widowpenalty=10000
\brokenpenalty=10000
\sloppy
\tolerance4500
\pretolerance250
\hfuzz=1.5pt
\hbadness1450
\renewcommand{\chaptermark}[1]{\markboth{\scshape\small\bfseries #1}{\small\bfseries \ #1}}
\renewcommand{\sectionmark}[1]{\markboth{\scshape\small\bfseries\thesection. #1}{\small\bfseries\thesection.\ #1}}
\pagestyle{uheadings}
%\usepackage[pdftex]{color,graphicx}
\usepackage{color,graphicx}
\usepackage[utf8]{inputenc}
\usepackage[sort, compress]{cite}
\usepackage{multirow}
\usepackage{rotating}
\usepackage{longtable}
\usepackage{hyperref}
\usepackage{enumerate}
\usepackage{array}
\usepackage{tabularx}
\usepackage{glossaries}
\makeglossaries
\theoremstyle{definition}
\newtheorem{defn}{Definicja}[section]
\newtheorem{conj}{Teza}[section]
\newtheorem{conjmain}{Teza}
\newtheorem{exmp}{Przykład}[section]
\theoremstyle{plain}
\newtheorem{thm}{Twierdzenie}[section]
\newtheorem{lem}[thm]{Lemat}
\newtheorem{prop}[thm]{Hipoteza}
\newtheorem*{cor}{Wniosek}
\theoremstyle{remark}
\newtheorem*{rem}{Uwaga}
\newtheorem*{note}{Uwaga}
\newtheorem{case}{Przypadek}
\definecolor{ListingBackground}{rgb}{0.95,0.95,0.95}
\begin{document}
\input {glo/glossary}
\lstdefinestyle{incode}
{
basicstyle={\footnotesize},
keywordstyle={\bf\footnotesize\color{blue}},
commentstyle={\em\footnotesize\color{magenta}},
numbers=left,
stepnumber=5,
firstnumber=1,
numberfirstline=true,
numberblanklines=true,
numberstyle={\sf\tiny},
numbersep=10pt,
tabsize=2,
xleftmargin=17pt,
framexleftmargin=3pt,
framexbottommargin=2pt,
framextopmargin=2pt,
framexrightmargin=0pt,
showstringspaces=true,
backgroundcolor={\color{ListingBackground}},
extendedchars=true,
captionpos=b,
frame=tb,
framerule=0pt,
}
\lstdefinestyle{outcode}
{
basicstyle={\footnotesize},
keywordstyle={\bf\footnotesize\color{blue}},
commentstyle={\em\footnotesize\color{magenta}},
numbers=left,
stepnumber=5,
firstnumber=1,
numberfirstline=true,
numberblanklines=true,
numberstyle={\sf\tiny},
numbersep=10pt,
tabsize=2,
xleftmargin=17pt,
framexleftmargin=3pt,
framexbottommargin=2pt,
framextopmargin=2pt,
framexrightmargin=0pt,
showstringspaces=true,
backgroundcolor={\color{ListingBackground}},
extendedchars=true,
captionpos=b,
frame=tb,
framerule=0.1pt,
}
\renewcommand*\lstlistingname{Wydruk}
\renewcommand*\lstlistlistingname{Spis wydrukĂłw}
\pagenumbering{roman}
\renewcommand{\baselinestretch}{1.0}
\raggedbottom
\input {tex/Tytulowa}
\tableofcontents
\listoffigures
\listoftables
\printglossaries
shorten >= 1pt
will increase the distance between the arrow tip and the destination node. Have you tried creating a new document only with the TikZ picture in it? The problem should go away then. It really seems to be something else interfering, but unless you give more clues, we won't be able to tell for sure what it is.