将两个相邻节点的边界彼此重叠

Place boundary of two adjacent nodes on top of each other

如果我将两个节点彼此相邻放置,则节点之间的最终边界会加倍,使其比其他边界更粗。是否可以将它们重叠放置以保持原始厚度?

这是我的代码,下面是一些示例图片:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{figure}
\begin{center}
\begin{tikzpicture}

\tikzstyle{node} = [draw, rectangle, minimum width=1cm]
\node [node] (n_one) {node 1};
\node [node, right = 0cm of n_one.north east, anchor = north west] (n_two) {node 2};

\end{tikzpicture}
\end{center}
\end{figure}

\end{document}

您可以将右侧节点移动一个线宽:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{figure}
\begin{center}
\begin{tikzpicture}

\tikzstyle{node} = [draw, rectangle, minimum width=1cm]
\node [blue,node] (n_one) {node 1};
\node [red,node, right = -\the\pgflinewidth of n_one.north east, anchor = north west] (n_two) {node 2};

\end{tikzpicture}
\end{center}
\end{figure}

\end{document}

或者您可以只绘制一个节点:

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes.multipart} 

\begin{document}

\begin{figure}
\begin{center}
\begin{tikzpicture}
\node[
  rectangle split, 
  rectangle split parts=2,
  draw, 
  rectangle split horizontal,
  rectangle split part align={center, top, bottom}
] at (0,0)  {node 1\nodepart{two}node 2};
\end{tikzpicture}
\end{center}
\end{figure}

\end{document}