
\path
我正在嘗試創建一個邏輯方案,但我在環境命令方面遇到了問題tikzpicture
。我不知道為什麼,但我無法在節點之間建立連接。我嘗試了各種命令(\path
、\path{draw}
、\draw
、\path[->]
等),但是當我編譯 LateX 時,它說它是一個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 MARK
in Unicode) 而不是'
( APOSTROPHE
in Unicode) 到
\tikzstyle{line} = [draw, thick, -latex’,shorten >=0pt];
使用正確的提示,程式碼可以正常編譯: