Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a tikz-picture. It is a graph. I have created a presentation and it is seen in the presentation correct. Thereby, the code is correct. But now I am making a degree work and I have

\documentclass{report} 

But the picture is not shown. Here is the code:

\begin{tikzpicture}
    \tikzset{VertexStyleOrange/.style = {
                 shape         = circle,
                                 ball color     = orange,
                                 inner sep      = 1pt,
                                 outer sep      = 0pt,
                                 minimum size   = 1 pt}}
    \tikzset{VertexStyleBlue/.style = {
                 shape          = circle,
                                 ball color     = blue,
                                 inner sep      = 1pt,
                                 outer sep      = 0pt,
                                 minimum size   = 1 pt}}
    \tikzset{EdgeStyleBlue/.style   = {thick,
                                 double  = blue,
                                 double distance = 1pt}}
 \tikzset{EdgeStyle/.style   = {thick,
                                 double  = orange,
                                 double distance = 1pt}}

\node at ( -3.5,3)[VertexStyleOrange](0) {0};                                
\node at ( -5,1)[VertexStyleBlue](1) {1};
\node at ( -2,1)[VertexStyleBlue](2) {2};
\node at ( -2,-1)[VertexStyleBlue](3) {3};
\node at ( -5,-1)[VertexStyleBlue](4) {4};
\node at ( -3.5,-3)[VertexStyleOrange](5) {5};
\node at ( 3.5,3)[VertexStyleOrange](6) {0};                                
\node at ( 5,1)[VertexStyleBlue](7) {1};
\node at ( 2,1)[VertexStyleBlue](8) {2};
\node at ( 2,-1)[VertexStyleBlue](9) {3};
\node at ( 5,-1)[VertexStyleBlue](10) {4};
\node at ( 3.5,-3)[VertexStyleOrange](11) {5};

\draw[EdgeStyle](1) to node{}(0);
\draw[EdgeStyle](2) to node{}(0);
\draw[EdgeStyleBlue](1) to node{}(2);
\draw[EdgeStyleBlue](2) to node{}(3);
\draw[EdgeStyleBlue](3) to node{}(4);
\draw[EdgeStyleBlue](4) to node{}(1);
\draw[EdgeStyleBlue](1) to node{}(3);
\draw[EdgeStyleBlue](4) to node{}(2);
\draw[EdgeStyle](5) to node{}(3);
\draw[EdgeStyle](4) to node{}(5);

\draw[EdgeStyle](11) to node{}(7);
\draw[EdgeStyle](11) to node{}(8);
\draw[EdgeStyle](6) to node{}(10);
\draw[EdgeStyle](6) to node{}(9);

\end{tikzpicture}

Instead of it I see a little black point. I pasted it in all places of document, but the result was the same - a little black stain. What is the reason?

Here is the example:

\documentclass[a4paper,14pt]{report}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amssymb,amsfonts,amsmath,mathtext,cite,enumerate,float}
\usepackage[dvips]{graphicx}
\usepackage[14pt]{extsizes}
\usepackage{times}
\usepackage{hyperref}
\usepackage{tikz}
\usepackage[labelsep=period]{caption}
\usepackage{indentfirst} 
\usepackage{makecell} 
\DeclareCaptionLabelSeparator{par}{\par}
\captionsetup{labelsep=par,justification=centering}
\graphicspath{{images/}}


\newcommand\tablecaption[1]{
\captionsetup{labelsep=par,justification=centering}
\caption{#1}
}

\renewcommand{\baselinestretch}{1.5}\normalsize
\makeatletter
\renewcommand{\@biblabel}[1]{#1.}
\makeatother


\usepackage{geometry}
\geometry{left=3cm}
\geometry{right=1cm}
\geometry{top=2cm}
\geometry{bottom=2cm}

\setcounter{tocdepth}{2}
\setlength{\parindent}{1.5cm}

\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\labelenumi}{\arabic{enumi}}
\renewcommand{\theenumii}{.\arabic{enumii}}
\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}.}
\renewcommand{\theenumiii}{.\arabic{enumiii}}
\renewcommand{\labelenumiii}{\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}.}
\renewcommand{\rmdefault}{ftm}

\begin{document}
\renewcommand\contentsname{Table of Contents}
\renewcommand\chaptername{Chapter}
\tableofcontents
\input{Introduction}
\end{document}

There is another code in "introduction":

\chapter{Introduction}
I want to tell you about smth...

\begin{center}
\begin{tikzpicture}
    \tikzset{VertexStyleOrange/.style = {
                 shape         = circle,
                                 ball color     = orange,
                                 inner sep      = 1pt,
                                 outer sep      = 0pt,
                                 minimum size   = 1 pt}}
    \tikzset{VertexStyleBlue/.style = {
                 shape          = circle,
                                 ball color     = blue,
                                 inner sep      = 1pt,
                                 outer sep      = 0pt,
                                 minimum size   = 1 pt}}
    \tikzset{EdgeStyleBlue/.style   = {thick,
                                 double  = blue,
                                 double distance = 1pt}}
 \tikzset{EdgeStyle/.style   = {thick,
                                 double  = orange,
                                 double distance = 1pt}}

