Tikz 问题——编译似乎永远持续下去!

Tikz 问题——编译似乎永远持续下去!

我正在尝试编译这个不太复杂的图形,但 pdflatex 和 latex 似乎都需要很长时间。即使经过多次尝试并等待长达 5 分钟,它们也从未成功完成。

还有人遇到过这个问题吗?这是一个错误,还是文档有问题?

\documentclass[twocolumn]{article}
\usepackage{tikz}
\begin{document}
\begin{figure}
  \centering
  \begin{tikzpicture}
    [auto,
    block/.style
    ={rectangle, draw=blue, thick, fill=blue!20,
      text width=5em,align=center, rounded corners,
      minimum height=3em},
    line/.style
    ={draw, shorten >=2pt},
    \matrix [column sep=5mm,row sep=7mm]
    {
      % row 1
      \node [text width=4.5em,align=center,font=\large] {Geography\\Dimension}; & &
      \node [text width=4.5em,align=center,font=\large] {Time\\Dimension};\\
      % row 2
      \node [block] (country) {Country}; & &
      \node [block] (year) {Year}; \\
      % row 3
      \node [block] (state) {State}; & &
      \node [block] (month) {Month}; \\
      % row 4
      \node [block] (city) {City}; & &
      \node [block] (day) {Day};\\
    };
    \begin{scope}[every path/.style=line]
      \path
      (country)
      -- (state);
      \path 
      (state)
      -- (city);
      \path
      (year)
      -- (month);
      \path
      (month)
      -- (day);
    \end{scope}
  \end{tikzpicture}
  \caption{Dimension-levels example}
  \label{fig:dimlevels}
\end{figure}

\end{document}

终端输出的最后几行:

...
(/usr/local/share/texmf/tex/generic/pgf-2.10/tex/generic/pgf/utilities/pgffor.c
ode.tex))
(/usr/local/share/texmf/tex/generic/pgf-2.10/tex/generic/pgf/frontendlayer/tikz
/tikz.code.tex
(/usr/local/share/texmf/tex/generic/pgf-2.10/tex/generic/pgf/libraries/pgflibra
ryplothandlers.code.tex)
(/usr/local/share/texmf/tex/generic/pgf-2.10/tex/generic/pgf/modules/pgfmodulem
atrix.code.tex)
(/usr/local/share/texmf/tex/generic/pgf-2.10/tex/generic/pgf/frontendlayer/tikz
/libraries/tikzlibrarytopaths.code.tex))) (./test2.aux)
ABD: EveryShipout initializing macros

答案1

您忘记将 a 附加]到 tikzpicture 环境的参数中。

相关内容