Tikz 图形无法使用 pdflatex 命令显示

Tikz 图形无法使用 pdflatex 命令显示

我正在尝试使用该命令从 Tikz 内容创建一个图像文件pdflatex

以下是 Tikz 内容:

\begin{document}

\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows, shapes}

\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}
}
\begin{tikzpicture}
  \draw (0,0) -- (4,0);
\end{tikzpicture}

\end{document}

我使用以下命令:

$ pdflatex figure.tex

执行成功结束但是pdf文件是空的。

我正在使用 Linux Mint 并安装了 Textlive:

ii  texlive                                      2015.20160320-1ubuntu0.1                     all          TeX Live: A decent selection of the TeX Live packages
ii  texlive-base                                 2015.20160320-1ubuntu0.1                     all          TeX Live: Essential programs and files
ii  texlive-binaries                             2015.20160222.37495-1ubuntu0.1               amd64        Binaries for TeX Live
ii  texlive-fonts-recommended                    2015.20160320-1ubuntu0.1                     all          TeX Live: Recommended fonts
ii  texlive-latex-base                           2015.20160320-1ubuntu0.1                     all          TeX Live: LaTeX fundamental packages
ii  texlive-latex-recommended                    2015.20160320-1ubuntu0.1                     all          TeX Live: LaTeX recommended packages
ii  texlive-pictures                             2015.20160320-1ubuntu0.1                     all          TeX Live: Graphics, pictures, diagrams

我做错了什么?

谢谢你的帮助!Thierry

答案1

文档不完整,无法成功编译。至少缺少一个文档类,并且包应该位于序言中,而不是文档正文中:

\documentclass[margin=3mm,convert]{standalone}

\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows, shapes}

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


\begin{document}


\begin{tikzpicture}
  \draw (0,0) -- (4,0);
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容