為什麼 tikz 連接我的節點?

為什麼 tikz 連接我的節點?

我用

\usepackage{pdflscape}
\usepackage{tikz}
\usetikzlibrary{automata}

我的程式碼看起來像這樣

\begin{figure}
\centering
\begin{tikzpicture}
\node[draw,align=center,text width=0.16\textwidth] at (-0.34\textwidth,0) {Applet};
\node[draw,align=center,text width=0.16\textwidth] at (-0.17\textwidth,0) {Applet};
\node[draw,align=center,text width=0.16\textwidth] at (0,0) {Applet};
\node[draw,align=center,text width=0.5\textwidth] at (-0.17\textwidth,-0.7) {Java Card Operating System};
\node[draw,align=center,text width=0.3\textwidth] at (0.27\textwidth,-0.35) { Native \\ Application \vspace{8pt}};
\node[draw,align=center,text width=0.84\textwidth] at (0,-1.44) {\gls{ic} Platform};
\end{tikzpicture}
\caption{Architecture of a \gls{smartcard}}
\label{figure:smartcardarchitecture}
\end{figure}

當我編譯它時,結果圖片是在此輸入影像描述

如何去掉 Applet 框之間的線條?

我也很高興獲得一些關於如何正確對齊盒子高度的指導 - 但不要太複雜;-)。

答案1

彼此Applet太靠近並且重疊。請比較修改後的範例。我不確定你的\gls意思是什麼...

\documentclass{article}

\usepackage{pdflscape}
\usepackage{tikz}
\usetikzlibrary{automata}

\begin{document}
and my code looks like this

\def\gls{\MakeUppercase}

\begin{figure}
\centering
\begin{tikzpicture}
\node[draw,color=red,align=center,text width=0.16\textwidth] at (-0.34\textwidth,0) {Applet};
\node[draw,align=center,text width=0.16\textwidth] at (-0.17\textwidth,0) {Applet};
\node[draw,align=center,text width=0.16\textwidth] at (0,0) {Applet};
\node[draw,align=center,text width=0.5\textwidth] at (-0.17\textwidth,-0.7) {Java Card Operating System};
\node[draw,align=center,text width=0.3\textwidth] at (0.27\textwidth,-0.35) { Native \\ Application \vspace{8pt}};
\node[draw,align=center,text width=0.84\textwidth] at (0,-1.44) {\gls{ic}
 Platform};
\end{tikzpicture}
\caption{Architecture of a \gls{smartcard}}
\label{figure:smartcardarchitecture}
\end{figure}

\end{document}

在此輸入影像描述

相關內容