
我必須插入希臘字母來代替 V_0 和 C_t,但似乎沒有任何效果。有什麼提示嗎?
\documentclass[11pt,a4paper]{article}
\usepackage{tikz}
% tikzstyle è deprecato:
% http://tex.stackexchange.com/q/52372/13304
\tikzset{bag/.style={text width=2em, text centered}}% align=center
\begin{document}
\begin{tikzpicture}
\draw[|-stealth] (0,0) -- (8,0) node[right]{$t$};
\foreach \x/\testosopra/\testosotto in {0/V_0/{0},7/C_t/t}{
\draw(\x,0.1)--(\x,-0.1);
\node[above,font=\scriptsize]at (\x,0.1) (\testosopra) {$\testosopra$};
\node[below,font=\scriptsize]at (\x,-0.1) {$\testosotto$};
}
\end{tikzpicture}
\end{document}
答案1
問題出(\testosopra)
在\draw
宏觀。我認為(不知道tikz
)這是一個節點的內部標籤,結論是內部標籤不能是希臘宏。在這裡,我替換(\x)
為(\testosopra)
,因為允許使用“0”和“7”等內部標籤。
這樣做,我沒有問題然後V_0
用\alpha
和C_t
替換\beta
。
\documentclass[11pt,a4paper]{article}
\usepackage{tikz}
% tikzstyle è deprecato:
% http://tex.stackexchange.com/q/52372/13304
\tikzset{bag/.style={text width=2em, text centered}}% align=center
\begin{document}
\begin{tikzpicture}
\draw[|-stealth] (0,0) -- (8,0) node[right]{$t$};
\foreach \x/\testosopra/\testosotto in {0/\alpha/{0},7/\beta/t}{
\draw(\x,0.1)--(\x,-0.1);
\node[above,font=\scriptsize]at (\x,0.1) (\x) {$\testosopra$};
\node[below,font=\scriptsize]at (\x,-0.1) {$\testosotto$};
}
\end{tikzpicture}
\end{document}