1

I have a diagram that I want to include in my latex document. However, the diagram is not rendered properly. I am using Texmaker 4.1.1 with MiKTeX 2.9 on a Windows 7 32-bit machine.

enter image description here

\documentclass[letterpaper, 10pt, conference]{ieeeconf}
\usepackage{times}
\usepackage{amsmath}
\usepackage{url}
\usepackage{cite}
\usepackage[dvips]{graphicx}
\usepackage{subfigure}
\usepackage{float}
\restylefloat{figure}
\usepackage{flafter}
\usepackage[section]{placeins}
\usepackage{pseudocode}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}

\begin{document}
\tikzset{
  box/.style    = {draw, rectangle, minimum height = 2.5em, minimum width = 2.5em},
  circl/.style  = {draw, circle, minimum size = 8mm,label={[font=\small, inner sep=1pt]200:$+$}},
  input/.style  = {coordinate},
  output/.style = {coordinate},
   to/.style    = {->,>=stealth', shorten >=1pt, semithick, font=\small}
}

\thispagestyle{empty}
\pagestyle{empty}

\section{How To Use}
\begin{figure}[H]
\centering
\begin{tikzpicture}[auto, node distance=2cm]
\node (in1) [input] {};
\node (cs) [box, right of=in1] {$C$};
\node (crc1) [circl, right of=cs]{};
\node (gs) [box, right of=crc1] {$G$};
\node (hs) [box, right of=gs] {$H$};
\node (ctl) [box, below of=hs] {Limiter};
\node (crc2) [circl, right of=hs]{};
\node (ze) [input, above of=crc2] {};
\node (ke) [box, right of=crc2] {$K$};
\node (fs) [output, right of=ke] {};

\draw [to] (in1) -- node {$f$}(cs);
\draw [to] (cs) -- (crc1);
\draw [to] (crc1) --(gs);
\draw [to] (gs) -- (hs);
\draw [to] (hs) -- node {$I_{max}$}(ctl);
\draw [to] (ctl) --node {$\theta$}(hs);
\draw [to] (hs) -- node {$z$}(crc2);
\draw [to] (ze) -- node {$C$}(crc2);
\draw [to] (crc2) --(ke);
\draw [to] (ke) -- node {$f(s)$}(fs);

\end{tikzpicture}
\caption{The above figure is control diagram}
\label{fig:force-control-scheme}
\end{figure}
\end{document}
Torbjørn T.
  • 206,688
ravi
  • 1,618
  • Use 10pt, not 10 pt (also, that may be the default, so it could be omitted). Are you compiling with pdfLaTeX? – Werner Aug 27 '14 at 16:13
  • 2
    Can you provide a minimal working example, especially also including, which tikzpackages you are using? That would be helpful. – Ronny Aug 27 '14 at 16:13
  • You appear to be missing all the tikz style definitions that were in your other question here. – Mark Wibrow Aug 27 '14 at 16:19
  • Dear all, please see my updated question. Thank you. – ravi Aug 27 '14 at 17:52
  • 3
    I assume you're using pdflatex to compile. If this is the case, don't use option dvips for the graphicx package. Also, tikz loads graphicx on its own, so you don't need to load it yourself. – Paul Gessler Aug 27 '14 at 18:02
  • @PaulGessler: I tried to remove \usepackage[dvips]{graphicx} but I am using \DeclareGraphicsExtensions{.eps} also. Please suggest a way. – ravi Aug 27 '14 at 19:04
  • 1
    There's no hope of being able to preview correctly a DVI file containing TikZ pictures, because they contain PostScript specials that no DVI viewer is able to interpret. – egreg Aug 27 '14 at 20:41

1 Answers1

2

\usepackage[dvips]{graphicx} is not necessary. Just with \usepackage{graphicx}.

If you use either latex or pdflatex try with the package ifpdf. Something like

\usepackage{ifpdf}
\ifpdf
    \usepackage{graphicx}  %If run with `pdflatex`
\else
    \usepackage[dvips]{graphicx} %If run with `latex`
\fi

Although for this case this is not necessary bacause tikz loads graphicx, but can be useful in other cases.

skpblack
  • 8,904
  • 3
  • 31
  • 42
  • 1
    graphicx is smart so it would understand which driver you are using. So the correct way is to remove the option. Those options are there specifically if you want to force a driver. – percusse Aug 28 '14 at 10:02