\node at ( -3.5,3)[VertexStyleOrange](0) {0};                                
\node at ( -5,1)[VertexStyleBlue](1) {1};
\node at ( -2,1)[VertexStyleBlue](2) {2};
\node at ( -2,-1)[VertexStyleBlue](3) {3};
\node at ( -5,-1)[VertexStyleBlue](4) {4};
\node at ( -3.5,-3)[VertexStyleOrange](5) {5};
\node at ( 3.5,3)[VertexStyleOrange](6) {0};                                
\node at ( 5,1)[VertexStyleBlue](7) {1};
\node at ( 2,1)[VertexStyleBlue](8) {2};
\node at ( 2,-1)[VertexStyleBlue](9) {3};
\node at ( 5,-1)[VertexStyleBlue](10) {4};
\node at ( 3.5,-3)[VertexStyleOrange](11) {5};

\draw[EdgeStyle](1) to node{}(0);
\draw[EdgeStyle](2) to node{}(0);
\draw[EdgeStyleBlue](1) to node{}(2);
\draw[EdgeStyleBlue](2) to node{}(3);
\draw[EdgeStyleBlue](3) to node{}(4);
\draw[EdgeStyleBlue](4) to node{}(1);
\draw[EdgeStyleBlue](1) to node{}(3);
\draw[EdgeStyleBlue](4) to node{}(2);
\draw[EdgeStyle](5) to node{}(3);
\draw[EdgeStyle](4) to node{}(5);

\draw[EdgeStyle](11) to node{}(7);
\draw[EdgeStyle](11) to node{}(8);
\draw[EdgeStyle](6) to node{}(10);
\draw[EdgeStyle](6) to node{}(9);

\end{tikzpicture}
\end{center}

Even after deleting \begin{center} the picture is not shown

share|improve this question
    
Maybe you forgot to load tikz. I've just tried your code and for me works. –  Claudio Fiandrino Apr 25 '12 at 12:01
1  
You need to give us a minimal working example that demonstrates the issue that you're having. Without it, we can't see what packages you're using etc. –  qubyte Apr 25 '12 at 12:09
    
I have added an example –  user565447 Apr 25 '12 at 12:20
1  
Try removing the dvips option from graphicx. –  Torbjørn T. Apr 25 '12 at 13:18
    
that was the reason, thank you very much! –  user565447 Apr 25 '12 at 19:26
add comment

1 Answer 1

Works perfectly but you can modify your code a little bit

\documentclass[11pt]{report}
\usepackage{tikz}
\usetikzlibrary{%
  arrows,
  calc
}

\begin{document}
\chapter{Introduction}
I want to tell you about smth...

\begin{center}
\begin{tikzpicture}
    \tikzset{VertexStyle/.style = {
                 shape         = circle,
                                 ball color     = #1,
                                 inner sep      = 1pt,
                                 outer sep      = 0pt,
                                 minimum size   = 1 pt}}


 \tikzset{EdgeStyle/.style   = {thick,
                                 double  = #1,
                                 double distance = 1pt}}


\begin{scope}[every node/.style={VertexStyle=blue}]                             
    \node at ( -5,1)  (1) {1};
    \node at ( -2,1)  (2) {2};
    \node at ( -2,-1) (3) {3};
    \node at ( -5,-1) (4) {4};
    \node at ( 3.5,3) (6) {0};                                
    \node at ( 5,1)   (7) {1};
    \node at ( 2,1)   (8) {2};
    \node at ( 2,-1)  (9) {3};
    \node at ( 5,-1)  (10) {4}; 
\end{scope}

\begin{scope}[every node/.style={VertexStyle=orange}]
    \node at ( -3.5,3)  (0) {0};                                
    \node at ( -3.5,-3) (5) {5};
    \node at ( 3.5,3)   (6) {0};                                
    \node at ( 3.5,-3)  (11) {5};  
\end{scope}   

\begin{scope}
\draw[EdgeStyle=blue]   
 (1) to  (2)
 (2) to  (3)
 (3) to  (4)
 (4) to  (1)
 (1) to  (3)
 (4) to  (2);  
\end{scope}   

\begin{scope}
\draw[EdgeStyle=orange] 
 (1)     to  (0)
 (2)     to  (0)
 (5)     to  (3)
 (4)     to  (5)
 (11)    to  (7)
 (11)    to  (8)
 (6)     to  (10)
 (6)     to  (9);  
\end{scope}  

\end{tikzpicture}
\end{center}
\end{document}  

enter image description here

share|improve this answer
    
tkz-graph can simplify this kind of code –  Alain Matthes Apr 25 '12 at 13:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.