TikZ 图表无法正确呈现

TikZ 图表无法正确呈现

我有一个图表,我想将其包含在我的 Latex 文档中。但是,该图表无法正确呈现。我在 Windows 7 32 位计算机上Texmaker 4.1.1使用。MiKTeX 2.9

在此处输入图片描述

\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}

答案1

\usepackage[dvips]{graphicx}没有必要。只需用\usepackage{graphicx}

如果你使用latex或者pdflatex尝试使用包ifpdf。 就像是

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

尽管对于这种情况来说这不是必需的,因为tikz加载graphicx,但在其他情况下可能有用。

相关内容