\path 命令存在问题,未定义控制序列

\path 命令存在问题,未定义控制序列

我正在尝试创建一个逻辑方案,但\path环境命令有问题tikzpicture。我不知道为什么,但我无法在节点之间创建连接。我尝试了各种命令(\path、、、等),但编译时 LateX 说它是一个。请参阅下面的代码。\path{draw}\draw\path[->]Undefined control sequence

如果我用代码注释这些行,则\path...可以正常工作,但显然这些框没有任何箭头链接。

我究竟做错了什么?

PS:我使用的是 Win7,MikTeX 2.9 64 位和 TeXnicCenter

\documentclass[a4paper,twoside,openright,11pt]{report}    
\usepackage[T1]{fontenc} 
\usepackage[utf8]{inputenc} 
\usepackage[english]{babel} 
\usepackage{graphicx}
\usepackage{caption} 
\usepackage{subfig} 
\usepackage{booktabs} 
\usepackage{float} 
\usepackage{amsmath} 
\usepackage{siunitx} 
\usepackage{bbding}
\usepackage{geometry}
\usepackage{xcolor}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\usepackage{tikz}
\usetikzlibrary{arrows,snakes,backgrounds}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{intersections}
\usepackage{listings}
\lstset{basicstyle=\small\ttfamily}
\lstset{language=Matlab}
\addto\captionsenglish{\renewcommand{\bibname}{References}}

\begin{document}
[...]
\begin{tikzpicture}[auto]

\tikzstyle{block1} = [rectangle, draw=blue, thick, fill=blue!20,
    text width=80mm, text centered, rounded corners, minimum width=80mm, 
    inner sep=2mm]
\tikzstyle{block2} = [rectangle, draw=red, thin, fill=red!20,
    text width=80mm, text centered, sharp corners, minimum width=60mm, inner sep=2mm]
\tikzstyle{line} = [draw, thick, -latex’,shorten >=0pt];
\matrix [column sep=5mm,row sep=7mm]
{
    % row 1
        \node [block1] (init) {
            \large{\lstinline$startup.m$}
            \footnotesize{
            \begin{itemize}
                \item geometry file name
                \item fluid and thermodynamic library settings
                \item \textit{``Error\_report.txt''} initialization
            \end{itemize}
            }
            }; \\
    % row 2
        \node [block1] (main) {
            \large{\lstinline$turbine_calculation_singlepoint.m$}
            \footnotesize{
            \begin{itemize}
                \item thermodynamic boundary conditions settings
                \item load geometry
            \end{itemize}
            }
            }; \\
    % row 3
        \node [block2] (turb_calc) {
            \large{\lstinline$turbine_calculation.m$}
            };  \\
    % row 4
        \node [block2] (1st_calc) {
            First stage calculation with \lstinline$stage_calculation.m$
            }; \\
    % row 5
};

\tikzstyle{every path}=[line];
\path   (init)      -- (main);
\path   (main)      -- (turb_calc);
\path   (turb_calc) -- (1st_calc);

\end{tikzpicture}

[...]

\end{document}

答案1

原始代码包含一个RIGHT SINGLE QUOTATION MARKUnicode 中的)而不是'APOSTROPHEUnicode 中的)

\tikzstyle{line} = [draw, thick, -latex’,shorten >=0pt];

使用正确的提示,代码可以编译成功:

在此处输入图片描述

相关内容