考虑以下 TeX 代码:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\matrix (mat) at (7,-4) [matrix of nodes,ampersand replacement=\&,
nodes={draw,rectangle}]
{
\node {B}; \& \node {B}; \& \node {B}; \& \node {B}; \\
\node {0}; \& \node {1}; \& \node {B}; \& \node {B}; \\
};
\end{tikzpicture}
\end{frame}
\end{document}
选择哪些正确的选项才能使所有水平线和垂直线具有相同的粗细?
答案1
您可以尝试使用最小宽度和高度选项:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\matrix (mat) at (7,-4) [matrix of nodes,ampersand replacement=\&,
nodes={draw,rectangle, minimum width=1cm, minimum height=1cm}]
{
B \& B \& B \& B \\
0 \& 1 \& B \& B \\
};
\end{tikzpicture}
\end{frame}
\end{document}